mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
gdk: Remove gdk_windowing_create_cairo_surface()
Instead, actually use the create_cairo_surface vfunc on the implementation drawable. D'oh.
This commit is contained in:
parent
804fd4b15a
commit
2bedd205c5
@ -509,9 +509,6 @@ gboolean _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
|
|||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
|
|
||||||
cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
|
||||||
int width,
|
|
||||||
int height);
|
|
||||||
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
|
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
|
||||||
int x, int y);
|
int x, int y);
|
||||||
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
|
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
|
||||||
|
@ -185,8 +185,8 @@ gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
return _gdk_windowing_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
|
return _gdk_drawable_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
|
||||||
width, height);
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkScreen*
|
static GdkScreen*
|
||||||
|
@ -3817,8 +3817,7 @@ gdk_window_create_cairo_surface (GdkDrawable *drawable,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
return _gdk_windowing_create_cairo_surface (GDK_WINDOW_OBJECT(drawable)->impl,
|
return _gdk_drawable_ref_cairo_surface (GDK_WINDOW_OBJECT(drawable)->impl);
|
||||||
width, height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,10 +55,10 @@ gdk_quartz_cairo_surface_destroy (void *data)
|
|||||||
g_free (surface_data);
|
g_free (surface_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_t *
|
static cairo_surface_t *
|
||||||
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
gdk_quartz_create_cairo_surface (GdkDrawable *drawable,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
CGContextRef cg_context;
|
CGContextRef cg_context;
|
||||||
GdkQuartzCairoSurfaceData *surface_data;
|
GdkQuartzCairoSurfaceData *surface_data;
|
||||||
@ -97,8 +97,8 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
|
|||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
gdk_drawable_get_size (drawable, &width, &height);
|
gdk_drawable_get_size (drawable, &width, &height);
|
||||||
impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable,
|
impl->cairo_surface = gdk_quartz_create_cairo_surface (drawable,
|
||||||
width, height);
|
width, height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cairo_surface_reference (impl->cairo_surface);
|
cairo_surface_reference (impl->cairo_surface);
|
||||||
@ -170,6 +170,7 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
|
|||||||
object_class->finalize = gdk_drawable_impl_quartz_finalize;
|
object_class->finalize = gdk_drawable_impl_quartz_finalize;
|
||||||
|
|
||||||
drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
|
drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
|
||||||
|
drawable_class->create_cairo_surface = gdk_quartz_create_cairo_surface;
|
||||||
|
|
||||||
drawable_class->set_colormap = gdk_quartz_set_colormap;
|
drawable_class->set_colormap = gdk_quartz_set_colormap;
|
||||||
drawable_class->get_colormap = gdk_quartz_get_colormap;
|
drawable_class->get_colormap = gdk_quartz_get_colormap;
|
||||||
|
@ -49,6 +49,9 @@
|
|||||||
(gcwin32->line_style == GDK_LINE_ON_OFF_DASH && gcwin32->pen_dash_offset))
|
(gcwin32->line_style == GDK_LINE_ON_OFF_DASH && gcwin32->pen_dash_offset))
|
||||||
|
|
||||||
static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
|
static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
|
||||||
|
static cairo_surface_t *gdk_win32_create_cairo_surface (GdkDrawable *drawable,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
static void gdk_win32_set_colormap (GdkDrawable *drawable,
|
static void gdk_win32_set_colormap (GdkDrawable *drawable,
|
||||||
GdkColormap *colormap);
|
GdkColormap *colormap);
|
||||||
@ -77,6 +80,7 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
|
|||||||
object_class->finalize = gdk_drawable_impl_win32_finalize;
|
object_class->finalize = gdk_drawable_impl_win32_finalize;
|
||||||
|
|
||||||
drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
|
drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
|
||||||
|
drawable_class->create_cairo_surface = gdk_win32_create_cairo_surface;
|
||||||
|
|
||||||
drawable_class->set_colormap = gdk_win32_set_colormap;
|
drawable_class->set_colormap = gdk_win32_set_colormap;
|
||||||
drawable_class->get_colormap = gdk_win32_get_colormap;
|
drawable_class->get_colormap = gdk_win32_get_colormap;
|
||||||
@ -222,10 +226,10 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_t *
|
static cairo_surface_t *
|
||||||
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
gdk_win32_create_cairo_surface (GdkDrawable *drawable,
|
||||||
gint width,
|
gint width,
|
||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
/* width and height are determined from the DC */
|
/* width and height are determined from the DC */
|
||||||
return gdk_win32_ref_cairo_surface (drawable);
|
return gdk_win32_ref_cairo_surface (drawable);
|
||||||
|
@ -49,6 +49,9 @@
|
|||||||
|
|
||||||
|
|
||||||
static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
|
static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
|
||||||
|
static cairo_surface_t *gdk_x11_create_cairo_surface (GdkDrawable *drawable,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
static void gdk_x11_set_colormap (GdkDrawable *drawable,
|
static void gdk_x11_set_colormap (GdkDrawable *drawable,
|
||||||
GdkColormap *colormap);
|
GdkColormap *colormap);
|
||||||
@ -73,6 +76,7 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
|
|||||||
object_class->finalize = gdk_drawable_impl_x11_finalize;
|
object_class->finalize = gdk_drawable_impl_x11_finalize;
|
||||||
|
|
||||||
drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
|
drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
|
||||||
|
drawable_class->create_cairo_surface = gdk_x11_create_cairo_surface;
|
||||||
|
|
||||||
drawable_class->set_colormap = gdk_x11_set_colormap;
|
drawable_class->set_colormap = gdk_x11_set_colormap;
|
||||||
drawable_class->get_colormap = gdk_x11_get_colormap;
|
drawable_class->get_colormap = gdk_x11_get_colormap;
|
||||||
@ -470,10 +474,10 @@ _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_t *
|
static cairo_surface_t *
|
||||||
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
gdk_x11_create_cairo_surface (GdkDrawable *drawable,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
|
GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
|
||||||
GdkVisual *visual;
|
GdkVisual *visual;
|
||||||
@ -516,7 +520,7 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
|
|||||||
|
|
||||||
gdk_drawable_get_size (impl->wrapper, &width, &height);
|
gdk_drawable_get_size (impl->wrapper, &width, &height);
|
||||||
|
|
||||||
impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable, width, height);
|
impl->cairo_surface = gdk_x11_create_cairo_surface (drawable, width, height);
|
||||||
|
|
||||||
if (impl->cairo_surface)
|
if (impl->cairo_surface)
|
||||||
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
|
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
|
||||||
|
Loading…
Reference in New Issue
Block a user