Deprecate gdk_surface_create_similar_surface
authorMatthias Clasen <mclasen@redhat.com>
Sun, 2 Apr 2023 03:09:19 +0000 (23:09 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 2 Apr 2023 03:09:19 +0000 (23:09 -0400)
This function is part of the cairo drawing API and
we are moving away from that. Update all callers.

gdk/gdksurface.c
gdk/gdksurface.h
gdk/win32/gdkcairocontext-win32.c
gdk/x11/gdkcairocontext-x11.c

index 6aeba0bee8dc532343154d864b05f75a77e15495..b7e285f2aec726bae8f16b07fb5d65eb9536e2b8 100644 (file)
@@ -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,
index 6936ff7d33863ba708eadda23ca7c9a3b56964ae..5e215b52d59ffa436ec54f75a5b74f813d149a07 100644 (file)
@@ -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,
index 480baf7802a2fe66cea416a69a58742131d675d4..e6cfb66c4dbbc4b0dec165a8ae94a099f5e06ce9 100644 (file)
@@ -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.
index e25ec197a7a034d7744b933aad31b2c9c0af831c..6a9a3fdc84c16ce27e9e434a39061b1f853eb761 100644 (file)
@@ -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);