gtk-gl-area.c (2ff408de9c080f2fb5a94ebf6a209c6180c64933) gtk-gl-area.c (46e19e149f3b129a22c440caba853188df67deab)
1/*
2 * GTK UI -- glarea opengl code.
3 *
4 * Requires 3.16+ (GtkGLArea widget).
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

--- 82 unchanged lines hidden (view full) ---

91{
92 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
93
94 if (!vc->gfx.gls) {
95 if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
96 return;
97 }
98 gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
1/*
2 * GTK UI -- glarea opengl code.
3 *
4 * Requires 3.16+ (GtkGLArea widget).
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

--- 82 unchanged lines hidden (view full) ---

91{
92 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
93
94 if (!vc->gfx.gls) {
95 if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
96 return;
97 }
98 gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
99 vc->gfx.gls = console_gl_init_context();
99 vc->gfx.gls = qemu_gl_init_shader();
100 if (vc->gfx.ds) {
101 surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds);
102 }
103 }
104
105 graphic_hw_update(dcl->con);
106
107 if (vc->gfx.glupdates) {

--- 65 unchanged lines hidden (view full) ---

173 vc->gfx.x = x;
174 vc->gfx.y = y;
175 vc->gfx.w = w;
176 vc->gfx.h = h;
177 vc->gfx.y0_top = backing_y_0_top;
178
179 gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
180
100 if (vc->gfx.ds) {
101 surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds);
102 }
103 }
104
105 graphic_hw_update(dcl->con);
106
107 if (vc->gfx.glupdates) {

--- 65 unchanged lines hidden (view full) ---

173 vc->gfx.x = x;
174 vc->gfx.y = y;
175 vc->gfx.w = w;
176 vc->gfx.h = h;
177 vc->gfx.y0_top = backing_y_0_top;
178
179 gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
180
181 if (backing_id == 0 || vc->gfx.w == 0 || vc->gfx.h == 0) {
181 if (vc->gfx.guest_fb.framebuffer == 0 ||
182 vc->gfx.w == 0 || vc->gfx.h == 0) {
182 gtk_gl_area_set_scanout_mode(vc, false);
183 return;
184 }
185
186 gtk_gl_area_set_scanout_mode(vc, true);
187 egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
188 backing_id, false);
189}

--- 25 unchanged lines hidden ---
183 gtk_gl_area_set_scanout_mode(vc, false);
184 return;
185 }
186
187 gtk_gl_area_set_scanout_mode(vc, true);
188 egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
189 backing_id, false);
190}

--- 25 unchanged lines hidden ---