qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: Qemu 2D performance plunges below acceptable level


From: Laurent Desnogues
Subject: Re: [Qemu-devel] Re: Qemu 2D performance plunges below acceptable levels
Date: Fri, 20 Feb 2009 18:17:32 +0100

On Fri, Feb 20, 2009 at 5:52 PM, Paul Brook <address@hidden> wrote:
>>      SDL_BlitSurface(guest_screen, &rec, real_screen, &rec);
>> -    SDL_UpdateRect(real_screen, x, y, w, h);
>> +    SDL_UpdateRects(real_screen, 1, &rec);
>
> Have you actually tried this? I'd be amazed and dismayed if it made any
> difference. I can believe that SDL_UpdateRects is better that *multiple*
> calls to SDL_UpdateRect. However I see absolutely no justification for this
> change.

UpdateRect is a thin wrapper around UpdateRects.  So thin I don't believe
it makes any difference (unless you're doing dozens of UpdateRect which
is not the case here as you pointed).


Laurent

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
{
        if ( screen ) {
                SDL_Rect rect;

                /* Perform some checking */
                if ( w == 0 )
                        w = screen->w;
                if ( h == 0 )
                        h = screen->h;
                if ( (int)(x+w) > screen->w )
                        return;
                if ( (int)(y+h) > screen->h )
                        return;

                /* Fill the rectangle */
                rect.x = (Sint16)x;
                rect.y = (Sint16)y;
                rect.w = (Uint16)w;
                rect.h = (Uint16)h;
                SDL_UpdateRects(screen, 1, &rect);
        }
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]