From 48fc18c37b290f1d4ed57dccce152b75b0232f01 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 21 Apr 2018 01:22:19 +0200 Subject: [PATCH] gdk: Get rid of GdkDrawingContext All information is kept in GdkDrawContext these days, so use that one. --- docs/reference/gdk/gdk4-sections.txt | 16 --- gdk/gdk.h | 1 - gdk/gdkcairo.h | 1 - gdk/gdkcairocontext.c | 12 +- gdk/gdkdrawingcontext.c | 202 --------------------------- gdk/gdkdrawingcontext.h | 44 ------ gdk/gdkdrawingcontextprivate.h | 24 ---- gdk/gdkinternals.h | 7 +- gdk/gdksurface.c | 75 +++------- gdk/gdksurface.h | 6 +- gdk/meson.build | 3 - gsk/gl/gskglrenderer.c | 9 +- gsk/gskbroadwayrenderer.c | 5 +- gsk/gskcairorenderer.c | 9 +- gsk/vulkan/gskvulkanrenderer.c | 9 +- testsuite/gtk/defaultvalue.c | 1 - testsuite/gtk/notify.c | 1 - testsuite/gtk/objects-finalize.c | 1 - 18 files changed, 38 insertions(+), 388 deletions(-) delete mode 100644 gdk/gdkdrawingcontext.c delete mode 100644 gdk/gdkdrawingcontext.h delete mode 100644 gdk/gdkdrawingcontextprivate.h diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 59843dbda6..cc56a592b9 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -1183,22 +1183,6 @@ GDK_MONITOR GDK_IS_MONITOR -
-gdkdrawingcontext -GdkDrawingContext -gdk_drawing_context_get_paint_context - - -gdk_drawing_context_get_type -GdkDrawingContextClass -GDK_TYPE_DRAWING_CONTEXT -GDK_DRAWING_CONTEXT_CLASS -GDK_DRAWING_CONTEXT_GET_CLASS -GDK_IS_DRAWING_CONTEXT_CLASS -GDK_DRAWING_CONTEXT -GDK_IS_DRAWING_CONTEXT -
-
gdkcairocontext GdkCairoContext diff --git a/gdk/gdk.h b/gdk/gdk.h index 8311ef23bd..59279d3011 100644 --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index ecd1bb73d6..4cc7bf0ca7 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/gdk/gdkcairocontext.c b/gdk/gdkcairocontext.c index 9dded90aae..9308af8a67 100644 --- a/gdk/gdkcairocontext.c +++ b/gdk/gdkcairocontext.c @@ -80,26 +80,24 @@ gdk_surface_get_content (GdkSurface *surface) static cairo_t * gdk_cairo_context_default_cairo_create (GdkCairoContext *self) { + GdkDrawContext *context; GdkSurface *surface; - cairo_region_t *region; cairo_surface_t *cairo_surface; cairo_t *cr; g_return_val_if_fail (GDK_IS_CAIRO_CONTEXT (self), NULL); - surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (self)); - if (surface->drawing_context == NULL || - gdk_drawing_context_get_paint_context (surface->drawing_context) != GDK_DRAW_CONTEXT (self)) + context = GDK_DRAW_CONTEXT (self); + if (!gdk_draw_context_is_drawing (context)) return NULL; + surface = gdk_draw_context_get_surface (context); cairo_surface = _gdk_surface_ref_cairo_surface (surface); cr = cairo_create (cairo_surface); - region = gdk_surface_get_current_paint_region (surface); - gdk_cairo_region (cr, region); + gdk_cairo_region (cr, gdk_draw_context_get_frame_region (context)); cairo_clip (cr); - cairo_region_destroy (region); cairo_surface_destroy (cairo_surface); return cr; diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c deleted file mode 100644 index 4d3efb8f0f..0000000000 --- a/gdk/gdkdrawingcontext.c +++ /dev/null @@ -1,202 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright 2016 Endless - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:gdkdrawingcontext - * @Title: GdkDrawingContext - * @Short_description: Drawing context for GDK surfaces - * - * #GdkDrawingContext is an object that represents the current drawing - * state of a #GdkSurface. - * - * It's possible to use a #GdkDrawingContext to draw on a #GdkSurface - * via rendering API like Cairo or OpenGL. - * - * A #GdkDrawingContext can only be created by calling gdk_surface_begin_draw_frame() - * and will be valid until a call to gdk_surface_end_draw_frame(). - * - * #GdkDrawingContext is available since GDK 3.22 - */ - -/** - * GdkDrawingContext: - * - * The GdkDrawingContext struct contains only private fields and should not - * be accessed directly. - */ - -#include "config.h" - -#include - -#include "gdkdrawingcontextprivate.h" - -#include "gdkrectangle.h" -#include "gdkinternals.h" -#include "gdkintl.h" -#include "gdksurfaceimpl.h" -#include "gdk-private.h" - -typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate; - -struct _GdkDrawingContextPrivate { - GdkSurface *surface; - GdkDrawContext *paint_context; - - cairo_t *cr; -}; - -G_DEFINE_TYPE_WITH_PRIVATE (GdkDrawingContext, gdk_drawing_context, G_TYPE_OBJECT) - -enum { - PROP_0, - - PROP_SURFACE, - PROP_PAINT_CONTEXT, - - N_PROPS -}; - -static GParamSpec *obj_property[N_PROPS]; - -static void -gdk_drawing_context_dispose (GObject *gobject) -{ - GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject); - GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self); - - g_clear_object (&priv->surface); - g_clear_object (&priv->paint_context); - g_clear_pointer (&priv->cr, cairo_destroy); - - G_OBJECT_CLASS (gdk_drawing_context_parent_class)->dispose (gobject); -} - -static void -gdk_drawing_context_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject); - GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self); - - switch (prop_id) - { - case PROP_SURFACE: - priv->surface = g_value_dup_object (value); - if (priv->surface == NULL) - { - g_critical ("The drawing context of type %s does not have a surface " - "associated to it. Drawing contexts can only be created " - "using gdk_surface_begin_draw_frame().", - G_OBJECT_TYPE_NAME (gobject)); - return; - } - break; - - case PROP_PAINT_CONTEXT: - priv->paint_context = g_value_dup_object (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - } -} - -static void -gdk_drawing_context_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject); - GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self); - - switch (prop_id) - { - case PROP_SURFACE: - g_value_set_object (value, priv->surface); - break; - - case PROP_PAINT_CONTEXT: - g_value_set_object (value, priv->paint_context); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - } -} - -static void -gdk_drawing_context_class_init (GdkDrawingContextClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - gobject_class->set_property = gdk_drawing_context_set_property; - gobject_class->get_property = gdk_drawing_context_get_property; - gobject_class->dispose = gdk_drawing_context_dispose; - - /** - * GdkDrawingContext:surface: - * - * The #GdkSurface that created the drawing context. - */ - obj_property[PROP_SURFACE] = - g_param_spec_object ("surface", "Surface", "The surface that created the context", - GDK_TYPE_SURFACE, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS); - /** - * GdkDrawingContext:paint-context: - * - * The #GdkDrawContext used to draw or %NULL if Cairo is used. - */ - obj_property[PROP_PAINT_CONTEXT] = - g_param_spec_object ("paint-context", "Paint context", "The context used to draw", - GDK_TYPE_DRAW_CONTEXT, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS); - - g_object_class_install_properties (gobject_class, N_PROPS, obj_property); -} - -static void -gdk_drawing_context_init (GdkDrawingContext *self) -{ -} - -/** - * gdk_drawing_context_get_paint_context: - * @context: a #GdkDrawingContext - * - * Retrieves the paint context used to draw with. - * - * Returns: (transfer none): a #GdkDrawContext or %NULL - */ -GdkDrawContext * -gdk_drawing_context_get_paint_context (GdkDrawingContext *context) -{ - GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); - - g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL); - - return priv->paint_context; -} - diff --git a/gdk/gdkdrawingcontext.h b/gdk/gdkdrawingcontext.h deleted file mode 100644 index 0f6795cd41..0000000000 --- a/gdk/gdkdrawingcontext.h +++ /dev/null @@ -1,44 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __GDK_DRAWING_CONTEXT_H__ -#define __GDK_DRAWING_CONTEXT_H__ - -#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) -#error "Only can be included directly." -#endif - -#include -#include - -G_BEGIN_DECLS - -#define GDK_TYPE_DRAWING_CONTEXT (gdk_drawing_context_get_type ()) - -#define GDK_DRAWING_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContext)) -#define GDK_IS_DRAWING_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_DRAWING_CONTEXT)) - -typedef struct _GdkDrawingContextClass GdkDrawingContextClass; - -GDK_AVAILABLE_IN_ALL -GType gdk_drawing_context_get_type (void) G_GNUC_CONST; - -GDK_AVAILABLE_IN_ALL -GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context); - -G_END_DECLS - -#endif /* __GDK_DRAWING_CONTEXT_H__ */ diff --git a/gdk/gdkdrawingcontextprivate.h b/gdk/gdkdrawingcontextprivate.h deleted file mode 100644 index 8dcc3326ad..0000000000 --- a/gdk/gdkdrawingcontextprivate.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __GDK_DRAWING_CONTEXT_PRIVATE_H__ -#define __GDK_DRAWING_CONTEXT_PRIVATE_H__ - -#include "gdkdrawingcontext.h" - -G_BEGIN_DECLS - -#define GDK_DRAWING_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContextClass)) -#define GDK_IS_DRAWING_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWING_CONTEXT)) -#define GDK_DRAWING_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContextClass)) - -struct _GdkDrawingContext -{ - GObject parent_instance; -}; - -struct _GdkDrawingContextClass -{ - GObjectClass parent_instance; -}; - -G_END_DECLS - -#endif /* __GDK_DRAWING_CONTEXT_PRIVATE_H__ */ diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 4ffcb79b79..f7ccf740a6 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -221,7 +221,7 @@ struct _GdkSurface GdkFrameClock *frame_clock; /* NULL to use from parent or default */ GSList *draw_contexts; - GdkDrawingContext *drawing_context; + GdkDrawContext *paint_context; cairo_region_t *opaque_region; }; @@ -286,9 +286,6 @@ void gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface, cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr); -void gdk_cairo_set_drawing_context (cairo_t *cr, - GdkDrawingContext *context); - /************************************* * Interfaces used by windowing code * *************************************/ @@ -310,8 +307,6 @@ void gdk_surface_get_unscaled_size (GdkSurface *surface, int *unscaled_width, int *unscaled_height); -GdkDrawingContext *gdk_surface_get_drawing_context (GdkSurface *surface); - cairo_region_t *gdk_surface_get_current_paint_region (GdkSurface *surface); /***************************************** diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 372e9e48bd..b4e0d26493 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -38,7 +38,6 @@ #include "gdkmarshalers.h" #include "gdksurfaceimpl.h" #include "gdkglcontextprivate.h" -#include "gdkdrawingcontextprivate.h" #include "gdk-private.h" #include @@ -1549,7 +1548,7 @@ gdk_surface_create_vulkan_context (GdkSurface *surface, * @region: a Cairo region * * Indicates that you are beginning the process of redrawing @region - * on @surface, and provides you with a #GdkDrawingContext. + * on @surface. * * If @surface is a top level #GdkSurface, backed by a native surface * implementation, a backing store (offscreen buffer) large enough to @@ -1575,94 +1574,72 @@ gdk_surface_create_vulkan_context (GdkSurface *surface, * and already has a backing store. Therefore in most cases, application * code in GTK does not need to call gdk_surface_begin_draw_frame() * explicitly. - * - * Returns: (transfer none): a #GdkDrawingContext context that should be - * used to draw the contents of the surface; the returned context is owned - * by GDK. */ -GdkDrawingContext * +void gdk_surface_begin_draw_frame (GdkSurface *surface, GdkDrawContext *draw_context, const cairo_region_t *region) { - GdkDrawingContext *context; - - g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); - g_return_val_if_fail (gdk_surface_has_native (surface), NULL); - g_return_val_if_fail (gdk_surface_is_toplevel (surface), NULL); - g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (draw_context), NULL); - g_return_val_if_fail (gdk_draw_context_get_surface (draw_context) == surface, NULL); - g_return_val_if_fail (region != NULL, NULL); + g_return_if_fail (GDK_IS_SURFACE (surface)); + g_return_if_fail (gdk_surface_has_native (surface)); + g_return_if_fail (gdk_surface_is_toplevel (surface)); + g_return_if_fail (GDK_IS_DRAW_CONTEXT (draw_context)); + g_return_if_fail (gdk_draw_context_get_surface (draw_context) == surface); + g_return_if_fail (region != NULL); if (GDK_SURFACE_DESTROYED (surface)) - return NULL; + return; - if (surface->drawing_context != NULL) + if (surface->paint_context != NULL) { g_critical ("The surface %p already has a drawing context. You cannot " "call gdk_surface_begin_draw_frame() without calling " "gdk_surface_end_draw_frame() first.", surface); - return NULL; + return; } draw_context->frame_region = cairo_region_copy (region); gdk_draw_context_begin_frame (draw_context, draw_context->frame_region); - context = g_object_new (GDK_TYPE_DRAWING_CONTEXT, - "surface", surface, - "paint-context", draw_context, - NULL); - - /* Do not take a reference, to avoid creating cycles */ - surface->drawing_context = context; - - return context; + surface->paint_context = g_object_ref (draw_context); } /** * gdk_surface_end_draw_frame: * @surface: a #GdkSurface - * @context: the #GdkDrawingContext created by gdk_surface_begin_draw_frame() * * Indicates that the drawing of the contents of @surface started with * gdk_surface_begin_frame() has been completed. * - * This function will take care of destroying the #GdkDrawingContext. - * * It is an error to call this function without a matching * gdk_surface_begin_frame() first. */ void -gdk_surface_end_draw_frame (GdkSurface *surface, - GdkDrawingContext *context) +gdk_surface_end_draw_frame (GdkSurface *surface) { GdkDrawContext *paint_context; g_return_if_fail (GDK_IS_SURFACE (surface)); - g_return_if_fail (GDK_IS_DRAWING_CONTEXT (context)); if (GDK_SURFACE_DESTROYED (surface)) return; - if (surface->drawing_context == NULL) + if (surface->paint_context == NULL) { g_critical ("The surface %p has no drawing context. You must call " "gdk_surface_begin_draw_frame() before calling " "gdk_surface_end_draw_frame().", surface); return; } - g_return_if_fail (surface->drawing_context == context); - paint_context = gdk_drawing_context_get_paint_context (context); + paint_context = g_steal_pointer (&surface->paint_context); gdk_draw_context_end_frame (paint_context, paint_context->frame_region, surface->active_update_area); - surface->drawing_context = NULL; - g_clear_pointer (&paint_context->frame_region, cairo_region_destroy); - g_object_unref (context); + g_object_unref (paint_context); } /*< private > @@ -1691,26 +1668,6 @@ gdk_surface_get_current_paint_region (GdkSurface *surface) return region; } -/*< private > - * gdk_surface_get_drawing_context: - * @surface: a #GdkSurface - * - * Retrieves the #GdkDrawingContext associated to @surface by - * gdk_surface_begin_draw_frame(). - * - * Returns: (transfer none) (nullable): a #GdkDrawingContext, if any is set - */ -GdkDrawingContext * -gdk_surface_get_drawing_context (GdkSurface *surface) -{ - g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); - - if (GDK_SURFACE_DESTROYED (surface)) - return NULL; - - return surface->drawing_context; -} - /* This is used in places like gdk_cairo_set_source_surface and * other places to take "screenshots" of surfaces. Thus, we allow * it to be used outside of a begin_paint / end_paint. */ diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index 3775f20d5d..c0709d1dda 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -577,12 +576,11 @@ void gdk_surface_set_geometry_hints (GdkSurface *surface, GdkSurfaceHints geom_mask); GDK_AVAILABLE_IN_ALL -GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *surface, +void gdk_surface_begin_draw_frame (GdkSurface *surface, GdkDrawContext *context, const cairo_region_t *region); GDK_AVAILABLE_IN_ALL -void gdk_surface_end_draw_frame (GdkSurface *surface, - GdkDrawingContext *context); +void gdk_surface_end_draw_frame (GdkSurface *surface); GDK_AVAILABLE_IN_ALL void gdk_surface_set_title (GdkSurface *surface, diff --git a/gdk/meson.build b/gdk/meson.build index 0f22b2fe39..2cbf4a8392 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -17,7 +17,6 @@ gdk_public_sources = files([ 'gdkdisplaymanager.c', 'gdkdnd.c', 'gdkdrawcontext.c', - 'gdkdrawingcontext.c', 'gdkevents.c', 'gdkframeclock.c', 'gdkframeclockidle.c', @@ -67,7 +66,6 @@ gdk_public_headers = files([ 'gdkdisplaymanager.h', 'gdkdnd.h', 'gdkdrawcontext.h', - 'gdkdrawingcontext.h', 'gdkevents.h', 'gdkframeclock.h', 'gdkframetimings.h', @@ -97,7 +95,6 @@ gdk_sources = gdk_public_sources gdk_private_h_sources = files([ 'gdkeventsprivate.h', 'gdkdevicetoolprivate.h', - 'gdkdrawingcontextprivate.h', 'gdkmonitorprivate.h', 'gdkseatdefaultprivate.h', ]) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 204b7628ba..e76c1f8eed 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -2564,7 +2564,6 @@ gsk_gl_renderer_render (GskRenderer *renderer, GskGLRenderer *self = GSK_GL_RENDERER (renderer); graphene_rect_t viewport; const cairo_region_t *damage; - GdkDrawingContext *context; GdkRectangle whole_surface; GdkSurface *surface; @@ -2578,9 +2577,9 @@ gsk_gl_renderer_render (GskRenderer *renderer, gdk_surface_get_height (surface) * self->scale_factor }; - context = gdk_surface_begin_draw_frame (surface, - GDK_DRAW_CONTEXT (self->gl_context), - update_area); + gdk_surface_begin_draw_frame (surface, + GDK_DRAW_CONTEXT (self->gl_context), + update_area); damage = gdk_draw_context_get_frame_region (GDK_DRAW_CONTEXT (self->gl_context)); @@ -2613,7 +2612,7 @@ gsk_gl_renderer_render (GskRenderer *renderer, gdk_gl_context_make_current (self->gl_context); gsk_gl_renderer_clear_tree (self); - gdk_surface_end_draw_frame (surface, context); + gdk_surface_end_draw_frame (surface); g_clear_pointer (&self->render_region, cairo_region_destroy); } diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c index 1a0268a096..ee2a45d6dd 100644 --- a/gsk/gskbroadwayrenderer.c +++ b/gsk/gskbroadwayrenderer.c @@ -673,7 +673,6 @@ gsk_broadway_renderer_render (GskRenderer *self, GArray *nodes; GPtrArray *node_textures; cairo_region_t *whole; - GdkDrawingContext *context; GdkSurface *surface; surface = gsk_renderer_get_surface (self); @@ -682,7 +681,7 @@ gsk_broadway_renderer_render (GskRenderer *self, gdk_surface_get_width (surface), gdk_surface_get_height (surface) }); - context = gdk_surface_begin_draw_frame (surface, NULL, whole); + gdk_surface_begin_draw_frame (surface, NULL, whole); cairo_region_destroy (whole); nodes = g_array_new (FALSE, FALSE, sizeof(guint32)); @@ -692,7 +691,7 @@ gsk_broadway_renderer_render (GskRenderer *self, g_array_unref (nodes); g_ptr_array_unref (node_textures); - gdk_surface_end_draw_frame (surface, context); + gdk_surface_end_draw_frame (surface); } static void diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c index 43d47d1aac..22e723fdb9 100644 --- a/gsk/gskcairorenderer.c +++ b/gsk/gskcairorenderer.c @@ -109,12 +109,11 @@ gsk_cairo_renderer_render (GskRenderer *renderer, { GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer); GdkSurface *surface = gsk_renderer_get_surface (renderer); - GdkDrawingContext *context; cairo_t *cr; - context = gdk_surface_begin_draw_frame (surface, - GDK_DRAW_CONTEXT (self->cairo_context), - region); + gdk_surface_begin_draw_frame (surface, + GDK_DRAW_CONTEXT (self->cairo_context), + region); cr = gdk_cairo_context_cairo_create (self->cairo_context); g_return_if_fail (cr != NULL); @@ -137,7 +136,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer, cairo_destroy (cr); - gdk_surface_end_draw_frame (surface, context); + gdk_surface_end_draw_frame (surface); } static void diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c index 6c17c89a0e..c80c4abb13 100644 --- a/gsk/vulkan/gskvulkanrenderer.c +++ b/gsk/vulkan/gskvulkanrenderer.c @@ -217,7 +217,6 @@ gsk_vulkan_renderer_render (GskRenderer *renderer, { GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer); GskVulkanRender *render; - GdkDrawingContext *context; GdkSurface *surface; const cairo_region_t *clip; #ifdef G_ENABLE_DEBUG @@ -235,9 +234,9 @@ gsk_vulkan_renderer_render (GskRenderer *renderer, gsk_profiler_timer_begin (profiler, self->profile_timers.cpu_time); #endif - context = gdk_surface_begin_draw_frame (surface, - GDK_DRAW_CONTEXT (self->vulkan), - region); + gdk_surface_begin_draw_frame (surface, + GDK_DRAW_CONTEXT (self->vulkan), + region); render = self->render; clip = gdk_draw_context_get_frame_region (GDK_DRAW_CONTEXT (self->vulkan)); @@ -258,7 +257,7 @@ gsk_vulkan_renderer_render (GskRenderer *renderer, gsk_profiler_push_samples (profiler); #endif - gdk_surface_end_draw_frame (surface, context); + gdk_surface_end_draw_frame (surface); } static void diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index 4b4c89f9d8..3ae0850868 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -77,7 +77,6 @@ test_type (gconstpointer data) /* These can't be freely constructed/destroyed */ if (g_type_is_a (type, GTK_TYPE_APPLICATION) || g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) || - g_type_is_a (type, GDK_TYPE_DRAWING_CONTEXT) || #ifdef G_OS_UNIX g_type_is_a (type, GTK_TYPE_PRINT_JOB) || #endif diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 3d521378dc..bf78772657 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -368,7 +368,6 @@ test_type (gconstpointer data) /* These can't be freely constructed/destroyed */ if (g_type_is_a (type, GTK_TYPE_APPLICATION) || g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) || - g_type_is_a (type, GDK_TYPE_DRAWING_CONTEXT) || #ifdef G_OS_UNIX g_type_is_a (type, GTK_TYPE_PRINT_JOB) || #endif diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c index 077783c023..9ef2349231 100644 --- a/testsuite/gtk/objects-finalize.c +++ b/testsuite/gtk/objects-finalize.c @@ -116,7 +116,6 @@ main (int argc, char **argv) #endif /* Not allowed to finalize a GdkPixbufLoader without calling gdk_pixbuf_loader_close() */ all_types[i] != GDK_TYPE_PIXBUF_LOADER && - all_types[i] != GDK_TYPE_DRAWING_CONTEXT && all_types[i] != gdk_pixbuf_simple_anim_iter_get_type()) { gchar *test_path = g_strdup_printf ("/FinalizeObject/%s", g_type_name (all_types[i]));