summaryrefslogtreecommitdiff
path: root/ui/gtk-egl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-02-21 10:37:21 +0100
committerGerd Hoffmann <kraxel@redhat.com>2017-02-27 16:15:29 +0100
commit543a7a161f51636f0c6a98f00cccab43f3a23993 (patch)
tree529c0851577def2ace697ecb36e3752cee9cc705 /ui/gtk-egl.c
parentdb6cdfbeba791a2e5047a44f61d068cefa0b7c91 (diff)
downloadqemu-543a7a161f51636f0c6a98f00cccab43f3a23993.tar.gz
gtk-egl: add scanout_disable support
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-7-git-send-email-kraxel@redhat.com
Diffstat (limited to 'ui/gtk-egl.c')
-rw-r--r--ui/gtk-egl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index d5541c3535..d53288f027 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -170,6 +170,16 @@ QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
return qemu_egl_create_context(dcl, params);
}
+void gd_egl_scanout_disable(DisplayChangeListener *dcl)
+{
+ VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+
+ vc->gfx.w = 0;
+ vc->gfx.h = 0;
+ vc->gfx.tex_id = 0;
+ gtk_egl_set_scanout_mode(vc, false);
+}
+
void gd_egl_scanout_texture(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
uint32_t backing_width, uint32_t backing_height,
@@ -188,11 +198,6 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, vc->gfx.ectx);
- if (vc->gfx.tex_id == 0 || vc->gfx.w == 0 || vc->gfx.h == 0) {
- gtk_egl_set_scanout_mode(vc, false);
- return;
- }
-
gtk_egl_set_scanout_mode(vc, true);
if (!vc->gfx.fbo_id) {
glGenFramebuffers(1, &vc->gfx.fbo_id);