aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk-gl-area.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-06-22 13:18:11 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-22 13:18:11 +0100
commit22a9e1fd63ebd7254c6618f144357def75a993cb (patch)
tree003d7a59d9bf8acf153910ac1dbe8e141c560a83 /ui/gtk-gl-area.c
parent84e3d0725b06bdf8c6985788caa7776d6b7353ce (diff)
parent95e92000c8b1e81fce6a7f54ef22656a94793096 (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/queue/ui-pull-request' into staging
# gpg: Signature made Wed 21 Jun 2017 14:23:31 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/queue/ui-pull-request: ui: Remove inclusion of "hw/qdev.h" console: remove do_safe_dpy_refresh gtk: use framebuffer helper functions. sdl2: use framebuffer helper functions. egl-headless: use framebuffer helper functions. egl-helpers: add helpers to handle opengl framebuffers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/gtk-gl-area.c')
-rw-r--r--ui/gtk-gl-area.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index b05c665cbb..18b298fc21 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -26,14 +26,7 @@ static void gtk_gl_area_set_scanout_mode(VirtualConsole *vc, bool scanout)
vc->gfx.scanout_mode = scanout;
if (!vc->gfx.scanout_mode) {
- if (vc->gfx.fbo_id) {
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
- GL_COLOR_ATTACHMENT0_EXT,
- GL_TEXTURE_2D, 0, 0);
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
- glDeleteFramebuffers(1, &vc->gfx.fbo_id);
- vc->gfx.fbo_id = 0;
- }
+ egl_fb_destroy(&vc->gfx.guest_fb);
if (vc->gfx.surface) {
surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds);
surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds);
@@ -56,11 +49,11 @@ void gd_gl_area_draw(VirtualConsole *vc)
wh = gtk_widget_get_allocated_height(vc->gfx.drawing_area);
if (vc->gfx.scanout_mode) {
- if (!vc->gfx.fbo_id) {
+ if (!vc->gfx.guest_fb.framebuffer) {
return;
}
- glBindFramebuffer(GL_READ_FRAMEBUFFER, vc->gfx.fbo_id);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, vc->gfx.guest_fb.framebuffer);
/* GtkGLArea sets GL_DRAW_FRAMEBUFFER for us */
glViewport(0, 0, ww, wh);
@@ -181,24 +174,19 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *dcl,
vc->gfx.y = y;
vc->gfx.w = w;
vc->gfx.h = h;
- vc->gfx.tex_id = backing_id;
vc->gfx.y0_top = backing_y_0_top;
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
- if (vc->gfx.tex_id == 0 || vc->gfx.w == 0 || vc->gfx.h == 0) {
+ if (vc->gfx.guest_fb.framebuffer == 0 ||
+ vc->gfx.w == 0 || vc->gfx.h == 0) {
gtk_gl_area_set_scanout_mode(vc, false);
return;
}
gtk_gl_area_set_scanout_mode(vc, true);
- if (!vc->gfx.fbo_id) {
- glGenFramebuffers(1, &vc->gfx.fbo_id);
- }
-
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, vc->gfx.fbo_id);
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- GL_TEXTURE_2D, vc->gfx.tex_id, 0);
+ egl_fb_create_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
+ backing_id);
}
void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,