diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-12 12:16:02 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-10-08 10:31:35 +0200 |
commit | 136a8d9d444560f71fca89f27475cfeaffa19cf3 (patch) | |
tree | 48d4514676d06dced7511497d8a64935709a3149 /ui/sdl2-2d.c | |
parent | c046d8284474a0f7763dea849433bde37a69023d (diff) | |
download | hqemu-136a8d9d444560f71fca89f27475cfeaffa19cf3.zip hqemu-136a8d9d444560f71fca89f27475cfeaffa19cf3.tar.gz |
sdl2: stop flickering
Optimizing updates by copying the dirty rectangle
only do not work because of double-buffering.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'ui/sdl2-2d.c')
-rw-r--r-- | ui/sdl2-2d.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c index d0b340f..191ee3b 100644 --- a/ui/sdl2-2d.c +++ b/ui/sdl2-2d.c @@ -45,10 +45,23 @@ void sdl2_2d_update(DisplayChangeListener *dcl, return; } + /* + * SDL2 seems to do some double-buffering, and trying to only + * update the changed areas results in only one of the two buffers + * being updated. Which flickers alot. So lets not try to be + * clever do a full update every time ... + */ +#if 0 rect.x = x; rect.y = y; rect.w = w; rect.h = h; +#else + rect.x = 0; + rect.y = 0; + rect.w = surface_width(surf); + rect.h = surface_height(surf); +#endif SDL_UpdateTexture(scon->texture, NULL, surface_data(surf), surface_stride(surf)); |