[sapwood] pass a cairo_surface_t into the cropping for the mask



commit 1b036aae18469a20229fbaff6d343bdc5dcd7946
Author: Sven Herzberg <herzi gnome-de org>
Date:   Thu Aug 12 12:35:08 2010 +0200

    pass a cairo_surface_t into the cropping for the mask
    
    * engine/sapwood-pixmap.c: pass a cairo_surface_t into
      sapwood_crop_pixmap()

 engine/sapwood-pixmap.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/engine/sapwood-pixmap.c b/engine/sapwood-pixmap.c
index f911ea6..5f9b2d0 100644
--- a/engine/sapwood-pixmap.c
+++ b/engine/sapwood-pixmap.c
@@ -386,7 +386,7 @@ sapwood_pixmap_render_rects_internal (SapwoodPixmap* self,
 
 static void
 sapwood_crop_pixmap (cairo_surface_t* surface,
-                     GdkBitmap      * mask,
+                     cairo_surface_t* mask,
                      int              requested_width,
                      int              requested_height,
                      int              original_width,
@@ -414,7 +414,7 @@ sapwood_crop_pixmap (cairo_surface_t* surface,
 
       if (mask)
         {
-          cairo_t* tmp_cr = gdk_cairo_create (mask);
+          cairo_t* tmp_cr = cairo_create (mask);
 
           /* adjust the bitmap */
           cairo_set_source_surface (tmp_cr, cairo_get_target (tmp_cr), -(original_width - requested_width), 0);
@@ -444,7 +444,7 @@ sapwood_crop_pixmap (cairo_surface_t* surface,
 
       if (mask)
         {
-          cairo_t* tmp_cr = gdk_cairo_create (mask);
+          cairo_t* tmp_cr = cairo_create (mask);
 
           /* adjust the bitmap */
           cairo_set_source_surface (tmp_cr, cairo_get_target (tmp_cr), 0, -(original_height - requested_height));
@@ -542,8 +542,10 @@ sapwood_pixmap_render_rects (SapwoodPixmap* self,
 
   if ((width > 0 && width < tmp_width) || (height > 0 && height < tmp_height))
     {
-      sapwood_crop_pixmap (tmp, tmp_mask, width, height,
+      cairo_t* tmp_cr = gdk_cairo_create (tmp_mask);
+      sapwood_crop_pixmap (tmp, cairo_get_target (tmp_cr), width, height,
 			   self->width, self->height);
+      cairo_destroy (tmp_cr);
 
       cairo_rectangle (cr, 0, 0, width, height);
       cairo_clip (cr);



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