diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2018-03-21 14:01:58 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2018-03-21 14:14:20 +0800 |
commit | 1d5d46ff29c7e5c012bf7dd571304cc54fb95bed (patch) | |
tree | 7ea71d35d3b82582bece1eedcd8c93286b10e760 | |
parent | 2a4ffd4a596fb3790683abd0747b1c6f53fb4a3f (diff) | |
download | gtk+-1d5d46ff29c7e5c012bf7dd571304cc54fb95bed.tar.gz |
wayland/glcontext: Sync surface state before swapping buffers
A side effect of eglSwapBuffers* is the EGL implementation calling
wl_surface_commit() on the corresponding Wayland surface. Thus, before
swapping buffers, we must synchronize the surface state (e.g. opaque
region, window geometry, etc) that changed since the last buffer swap.
Prior to this commit, this was done after eglSwapBuffers*, causing the
surface state to always correspond to the previous buffer state. As of
this commit this is now done before swapping the buffers, thus before
wl_surface_commit().
-rw-r--r-- | gdk/wayland/gdkglcontext-wayland.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index 1e6f2ca28a..700baa02d6 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -223,6 +223,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface, context_wayland->egl_config); + gdk_wayland_surface_sync (surface); + if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL) { int i, j, n_rects = cairo_region_num_rectangles (damage); @@ -243,8 +245,6 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, } else eglSwapBuffers (display_wayland->egl_display, egl_surface); - - gdk_wayland_surface_sync (surface); } static void |