[gtk+/rendering-cleanup: 1/76] pixbuf-engine: Get rid of unused mask argument



commit 96368bd12f79502692b0853e751037419592e2c6
Author: Benjamin Otte <otte redhat com>
Date:   Tue Aug 17 04:30:10 2010 +0200

    pixbuf-engine: Get rid of unused mask argument

 modules/engines/pixbuf/pixbuf-draw.c   |   16 +++++++-------
 modules/engines/pixbuf/pixbuf-render.c |   34 ++++++-------------------------
 modules/engines/pixbuf/pixbuf.h        |    1 -
 3 files changed, 15 insertions(+), 36 deletions(-)
---
diff --git a/modules/engines/pixbuf/pixbuf-draw.c b/modules/engines/pixbuf/pixbuf-draw.c
index f9188a2..640387e 100644
--- a/modules/engines/pixbuf/pixbuf-draw.c
+++ b/modules/engines/pixbuf/pixbuf-draw.c
@@ -133,7 +133,7 @@ draw_simple_image(GtkStyle       *style,
       if (image->background)
 	{
 	  theme_pixbuf_render (image->background,
-			       window, NULL, area,
+			       window, area,
 			       draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
 			       FALSE,
 			       x, y, width, height);
@@ -141,7 +141,7 @@ draw_simple_image(GtkStyle       *style,
       
       if (image->overlay && draw_center)
 	theme_pixbuf_render (image->overlay,
-			     window, NULL, area, COMPONENT_ALL,
+			     window, area, COMPONENT_ALL,
 			     TRUE, 
 			     x, y, width, height);
 
@@ -302,19 +302,19 @@ draw_gap_image(GtkStyle       *style,
 
       if (image->background)
 	theme_pixbuf_render (image->background,
-			     window, NULL, area, components, FALSE,
+			     window, area, components, FALSE,
 			     x, y, width, height);
       if (image->gap_start)
 	theme_pixbuf_render (image->gap_start,
-			     window, NULL, area, COMPONENT_ALL, FALSE,
+			     window, area, COMPONENT_ALL, FALSE,
 			     r1.x, r1.y, r1.width, r1.height);
       if (image->gap)
 	theme_pixbuf_render (image->gap,
-			     window, NULL, area, COMPONENT_ALL, FALSE,
+			     window, area, COMPONENT_ALL, FALSE,
 			     r2.x, r2.y, r2.width, r2.height);
       if (image->gap_end)
 	theme_pixbuf_render (image->gap_end,
-			     window, NULL, area, COMPONENT_ALL, FALSE,
+			     window, area, COMPONENT_ALL, FALSE,
 			     r3.x, r3.y, r3.width, r3.height);
 
       return TRUE;
@@ -351,7 +351,7 @@ draw_hline (GtkStyle     *style,
     {
       if (image->background)
 	theme_pixbuf_render (image->background,
-			     window, NULL, area, COMPONENT_ALL, FALSE,
+			     window, area, COMPONENT_ALL, FALSE,
 			     x1, y, (x2 - x1) + 1, 2);
     }
   else
@@ -387,7 +387,7 @@ draw_vline (GtkStyle     *style,
     {
       if (image->background)
 	theme_pixbuf_render (image->background,
-			     window, NULL, area, COMPONENT_ALL, FALSE,
+			     window, area, COMPONENT_ALL, FALSE,
 			     x, y1, 2, (y2 - y1) + 1);
     }
   else
diff --git a/modules/engines/pixbuf/pixbuf-render.c b/modules/engines/pixbuf/pixbuf-render.c
index c05832d..ce25cfb 100644
--- a/modules/engines/pixbuf/pixbuf-render.c
+++ b/modules/engines/pixbuf/pixbuf-render.c
@@ -353,7 +353,6 @@ static void
 pixbuf_render (GdkPixbuf    *src,
 	       guint         hints,
 	       GdkWindow    *window,
-	       GdkBitmap    *mask,
 	       GdkRectangle *clip_rect,
 	       gint          src_x,
 	       gint          src_y,
@@ -382,12 +381,7 @@ pixbuf_render (GdkPixbuf    *src,
   if (hints & THEME_MISSING)
     return;
 
-  /* FIXME: Because we use the mask to shape windows, we don't use
-   * clip_rect to clip what we draw to the mask, only to clip
-   * what we actually draw. But this leads to the horrible ineffiency
-   * of scale the whole image to get a little bit of it.
-   */
-  if (!mask && clip_rect)
+  if (clip_rect)
     {
       if (!gdk_rectangle_intersect (clip_rect, &rect, &rect))
 	return;
@@ -479,19 +473,6 @@ pixbuf_render (GdkPixbuf    *src,
     {
       cairo_t *cr;
       
-      if (mask)
-	{
-          cr = gdk_cairo_create (mask);
-
-          gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf,
-                                       -x_offset + rect.x, 
-                                       -y_offset + rect.y);
-          gdk_cairo_rectangle (cr, &rect);
-          cairo_fill (cr);
-
-          cairo_destroy (cr);
-	}
-
       cr = gdk_cairo_create (window);
       gdk_cairo_set_source_pixbuf (cr, 
                                    tmp_pixbuf,
@@ -748,7 +729,6 @@ theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb)
 void
 theme_pixbuf_render (ThemePixbuf  *theme_pb,
 		     GdkWindow    *window,
-		     GdkBitmap    *mask,
 		     GdkRectangle *clip_rect,
 		     guint         component_mask,
 		     gboolean      center,
@@ -804,11 +784,11 @@ theme_pixbuf_render (ThemePixbuf  *theme_pb,
 
 
 
-#define RENDER_COMPONENT(X1,X2,Y1,Y2)					         \
-        pixbuf_render (pixbuf, theme_pb->hints[Y1][X1], window, mask, clip_rect, \
-	 	       src_x[X1], src_y[Y1],				         \
-		       src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1],	         \
-		       dest_x[X1], dest_y[Y1],				         \
+#define RENDER_COMPONENT(X1,X2,Y1,Y2)					   \
+        pixbuf_render (pixbuf, theme_pb->hints[Y1][X1], window, clip_rect, \
+	 	       src_x[X1], src_y[Y1],				   \
+		       src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1],	   \
+		       dest_x[X1], dest_y[Y1],				   \
 		       dest_x[X2] - dest_x[X1], dest_y[Y2] - dest_y[Y1]);
       
       if (component_mask & COMPONENT_NORTH_WEST)
@@ -845,7 +825,7 @@ theme_pixbuf_render (ThemePixbuf  *theme_pb,
 	  x += (width - pixbuf_width) / 2;
 	  y += (height - pixbuf_height) / 2;
 	  
-	  pixbuf_render (pixbuf, 0, window, NULL, clip_rect,
+	  pixbuf_render (pixbuf, 0, window, clip_rect,
 			 0, 0,
 			 pixbuf_width, pixbuf_height,
 			 x, y,
diff --git a/modules/engines/pixbuf/pixbuf.h b/modules/engines/pixbuf/pixbuf.h
index 77e19d4..2354d76 100644
--- a/modules/engines/pixbuf/pixbuf.h
+++ b/modules/engines/pixbuf/pixbuf.h
@@ -202,7 +202,6 @@ G_GNUC_INTERNAL void         theme_pixbuf_set_stretch  (ThemePixbuf  *theme_pb,
 					gboolean      stretch);
 G_GNUC_INTERNAL void         theme_pixbuf_render       (ThemePixbuf  *theme_pb,
 					GdkWindow    *window,
-					GdkBitmap    *mask,
 					GdkRectangle *clip_rect,
 					guint         component_mask,
 					gboolean      center,



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