diff options
author | Benjamin Otte <otte@redhat.com> | 2018-04-23 23:26:14 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2018-04-24 23:16:58 +0200 |
commit | 83ea0b371417b4d20071c6203454c0781a544960 (patch) | |
tree | 408b941f5c15a10c7457007030f74820a03f4320 /gdk | |
parent | fd686afeb2bba843c7b63a5b2284141981042439 (diff) | |
download | gtk+-83ea0b371417b4d20071c6203454c0781a544960.tar.gz |
drawcontext: Only pass the region that matters
We used to pass 2 regions to GdkDrawCotnext.end_frame() but code was
confusing what they meant. So we now don't do that anymore and only pass
the region that matters: The frame region.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkdrawcontext.c | 4 | ||||
-rw-r--r-- | gdk/gdkdrawcontextprivate.h | 3 | ||||
-rw-r--r-- | gdk/gdkglcontext.c | 5 | ||||
-rw-r--r-- | gdk/gdkvulkancontext.c | 3 | ||||
-rw-r--r-- | gdk/wayland/gdkcairocontext-wayland.c | 3 | ||||
-rw-r--r-- | gdk/wayland/gdkglcontext-wayland.c | 11 | ||||
-rw-r--r-- | gdk/wayland/gdkvulkancontext-wayland.c | 5 | ||||
-rw-r--r-- | gdk/win32/gdkglcontext-win32.c | 5 | ||||
-rw-r--r-- | gdk/x11/gdkcairocontext-x11.c | 3 | ||||
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 5 | ||||
-rw-r--r-- | gdk/x11/gdkvulkancontext-x11.c | 5 |
11 files changed, 20 insertions, 32 deletions
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 52728d6ac3..169bdb82cc 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -352,9 +352,7 @@ gdk_draw_context_end_frame (GdkDrawContext *context) return; } - GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, - priv->frame_region, - priv->surface->active_update_area); + GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, priv->frame_region); g_clear_pointer (&priv->frame_region, cairo_region_destroy); g_clear_object (&priv->surface->paint_context); diff --git a/gdk/gdkdrawcontextprivate.h b/gdk/gdkdrawcontextprivate.h index 9ea9eaed8c..8ae1d0e8f8 100644 --- a/gdk/gdkdrawcontextprivate.h +++ b/gdk/gdkdrawcontextprivate.h @@ -43,8 +43,7 @@ struct _GdkDrawContextClass void (* begin_frame) (GdkDrawContext *context, cairo_region_t *update_area); void (* end_frame) (GdkDrawContext *context, - cairo_region_t *painted, - cairo_region_t *damage); + cairo_region_t *painted); void (* surface_resized) (GdkDrawContext *context); }; diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 0b9f93d795..d443a83cf8 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -326,8 +326,7 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context, static void gdk_gl_context_real_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkGLContext *shared; @@ -335,7 +334,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context, shared = gdk_gl_context_get_shared_context (context); if (shared) { - GDK_DRAW_CONTEXT_GET_CLASS (GDK_DRAW_CONTEXT (shared))->end_frame (GDK_DRAW_CONTEXT (shared), painted, damage); + GDK_DRAW_CONTEXT_GET_CLASS (GDK_DRAW_CONTEXT (shared))->end_frame (GDK_DRAW_CONTEXT (shared), painted); return; } diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index fca08fed95..1546f9d01c 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -401,8 +401,7 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context, static void gdk_vulkan_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context); GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context); diff --git a/gdk/wayland/gdkcairocontext-wayland.c b/gdk/wayland/gdkcairocontext-wayland.c index fe4237f63d..2c248597dc 100644 --- a/gdk/wayland/gdkcairocontext-wayland.c +++ b/gdk/wayland/gdkcairocontext-wayland.c @@ -173,8 +173,7 @@ gdk_wayland_cairo_context_begin_frame (GdkDrawContext *draw_context, static void gdk_wayland_cairo_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkWaylandCairoContext *self = GDK_WAYLAND_CAIRO_CONTEXT (draw_context); GdkSurface *surface = gdk_draw_context_get_surface (draw_context); diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index 18863c3c8a..1e1259bbac 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -204,8 +204,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context) static void gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkSurface *surface = gdk_gl_context_get_surface (context); @@ -214,7 +213,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context); EGLSurface egl_surface; - GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->end_frame (draw_context, painted, damage); + GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->end_frame (draw_context, painted); if (gdk_gl_context_get_shared_context (context)) return; @@ -226,16 +225,16 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, gdk_wayland_surface_sync (surface); gdk_wayland_surface_request_frame (surface); - if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL) + if (display_wayland->have_egl_swap_buffers_with_damage) { - int i, j, n_rects = cairo_region_num_rectangles (damage); + int i, j, n_rects = cairo_region_num_rectangles (painted); EGLint *rects = g_new (EGLint, n_rects * 4); cairo_rectangle_int_t rect; int surface_height = gdk_surface_get_height (surface); for (i = 0, j = 0; i < n_rects; i++) { - cairo_region_get_rectangle (damage, i, &rect); + cairo_region_get_rectangle (painted, i, &rect); rects[j++] = rect.x; rects[j++] = surface_height - rect.height - rect.y; rects[j++] = rect.width; diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c index 714ae6de4b..59b85af12b 100644 --- a/gdk/wayland/gdkvulkancontext-wayland.c +++ b/gdk/wayland/gdkvulkancontext-wayland.c @@ -61,15 +61,14 @@ gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context, static void gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); gdk_wayland_surface_sync (surface); gdk_wayland_surface_request_frame (surface); - GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage); + GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted); } static void diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c index bf6af19b77..4845f4ba16 100644 --- a/gdk/win32/gdkglcontext-win32.c +++ b/gdk/win32/gdkglcontext-win32.c @@ -102,8 +102,7 @@ gdk_gl_blit_region (GdkSurface *surface, cairo_region_t *region) static void gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context); @@ -112,7 +111,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context, gboolean can_wait = display->hasWglOMLSyncControl; cairo_rectangle_int_t whole_window; - GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->end_frame (draw_context, painted, damage); + GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->end_frame (draw_context, painted); if (gdk_gl_context_get_shared_context (context)) return; diff --git a/gdk/x11/gdkcairocontext-x11.c b/gdk/x11/gdkcairocontext-x11.c index 41fb43ee0c..ba50862249 100644 --- a/gdk/x11/gdkcairocontext-x11.c +++ b/gdk/x11/gdkcairocontext-x11.c @@ -78,8 +78,7 @@ gdk_x11_cairo_context_begin_frame (GdkDrawContext *draw_context, static void gdk_x11_cairo_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkX11CairoContext *self = GDK_X11_CAIRO_CONTEXT (draw_context); cairo_t *cr; diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index f5d00eeb27..0c8970fd5c 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -120,8 +120,7 @@ maybe_wait_for_vblank (GdkDisplay *display, static void gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkX11GLContext *context_x11 = GDK_X11_GL_CONTEXT (context); @@ -133,7 +132,7 @@ gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context, DrawableInfo *info; GLXDrawable drawable; - GDK_DRAW_CONTEXT_CLASS (gdk_x11_gl_context_parent_class)->end_frame (draw_context, painted, damage); + GDK_DRAW_CONTEXT_CLASS (gdk_x11_gl_context_parent_class)->end_frame (draw_context, painted); if (gdk_gl_context_get_shared_context (context)) return; diff --git a/gdk/x11/gdkvulkancontext-x11.c b/gdk/x11/gdkvulkancontext-x11.c index 733acd93b6..c1a6a225d0 100644 --- a/gdk/x11/gdkvulkancontext-x11.c +++ b/gdk/x11/gdkvulkancontext-x11.c @@ -60,14 +60,13 @@ gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context, static void gdk_x11_vulkan_context_end_frame (GdkDrawContext *context, - cairo_region_t *painted, - cairo_region_t *damage) + cairo_region_t *painted) { GdkSurface *surface = gdk_draw_context_get_surface (context); gdk_x11_surface_pre_damage (surface); - GDK_DRAW_CONTEXT_CLASS (gdk_x11_vulkan_context_parent_class)->end_frame (context, painted, damage); + GDK_DRAW_CONTEXT_CLASS (gdk_x11_vulkan_context_parent_class)->end_frame (context, painted); } static void |