gtk-egl.c (6779a3076f295fafe52d43049fa954426c1d594a) gtk-egl.c (fa6426805b124400cfb700b75e8fe4a89dd2ed7a)
1/*
2 * GTK UI -- egl opengl code.
3 *
4 * Note that gtk 3.16+ (released 2015-03-23) has a GtkGLArea widget,
5 * which is GtkDrawingArea like widget with opengl rendering support.
6 *
7 * This code handles opengl support on older gtk versions, using egl
8 * to get a opengl context for the X11 window.

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

82 wh = gdk_window_get_height(window) * ws;
83
84 if (vc->gfx.scanout_mode) {
85#ifdef CONFIG_GBM
86 if (dmabuf) {
87 if (!qemu_dmabuf_get_draw_submitted(dmabuf)) {
88 return;
89 } else {
1/*
2 * GTK UI -- egl opengl code.
3 *
4 * Note that gtk 3.16+ (released 2015-03-23) has a GtkGLArea widget,
5 * which is GtkDrawingArea like widget with opengl rendering support.
6 *
7 * This code handles opengl support on older gtk versions, using egl
8 * to get a opengl context for the X11 window.

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

82 wh = gdk_window_get_height(window) * ws;
83
84 if (vc->gfx.scanout_mode) {
85#ifdef CONFIG_GBM
86 if (dmabuf) {
87 if (!qemu_dmabuf_get_draw_submitted(dmabuf)) {
88 return;
89 } else {
90 dmabuf->draw_submitted = false;
90 qemu_dmabuf_set_draw_submitted(dmabuf, false);
91 }
92 }
93#endif
94 gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h);
95
96 vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
97 vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
98

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

377 uint32_t x, uint32_t y, uint32_t w, uint32_t h)
378{
379 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
380 GtkWidget *area = vc->gfx.drawing_area;
381
382 if (vc->gfx.guest_fb.dmabuf &&
383 !qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) {
384 graphic_hw_gl_block(vc->gfx.dcl.con, true);
91 }
92 }
93#endif
94 gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h);
95
96 vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
97 vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
98

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

377 uint32_t x, uint32_t y, uint32_t w, uint32_t h)
378{
379 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
380 GtkWidget *area = vc->gfx.drawing_area;
381
382 if (vc->gfx.guest_fb.dmabuf &&
383 !qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) {
384 graphic_hw_gl_block(vc->gfx.dcl.con, true);
385 vc->gfx.guest_fb.dmabuf->draw_submitted = true;
385 qemu_dmabuf_set_draw_submitted(vc->gfx.guest_fb.dmabuf, true);
386 gtk_egl_set_scanout_mode(vc, true);
387 gtk_widget_queue_draw_area(area, x, y, w, h);
388 return;
389 }
390
391 gd_egl_scanout_flush(&vc->gfx.dcl, x, y, w, h);
392}
393

--- 25 unchanged lines hidden ---
386 gtk_egl_set_scanout_mode(vc, true);
387 gtk_widget_queue_draw_area(area, x, y, w, h);
388 return;
389 }
390
391 gd_egl_scanout_flush(&vc->gfx.dcl, x, y, w, h);
392}
393

--- 25 unchanged lines hidden ---