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 levels


From: Stefano Stabellini
Subject: Re: [Qemu-devel] Re: Qemu 2D performance plunges below acceptable levels
Date: Fri, 20 Feb 2009 16:37:40 +0000
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

malc wrote:

> 
> It doesn't. FWIW not quite "value preserving" operation of removing call
> to SDL_UpdateRect from sdl_update and putting SDL_Flip into sdl_refresh
> does.
> 



Going through the SDL documentation I found this:

http://www.libsdl.org/faq.php?action=listentries&category=7
Frequently Asked Questions: Mac OS

You may be able to make things faster by calling SDL_UpdateRects()
instead of SDL_UpdateRect() or SDL_Flip(). With SDL_UpdateRects()
you can tell SDL exactly what rectangles of the surface you painted,
and they will all be handed to the window server at once. That way,
the window server does the least amount of work possible.

So in theory this should make sdl faster on MacOSX:

diff --git a/sdl.c b/sdl.c
index 266fbcc..2ce20d2 100644
--- a/sdl.c
+++ b/sdl.c
@@ -62,7 +62,7 @@ static void sdl_update(DisplayState *ds, int x, int y,
int w, int h)
     //    printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h);

     SDL_BlitSurface(guest_screen, &rec, real_screen, &rec);
-    SDL_UpdateRect(real_screen, x, y, w, h);
+    SDL_UpdateRects(real_screen, 1, &rec);
 }

 static void sdl_setdata(DisplayState *ds)







reply via email to

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