diff options
author | Benjamin Otte <otte@redhat.com> | 2019-05-18 16:54:27 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-05-18 17:06:08 +0200 |
commit | b76eb96c581f2dd1f84dcb32171382062a7ba3ad (patch) | |
tree | d2ae9f869199c275ff72ad25c1454f1c641b54d5 /gdk/gdkglcontext.c | |
parent | 2bad613cb07bafc7bc4d22f9992562fa5bc831e1 (diff) | |
download | gtk+-b76eb96c581f2dd1f84dcb32171382062a7ba3ad.tar.gz |
glcontext: Store the updated area in the right place
We need to store the region *before* adding our own damage area, because
we want to only store the changes of this frame, not the whole history.
So do it in the same place Vulkan does it.
Fixes #1900
Diffstat (limited to 'gdk/gdkglcontext.c')
-rw-r--r-- | gdk/gdkglcontext.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index b36b721f49..12a77c827a 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -310,6 +310,12 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context, } damage = GDK_GL_CONTEXT_GET_CLASS (context)->get_damage (context); + + if (context->old_updated_area[1]) + cairo_region_destroy (context->old_updated_area[1]); + context->old_updated_area[1] = context->old_updated_area[0]; + context->old_updated_area[0] = cairo_region_copy (region); + cairo_region_union (region, damage); cairo_region_destroy (damage); @@ -341,11 +347,6 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context, GDK_DRAW_CONTEXT_GET_CLASS (GDK_DRAW_CONTEXT (shared))->end_frame (GDK_DRAW_CONTEXT (shared), painted); return; } - - if (context->old_updated_area[1]) - cairo_region_destroy (context->old_updated_area[1]); - context->old_updated_area[1] = context->old_updated_area[0]; - context->old_updated_area[0] = cairo_region_reference (painted); } static void |