sdl2: redraw correctly when scanout_mode enabled.
authorTao Wu <lepton@google.com>
Thu, 26 Jul 2018 22:59:00 +0000 (15:59 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 24 Aug 2018 06:40:10 +0000 (08:40 +0200)
When scanout_mode enabled, surface is out of sync with actual screen.
In such case, we just call sdl2_gl_scanout_flush to do redraw. This
fixes bug reported in
https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/001330.html

Signed-off-by: Tao Wu <lepton@google.com>
Message-id: 20180726225900.180698-1-lepton@google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/sdl2-gl.c

index 83b71853d1557a1416cb102b9342d43bc87fe580..1bf4542d8d9659340ad9e677dbdd32b589dc1075 100644 (file)
@@ -124,6 +124,11 @@ void sdl2_gl_redraw(struct sdl2_console *scon)
 {
     assert(scon->opengl);
 
+    if (scon->scanout_mode) {
+        /* sdl2_gl_scanout_flush actually only care about
+         * the first argument. */
+        return sdl2_gl_scanout_flush(&scon->dcl, 0, 0, 0, 0);
+    }
     if (scon->surface) {
         sdl2_gl_render_surface(scon);
     }