[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 02/11] sdl2: stop flickering
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH v2 02/11] sdl2: stop flickering |
Date: |
Thu, 24 Sep 2015 11:04:53 +0200 |
Optimizing updates by copying the dirty rectangle
only do not work because of double-buffering.
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
ui/sdl2-2d.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
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));
--
1.8.3.1
- [Qemu-devel] [PATCH v2 00/11] add virgl rendering support, Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 02/11] sdl2: stop flickering,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 03/11] ui/console: add opengl context and scanout support interfaces., Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 04/11] virtio-gpu: move iov free to virtio_gpu_cleanup_mapping_iov, Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 01/11] shaders: initialize vertexes once, Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 09/11] opengl: add egl-context.[ch] helpers, Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 06/11] virtio-gpu: update headers for virgl/3d, Gerd Hoffmann, 2015/09/24
- [Qemu-devel] [PATCH v2 08/11] sdl2/opengl: add opengl context and scanout support, Gerd Hoffmann, 2015/09/24