From: Benjamin Otte Date: Wed, 11 Apr 2018 23:02:33 +0000 (+0200) Subject: gdk: Remove gdk_cairo_get_drawing_context() X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~517 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3a1c69dce6f656606d1fc1f30b0733d5c71942f4;p=gtk4.git gdk: Remove gdk_cairo_get_drawing_context() It's unused. --- diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 2e12c4ed81..e237f65b10 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -410,7 +410,6 @@ gdk_pango_layout_line_get_clip_region gdk_surface_create_similar_surface gdk_surface_create_similar_image_surface gdk_cairo_get_clip_rectangle -gdk_cairo_get_drawing_context gdk_cairo_set_source_rgba gdk_cairo_set_source_pixbuf gdk_cairo_rectangle diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index ebac127107..0c9926fe63 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -70,9 +70,6 @@ void gdk_cairo_draw_from_gl (cairo_t *cr, int width, int height); -GDK_AVAILABLE_IN_ALL -GdkDrawingContext * gdk_cairo_get_drawing_context (cairo_t *cr); - GDK_AVAILABLE_IN_ALL void gdk_cairo_surface_upload_to_gl (cairo_surface_t *surface, int target, diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c index d25a421e34..57740eeb34 100644 --- a/gdk/gdkdrawingcontext.c +++ b/gdk/gdkdrawingcontext.c @@ -82,12 +82,6 @@ gdk_drawing_context_dispose (GObject *gobject) GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject); GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self); - /* Unset the drawing context, in case somebody is holding - * onto the Cairo context - */ - if (priv->cr != NULL) - gdk_cairo_set_drawing_context (priv->cr, NULL); - g_clear_object (&priv->surface); g_clear_object (&priv->paint_context); g_clear_pointer (&priv->clip, cairo_region_destroy); @@ -211,32 +205,6 @@ gdk_drawing_context_init (GdkDrawingContext *self) { } -static const cairo_user_data_key_t draw_context_key; - -void -gdk_cairo_set_drawing_context (cairo_t *cr, - GdkDrawingContext *context) -{ - cairo_set_user_data (cr, &draw_context_key, context, NULL); -} - -/** - * gdk_cairo_get_drawing_context: - * @cr: a Cairo context - * - * Retrieves the #GdkDrawingContext that created the Cairo - * context @cr. - * - * Returns: (transfer none) (nullable): a #GdkDrawingContext, if any is set - */ -GdkDrawingContext * -gdk_cairo_get_drawing_context (cairo_t *cr) -{ - g_return_val_if_fail (cr != NULL, NULL); - - return cairo_get_user_data (cr, &draw_context_key); -} - /** * gdk_drawing_context_get_cairo_context: * @context: a #GdkDrawingContext created with a %NULL paint context @@ -275,8 +243,6 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context) surface = _gdk_surface_ref_cairo_surface (priv->surface); priv->cr = cairo_create (surface); - gdk_cairo_set_drawing_context (priv->cr, context); - region = gdk_surface_get_current_paint_region (priv->surface); cairo_region_union (region, priv->clip); gdk_cairo_region (priv->cr, region);