diff --git a/gdk/gdkcairocontext.c b/gdk/gdkcairocontext.c index fb54bbeab7..6533a9d39e 100644 --- a/gdk/gdkcairocontext.c +++ b/gdk/gdkcairocontext.c @@ -82,8 +82,10 @@ gdk_cairo_context_cairo_create (GdkCairoContext *self) draw_context = GDK_DRAW_CONTEXT (self); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (!gdk_draw_context_is_in_frame (draw_context)) return NULL; +G_GNUC_END_IGNORE_DEPRECATIONS cr = GDK_CAIRO_CONTEXT_GET_CLASS (self)->cairo_create (self); diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 6b6ac4a3f5..cc886bce10 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -223,6 +223,9 @@ gdk_draw_context_init (GdkDrawContext *self) * * Returns: %TRUE if the context is between [method@Gdk.DrawContext.begin_frame] * and [method@Gdk.DrawContext.end_frame] calls. + * + * Deprecated: 4.16: Drawing directly to the surface is no longer recommended. + * Use `GskRenderNode` and `GskRenderer`. */ gboolean gdk_draw_context_is_in_frame (GdkDrawContext *context) @@ -313,6 +316,9 @@ gdk_draw_context_get_surface (GdkDrawContext *context) * gdk_draw_context_begin_frame() and gdk_draw_context_end_frame() via the * use of [GskRenderer](../gsk4/class.Renderer.html)s, so application code * does not need to call these functions explicitly. + * + * Deprecated: 4.16: Drawing directly to the surface is no longer recommended. + * Use `GskRenderNode` and `GskRenderer`. */ void gdk_draw_context_begin_frame (GdkDrawContext *context, @@ -448,6 +454,9 @@ gdk_draw_context_end_frame_full (GdkDrawContext *context, * When using a [class@Gdk.GLContext], this function may call `glFlush()` * implicitly before returning; it is not recommended to call `glFlush()` * explicitly before calling this function. + * + * Deprecated: 4.16: Drawing directly to the surface is no longer recommended. + * Use `GskRenderNode` and `GskRenderer`. */ void gdk_draw_context_end_frame (GdkDrawContext *context) @@ -492,6 +501,9 @@ gdk_draw_context_end_frame (GdkDrawContext *context) * and [method@Gdk.DrawContext.end_frame], %NULL will be returned. * * Returns: (transfer none) (nullable): a Cairo region + * + * Deprecated: 4.16: Drawing directly to the surface is no longer recommended. + * Use `GskRenderNode` and `GskRenderer`. */ const cairo_region_t * _gdk_draw_context_get_frame_region (GdkDrawContext *context) diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h index 420b5363f1..b99bcee6ad 100644 --- a/gdk/gdkdrawcontext.h +++ b/gdk/gdkdrawcontext.h @@ -40,15 +40,15 @@ GdkDisplay * gdk_draw_context_get_display (GdkDrawContext GDK_AVAILABLE_IN_ALL GdkSurface * gdk_draw_context_get_surface (GdkDrawContext *context); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_16 void gdk_draw_context_begin_frame (GdkDrawContext *context, const cairo_region_t *region); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_16 void gdk_draw_context_end_frame (GdkDrawContext *context); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_16 gboolean gdk_draw_context_is_in_frame (GdkDrawContext *context); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_16 const cairo_region_t * gdk_draw_context_get_frame_region (GdkDrawContext *context); G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)