diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-02-21 10:37:20 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-02-27 16:15:29 +0100 |
commit | db6cdfbeba791a2e5047a44f61d068cefa0b7c91 (patch) | |
tree | c84256c35380801d9d679f3cbadcfc5afd740825 /ui/sdl2-gl.c | |
parent | 46ffd0c03114acddc84d8fe5be30d04d6bb2b2cb (diff) |
sdl2: 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-6-git-send-email-kraxel@redhat.com
Diffstat (limited to 'ui/sdl2-gl.c')
-rw-r--r-- | ui/sdl2-gl.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index e25aa3bf76..1cd77e2c16 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -184,6 +184,17 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl) return (QEMUGLContext)sdlctx; } +void sdl2_gl_scanout_disable(DisplayChangeListener *dcl) +{ + struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); + + assert(scon->opengl); + scon->w = 0; + scon->h = 0; + scon->tex_id = 0; + sdl2_set_scanout_mode(scon, false); +} + void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, @@ -204,11 +215,6 @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, SDL_GL_MakeCurrent(scon->real_window, scon->winctx); - if (scon->tex_id == 0 || scon->w == 0 || scon->h == 0) { - sdl2_set_scanout_mode(scon, false); - return; - } - sdl2_set_scanout_mode(scon, true); if (!scon->fbo_id) { glGenFramebuffers(1, &scon->fbo_id); |