[gtk+/rendering-cleanup: 70/142] gdk: Remove gdk_windowing_create_cairo_surface()



commit a09dcda29c4827f197e19b066c8eece067f13cc4
Author: Benjamin Otte <otte redhat com>
Date:   Wed Aug 25 22:16:28 2010 +0200

    gdk: Remove gdk_windowing_create_cairo_surface()
    
    Instead, actually use the create_cairo_surface vfunc on the
    implementation drawable. D'oh.

 gdk/gdkinternals.h              |    3 ---
 gdk/gdkpixmap.c                 |    4 ++--
 gdk/gdkwindow.c                 |    3 +--
 gdk/quartz/gdkdrawable-quartz.c |   13 +++++++------
 gdk/win32/gdkdrawable-win32.c   |   12 ++++++++----
 gdk/x11/gdkdrawable-x11.c       |   14 +++++++++-----
 6 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 851f0c7..91aca88 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -511,9 +511,6 @@ gboolean _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
 					        int width,
 					        int height);
 
-cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
-						       int width,
-						       int height);
 GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
 				       int x, int y);
 GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index c8849e9..2c42162 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -185,8 +185,8 @@ gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
 				 int width,
 				 int height)
 {
-  return _gdk_windowing_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
-					      width, height);
+  return _gdk_drawable_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
+					     width, height);
 }
 
 static GdkScreen*
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2fe180b..7900dbd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3814,8 +3814,7 @@ gdk_window_create_cairo_surface (GdkDrawable *drawable,
 				 int width,
 				 int height)
 {
-  return _gdk_windowing_create_cairo_surface (GDK_WINDOW_OBJECT(drawable)->impl,
-					      width, height);
+  return _gdk_drawable_ref_cairo_surface (GDK_WINDOW_OBJECT(drawable)->impl);
 }
 
 
diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c
index 849d186..ea8736a 100644
--- a/gdk/quartz/gdkdrawable-quartz.c
+++ b/gdk/quartz/gdkdrawable-quartz.c
@@ -55,10 +55,10 @@ gdk_quartz_cairo_surface_destroy (void *data)
   g_free (surface_data);
 }
 
-cairo_surface_t *
-_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
-				     int          width,
-				     int          height)
+static cairo_surface_t *
+gdk_quartz_create_cairo_surface (GdkDrawable *drawable,
+				 int          width,
+				 int          height)
 {
   CGContextRef cg_context;
   GdkQuartzCairoSurfaceData *surface_data;
@@ -97,8 +97,8 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
       int width, height;
 
       gdk_drawable_get_size (drawable, &width, &height);
-      impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable,
-                                                                 width, height);
+      impl->cairo_surface = gdk_quartz_create_cairo_surface (drawable,
+                                                             width, height);
     }
   else
     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;
 
   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->get_colormap = gdk_quartz_get_colormap;
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 7fd01d8..13fca73 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -49,6 +49,9 @@
    (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_create_cairo_surface (GdkDrawable *drawable,
+                                                        int          width,
+                                                        int          height);
      
 static void gdk_win32_set_colormap   (GdkDrawable    *drawable,
 				      GdkColormap    *colormap);
@@ -77,6 +80,7 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   object_class->finalize = gdk_drawable_impl_win32_finalize;
 
   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->get_colormap = gdk_win32_get_colormap;
@@ -222,10 +226,10 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
     }
 }
 
-cairo_surface_t *
-_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
-				     gint width,
-				     gint height)
+static cairo_surface_t *
+gdk_win32_create_cairo_surface (GdkDrawable *drawable,
+				gint width,
+				gint height)
 {
   /* width and height are determined from the DC */
   return gdk_win32_ref_cairo_surface (drawable);
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 961dad0..8d92429 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -49,6 +49,9 @@
 
 
 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,
                                     GdkColormap    *colormap);
@@ -73,6 +76,7 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   object_class->finalize = gdk_drawable_impl_x11_finalize;
   
   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->get_colormap = gdk_x11_get_colormap;
@@ -470,10 +474,10 @@ _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
   return TRUE;
 }
 
-cairo_surface_t *
-_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
-				     int width,
-				     int height)
+static cairo_surface_t *
+gdk_x11_create_cairo_surface (GdkDrawable *drawable,
+			      int width,
+			      int height)
 {
   GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
   GdkVisual *visual;
@@ -516,7 +520,7 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
   
       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)
 	cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]