From: Matthias Clasen Date: Sun, 2 Apr 2023 03:09:19 +0000 (-0400) Subject: Deprecate gdk_surface_create_similar_surface X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~458^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=76ac91512b4cfd03f0b839f32f7771e7f5030e2e;p=gtk4.git 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. --- 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);