forked from AuroraMiddleware/gtk
gdk: Remove gdk_surface_create_similar_image_surface()
It's unused.
This commit is contained in:
parent
7ef8696a7d
commit
4aab8e970b
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user