[sapwood] start to update the function signature



commit 30e4d42e7c08774187c47fb261d37d2dad90cb9a
Author: Sven Herzberg <herzi gnome-de org>
Date:   Fri Aug 6 11:21:03 2010 +0200

    start to update the function signature
    
    In order to be properly compatible with the new theming API, we have to
    be able to handle a cairo_t instead of a GdkDrawable.
    
    * engine/sapwood-pixmap.c: accept a cairo_t only and create it in
      sapwood_pixmap_render_rects()

 engine/sapwood-pixmap.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/engine/sapwood-pixmap.c b/engine/sapwood-pixmap.c
index acd838d..62f8a94 100644
--- a/engine/sapwood-pixmap.c
+++ b/engine/sapwood-pixmap.c
@@ -276,8 +276,8 @@ sapwood_pixmap_get_pixmap (SapwoodPixmap *self,
  * Render the areas of @self specified by @rect to @drawable.
  */
 static void
-sapwood_pixmap_render_rects_internal (SapwoodPixmap *self,
-                                      GdkDrawable   *draw,
+sapwood_pixmap_render_rects_internal (SapwoodPixmap* self,
+                                      cairo_t      * cr,
                                       gint           draw_x,
                                       gint           draw_y,
                                       GdkBitmap     *mask,
@@ -289,7 +289,6 @@ sapwood_pixmap_render_rects_internal (SapwoodPixmap *self,
                                       SapwoodRect   *rect)
 {
   cairo_t     * mask_cr = NULL;
-  cairo_t     * cr;
   gint          xofs;
   gint          yofs;
   gint          n;
@@ -331,7 +330,6 @@ sapwood_pixmap_render_rects_internal (SapwoodPixmap *self,
 	}
     }
 
-  cr = gdk_cairo_create (draw);
   for (n = 0; n < n_rect; n++)
     {
       /* const */ GdkRectangle *dest = &rect[n].dest;
@@ -374,7 +372,6 @@ sapwood_pixmap_render_rects_internal (SapwoodPixmap *self,
           cairo_restore (cr);
 	}
     }
-  cairo_destroy (cr);
 
   if (mask_cr)
     {
@@ -544,7 +541,9 @@ sapwood_pixmap_render_rects (SapwoodPixmap* self,
    */
   if (mask_required || (width >= self->width && height >= self->height))
     {
-      sapwood_pixmap_render_rects_internal (self, draw, draw_x, draw_y, mask, mask_x, mask_y, mask_required, clip_rect, n_rect, rect);
+      cr = gdk_cairo_create (draw);
+      sapwood_pixmap_render_rects_internal (self, cr, draw_x, draw_y, mask, mask_x, mask_y, mask_required, clip_rect, n_rect, rect);
+      cairo_destroy (cr);
       return;
     }
 
@@ -573,9 +572,8 @@ sapwood_pixmap_render_rects (SapwoodPixmap* self,
       cairo_paint (mask_cr);
     }
 
-  sapwood_pixmap_render_rects_internal (self, tmp, 0, 0, tmp_mask, 0, 0, mask_required, NULL, n_rect, rect);
-
   tmp_cr = gdk_cairo_create (tmp);
+  sapwood_pixmap_render_rects_internal (self, tmp_cr, 0, 0, tmp_mask, 0, 0, mask_required, NULL, n_rect, rect);
 
   /* finally, render downscaled at draw_x,draw_y */
   cr = gdk_cairo_create (draw);



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