gdk: Remove gdk_surface_create_similar_image_surface()
authorBenjamin Otte <otte@redhat.com>
Wed, 11 Apr 2018 23:42:21 +0000 (01:42 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 12 Apr 2018 12:04:33 +0000 (14:04 +0200)
It's unused.

docs/reference/gdk/gdk4-sections.txt
gdk/gdksurface.c
gdk/gdksurface.h
gdk/gdksurfaceimpl.h
gdk/wayland/gdksurface-wayland.c

index af17b4c9e7d9acc322345257fbca98a71f730e43..a6bcd8b82a186c12358376f9958607aae869024f 100644 (file)
@@ -408,7 +408,6 @@ gdk_pango_layout_line_get_clip_region
 <TITLE>Cairo Interaction</TITLE>
 <FILE>cairo_interaction</FILE>
 gdk_surface_create_similar_surface
-gdk_surface_create_similar_image_surface
 gdk_cairo_get_clip_rectangle
 gdk_cairo_set_source_rgba
 gdk_cairo_set_source_pixbuf
index 57dd82fab38d4788e3bab5914885467a10333fe9..ed769e215e037af29912bd865c2f9b0861333de0 100644 (file)
@@ -4768,95 +4768,6 @@ gdk_surface_create_similar_surface (GdkSurface *     surface,
   return similar_surface;
 }
 
-
-/**
- * gdk_surface_create_similar_image_surface:
- * @surface: (nullable): surface to make new surface similar to, or
- *   %NULL if none
- * @format: (type int): the format for the new surface
- * @width: width of the new surface
- * @height: height of the new surface
- * @scale: the scale of the new surface, or 0 to use same as @surface
- *
- * Create a new image surface that is efficient to draw on the
- * given @surface.
- *
- * Initially the surface contents are all 0 (transparent if contents
- * have transparency, black otherwise.)
- *
- * The @width and @height of the new surface are not affected by
- * the scaling factor of the @surface, or by the @scale argument; they
- * are the size of the surface in device pixels. If you wish to create
- * an image surface capable of holding the contents of @surface you can
- * use:
- *
- * |[<!-- language="C" -->
- *   int scale = gdk_surface_get_scale_factor (surface);
- *   int width = gdk_surface_get_width (surface) * scale;
- *   int height = gdk_surface_get_height (surface) * scale;
- *
- *   // format is set elsewhere
- *   cairo_surface_t *surface =
- *     gdk_surface_create_similar_image_surface (surface,
- *                                              format,
- *                                              width, height,
- *                                              scale);
- * ]|
- *
- * Note that unlike cairo_surface_create_similar_image(), the new
- * surface's device scale is set to @scale, or to the scale factor of
- * @surface if @scale is 0.
- *
- * Returns: a pointer to the newly allocated surface. The caller
- * owns the surface and should call cairo_surface_destroy() when done
- * with it.
- *
- * This function always returns a valid pointer, but it will return a
- * pointer to a “nil” surface if @other is already in an error state
- * or any other error occurs.
- **/
-cairo_surface_t *
-gdk_surface_create_similar_image_surface (GdkSurface *     surface,
-                                          cairo_format_t  format,
-                                          int             width,
-                                          int             height,
-                                          int             scale)
-{
-  cairo_surface_t *cairo_surface;
-
-  g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), NULL);
-
-  if (surface == NULL)
-    {
-      cairo_surface = cairo_image_surface_create (format, width, height);
-    }
-  else if (GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_similar_image_surface)
-    {
-      cairo_surface =
-        GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_similar_image_surface (surface, format, width, height);
-    }
-  else
-    {
-      cairo_surface_t *window_surface;
-
-      window_surface = gdk_surface_ref_impl_surface (surface);
-      cairo_surface =
-        cairo_surface_create_similar_image (window_surface,
-                                            format,
-                                            width,
-                                            height);
-      cairo_surface_destroy (window_surface);
-    }
-
-  if (scale == 0)
-    scale = gdk_surface_get_scale_factor (surface);
-
-  cairo_surface_set_device_scale (cairo_surface, scale, scale);
-
-  return cairo_surface;
-}
-
-
 /**
  * gdk_surface_focus:
  * @surface: a #GdkSurface
index bed9bb04e3d439e6bda7b6760bad76fd83442fd7..e333608a99b1b14de9188aa85f96cd80243d6822 100644 (file)
@@ -725,13 +725,6 @@ cairo_surface_t *
                                                   cairo_content_t  content,
                                                   int              width,
                                                   int              height);
-GDK_AVAILABLE_IN_ALL
-cairo_surface_t *
-              gdk_surface_create_similar_image_surface (GdkSurface *surface,
-                                                        cairo_format_t format,
-                                                        int            width,
-                                                        int            height,
-                                                        int            scale);
 
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_beep            (GdkSurface       *surface);
index 88d185bb9ad2f2851feee9db703a7d324e8a9178..0e33f254a4582a5abc8b5d83a7ebca07d987efa9 100644 (file)
@@ -51,11 +51,6 @@ struct _GdkSurfaceImplClass
 
   cairo_surface_t *
                (* ref_cairo_surface)    (GdkSurface       *surface);
-  cairo_surface_t *
-               (* create_similar_image_surface) (GdkSurface *     surface,
-                                                 cairo_format_t  format,
-                                                 int             width,
-                                                 int             height);
 
   void         (* show)                 (GdkSurface       *surface,
                                          gboolean         already_mapped);
index cfa8319178469d5a77c8bbb41b1c7b7b2764137d..28e4df29193b6bb24aa60be91b3d1c931d6e0a67 100644 (file)
@@ -818,15 +818,6 @@ gdk_wayland_surface_ref_cairo_surface (GdkSurface *surface)
   return impl->staging_cairo_surface;
 }
 
-static cairo_surface_t *
-gdk_wayland_surface_create_similar_image_surface (GdkSurface *     surface,
-                                                 cairo_format_t  format,
-                                                 int             width,
-                                                 int             height)
-{
-  return cairo_image_surface_create (format, width, height);
-}
-
 static gboolean
 gdk_surface_impl_wayland_begin_paint (GdkSurface *surface)
 {
@@ -3608,7 +3599,6 @@ _gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass)
   object_class->finalize = gdk_surface_impl_wayland_finalize;
 
   impl_class->ref_cairo_surface = gdk_wayland_surface_ref_cairo_surface;
-  impl_class->create_similar_image_surface = gdk_wayland_surface_create_similar_image_surface;
   impl_class->show = gdk_wayland_surface_show;
   impl_class->hide = gdk_wayland_surface_hide;
   impl_class->withdraw = gdk_surface_wayland_withdraw;