]> Pileus Git - ~andy/gtk/commitdiff
pixbuf-engine: Get rid of unused mask argument
authorBenjamin Otte <otte@redhat.com>
Tue, 17 Aug 2010 02:30:10 +0000 (04:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:02:57 +0000 (15:02 +0200)
modules/engines/pixbuf/pixbuf-draw.c
modules/engines/pixbuf/pixbuf-render.c
modules/engines/pixbuf/pixbuf.h

index 9c610d620bf68b3c591a77bbac700396e9f716c5..f80a4d757ac152880553c45263f2a89e38a7ec0a 100644 (file)
@@ -131,7 +131,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);
@@ -139,7 +139,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);
 
@@ -300,19 +300,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;
@@ -349,7 +349,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
@@ -385,7 +385,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
index c05832da34d8b36149882891f8c02d52f0351f69..ce25cfbb78cc8a7de31c953fc3154582093ad610 100644 (file)
@@ -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,
index 77e19d4a4ca40976de9aed419d4747bd79b17c7e..2354d76cc39cb3bd1a380fee472b53e3b99a9313 100644 (file)
@@ -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,