diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 716d655ee1..59843dbda6 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -1186,7 +1186,6 @@ GDK_IS_MONITOR
gdkdrawingcontext GdkDrawingContext -gdk_drawing_context_get_clip gdk_drawing_context_get_paint_context diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c index 55da8b6d83..4d3efb8f0f 100644 --- a/gdk/gdkdrawingcontext.c +++ b/gdk/gdkdrawingcontext.c @@ -57,7 +57,6 @@ struct _GdkDrawingContextPrivate { GdkSurface *surface; GdkDrawContext *paint_context; - cairo_region_t *clip; cairo_t *cr; }; @@ -67,7 +66,6 @@ enum { PROP_0, PROP_SURFACE, - PROP_CLIP, PROP_PAINT_CONTEXT, N_PROPS @@ -83,7 +81,6 @@ gdk_drawing_context_dispose (GObject *gobject) g_clear_object (&priv->surface); g_clear_object (&priv->paint_context); - g_clear_pointer (&priv->clip, cairo_region_destroy); g_clear_pointer (&priv->cr, cairo_destroy); G_OBJECT_CLASS (gdk_drawing_context_parent_class)->dispose (gobject); @@ -116,10 +113,6 @@ gdk_drawing_context_set_property (GObject *gobject, priv->paint_context = g_value_dup_object (value); break; - case PROP_CLIP: - priv->clip = g_value_dup_boxed (value); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); } @@ -140,10 +133,6 @@ gdk_drawing_context_get_property (GObject *gobject, g_value_set_object (value, priv->surface); break; - case PROP_CLIP: - g_value_set_boxed (value, priv->clip); - break; - case PROP_PAINT_CONTEXT: g_value_set_object (value, priv->paint_context); break; @@ -173,17 +162,6 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass) G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - /** - * GdkDrawingContext:clip: - * - * The clip region applied to the drawing context. - */ - obj_property[PROP_CLIP] = - g_param_spec_boxed ("clip", "Clip", "The clip region of the context", - CAIRO_GOBJECT_TYPE_REGION, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS); /** * GdkDrawingContext:paint-context: * @@ -222,24 +200,3 @@ gdk_drawing_context_get_paint_context (GdkDrawingContext *context) return priv->paint_context; } -/** - * gdk_drawing_context_get_clip: - * @context: a #GdkDrawingContext - * - * Retrieves a copy of the clip region used when creating the @context. - * - * Returns: (transfer full) (nullable): a Cairo region - */ -cairo_region_t * -gdk_drawing_context_get_clip (GdkDrawingContext *context) -{ - GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); - - g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL); - - if (priv->clip == NULL) - return NULL; - - return cairo_region_copy (priv->clip); -} - diff --git a/gdk/gdkdrawingcontext.h b/gdk/gdkdrawingcontext.h index 21faf0542c..0f6795cd41 100644 --- a/gdk/gdkdrawingcontext.h +++ b/gdk/gdkdrawingcontext.h @@ -38,8 +38,6 @@ GType gdk_drawing_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context); -GDK_AVAILABLE_IN_ALL -cairo_region_t *gdk_drawing_context_get_clip (GdkDrawingContext *context); G_END_DECLS diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 90486c4ed8..372e9e48bd 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -1612,7 +1612,6 @@ gdk_surface_begin_draw_frame (GdkSurface *surface, context = g_object_new (GDK_TYPE_DRAWING_CONTEXT, "surface", surface, "paint-context", draw_context, - "clip", draw_context->frame_region, NULL); /* Do not take a reference, to avoid creating cycles */ diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 3e9dafaff1..204b7628ba 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -2563,7 +2563,7 @@ gsk_gl_renderer_render (GskRenderer *renderer, { GskGLRenderer *self = GSK_GL_RENDERER (renderer); graphene_rect_t viewport; - cairo_region_t *damage; + const cairo_region_t *damage; GdkDrawingContext *context; GdkRectangle whole_surface; GdkSurface *surface; @@ -2582,8 +2582,7 @@ gsk_gl_renderer_render (GskRenderer *renderer, GDK_DRAW_CONTEXT (self->gl_context), update_area); - damage = gdk_drawing_context_get_clip (context); - cairo_region_union (damage, update_area); + damage = gdk_draw_context_get_frame_region (GDK_DRAW_CONTEXT (self->gl_context)); if (cairo_region_contains_rectangle (damage, &whole_surface) == CAIRO_REGION_OVERLAP_IN) { @@ -2594,16 +2593,13 @@ gsk_gl_renderer_render (GskRenderer *renderer, GdkRectangle extents; cairo_region_get_extents (damage, &extents); - cairo_region_union_rectangle (damage, &extents); if (gdk_rectangle_equal (&extents, &whole_surface)) self->render_region = NULL; else - self->render_region = cairo_region_reference (damage); + self->render_region = cairo_region_create_rectangle (&extents); } - cairo_region_destroy (damage); - self->scale_factor = gdk_surface_get_scale_factor (surface); gdk_gl_context_make_current (self->gl_context); diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c index 59506e1f98..6c17c89a0e 100644 --- a/gsk/vulkan/gskvulkanrenderer.c +++ b/gsk/vulkan/gskvulkanrenderer.c @@ -219,7 +219,7 @@ gsk_vulkan_renderer_render (GskRenderer *renderer, GskVulkanRender *render; GdkDrawingContext *context; GdkSurface *surface; - cairo_region_t *clip; + const cairo_region_t *clip; #ifdef G_ENABLE_DEBUG GskProfiler *profiler; gint64 cpu_time; @@ -240,9 +240,8 @@ gsk_vulkan_renderer_render (GskRenderer *renderer, region); render = self->render; - clip = gdk_drawing_context_get_clip (context); + clip = gdk_draw_context_get_frame_region (GDK_DRAW_CONTEXT (self->vulkan)); gsk_vulkan_render_reset (render, self->targets[gdk_vulkan_context_get_draw_index (self->vulkan)], NULL, clip); - cairo_region_destroy (clip); gsk_vulkan_render_add_node (render, root);