diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-04-01 23:09:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-04-01 23:09:19 -0400 |
commit | 76ac91512b4cfd03f0b839f32f7771e7f5030e2e (patch) | |
tree | 02163ef596f2e317cf403828d865ec1a3dd2da82 | |
parent | afed6f92efe98f4f27ae88df38141acb3a6bba3d (diff) | |
download | gtk+-76ac91512b4cfd03f0b839f32f7771e7f5030e2e.tar.gz |
Deprecate gdk_surface_create_similar_surface
This function is part of the cairo drawing API and
we are moving away from that. Update all callers.
-rw-r--r-- | gdk/gdksurface.c | 2 | ||||
-rw-r--r-- | gdk/gdksurface.h | 2 | ||||
-rw-r--r-- | gdk/win32/gdkcairocontext-win32.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkcairocontext-x11.c | 3 |
4 files changed, 8 insertions, 1 deletions
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 6aeba0bee8..b7e285f2ae 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -2382,6 +2382,8 @@ _gdk_windowing_got_event (GdkDisplay *display, * Returns: a pointer to the newly allocated surface. The caller * owns the surface and should call cairo_surface_destroy() when done * with it. + * + * Deprecated: 4.12: Create a suitable cairo image surface yourself */ cairo_surface_t * gdk_surface_create_similar_surface (GdkSurface *surface, diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index 6936ff7d33..5e215b52d5 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -107,7 +107,7 @@ gboolean gdk_surface_get_device_position (GdkSurface *surface, double *y, GdkModifierType *mask); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_12 cairo_surface_t * gdk_surface_create_similar_surface (GdkSurface *surface, cairo_content_t content, diff --git a/gdk/win32/gdkcairocontext-win32.c b/gdk/win32/gdkcairocontext-win32.c index 480baf7802..e6cfb66c4d 100644 --- a/gdk/win32/gdkcairocontext-win32.c +++ b/gdk/win32/gdkcairocontext-win32.c @@ -88,10 +88,12 @@ gdk_win32_cairo_context_begin_frame (GdkDrawContext *draw_context, g_clear_pointer (&self->db_surface, cairo_surface_destroy); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS self->db_surface = gdk_surface_create_similar_surface (surface, cairo_surface_get_content (self->window_surface), self->db_width, self->db_height); +G_GNUC_END_IGNORE_DEPRECATIONS } /* Double-buffered windows paint on a DB surface. diff --git a/gdk/x11/gdkcairocontext-x11.c b/gdk/x11/gdkcairocontext-x11.c index e25ec197a7..6a9a3fdc84 100644 --- a/gdk/x11/gdkcairocontext-x11.c +++ b/gdk/x11/gdkcairocontext-x11.c @@ -67,10 +67,13 @@ gdk_x11_cairo_context_begin_frame (GdkDrawContext *draw_context, cairo_region_get_extents (region, &clip_box); self->window_surface = create_cairo_surface_for_surface (surface); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS self->paint_surface = gdk_surface_create_similar_surface (surface, cairo_surface_get_content (self->window_surface), MAX (clip_box.width, 1), MAX (clip_box.height, 1)); +G_GNUC_END_IGNORE_DEPRECATIONS sx = sy = 1; cairo_surface_get_device_scale (self->paint_surface, &sx, &sy); |