[Pixman] [PATCH] Eliminate mask_bits from all the scanline fetchers.

Søren Sandmann sandmann at daimi.au.dk
Mon May 31 09:52:43 PDT 2010


From: Søren Sandmann Pedersen <ssp at redhat.com>

Back in the day, the mask_bits argument was used to distinguish
between masks used for component alpha (where it was 0xffffffff) and
masks for unified alpha (where it was 0xff000000). In this way, the
fetchers could check if just the alpha channel was 0 and in that case
avoid fetching the source.

However, we haven't actually used it like that for a long time; it is
currently always either 0xffffffff or 0 (if the mask is NULL). It also
doesn't seem worthwhile resurrecting it because for premultiplied
buffers, if alpha is 0, then so are the color channels
normally.

This patch eliminates the mask_bits and changes the fetchers to just
assume it is 0xffffffff if mask is non-NULL.
---
 pixman/pixman-access.c           |  122 +++++++++++++-------------------------
 pixman/pixman-bits-image.c       |   33 ++++------
 pixman/pixman-conical-gradient.c |    7 +-
 pixman/pixman-general.c          |   11 ++--
 pixman/pixman-image.c            |   18 ++----
 pixman/pixman-linear-gradient.c  |   13 ++--
 pixman/pixman-private.h          |   12 +---
 pixman/pixman-radial-gradient.c  |    7 +-
 pixman/pixman-solid-fill.c       |    6 +-
 9 files changed, 85 insertions(+), 144 deletions(-)

diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index fa0a267..809cc38 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -94,8 +94,7 @@ fetch_scanline_a8r8g8b8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     
@@ -110,8 +109,7 @@ fetch_scanline_x8r8g8b8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (const uint32_t *)bits + x;
@@ -127,8 +125,7 @@ fetch_scanline_a8b8g8r8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -150,8 +147,7 @@ fetch_scanline_x8b8g8r8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -174,8 +170,7 @@ fetch_scanline_b8g8r8a8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -198,8 +193,7 @@ fetch_scanline_b8g8r8x8 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -223,8 +217,7 @@ fetch_scanline_a2r10g10b10 (pixman_image_t *image,
                             int             y,
                             int             width,
                             uint32_t *      b,
-                            const uint32_t *mask,
-                            uint32_t        mask_bits)
+                            const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = bits + x;
@@ -259,8 +252,7 @@ fetch_scanline_x2r10g10b10 (pixman_image_t *image,
                             int             y,
                             int             width,
                             uint32_t *      b,
-                            const uint32_t *mask,
-                            uint32_t        mask_bits)
+                            const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -289,8 +281,7 @@ fetch_scanline_a2b10g10r10 (pixman_image_t *image,
                             int             y,
                             int             width,
                             uint32_t *      b,
-                            const uint32_t *mask,
-                            uint32_t        mask_bits)
+                            const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = bits + x;
@@ -325,8 +316,7 @@ fetch_scanline_x2b10g10r10 (pixman_image_t *image,
                             int             y,
                             int             width,
                             uint32_t *      b,
-                            const uint32_t *mask,
-                            uint32_t        mask_bits)
+                            const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint32_t *pixel = (uint32_t *)bits + x;
@@ -354,8 +344,7 @@ fetch_scanline_r8g8b8 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + 3 * x;
@@ -385,8 +374,7 @@ fetch_scanline_b8g8r8 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + 3 * x;
@@ -414,8 +402,7 @@ fetch_scanline_r5g6b5 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -441,8 +428,7 @@ fetch_scanline_b5g6r5 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -467,8 +453,7 @@ fetch_scanline_a1r5g5b5 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -494,8 +479,7 @@ fetch_scanline_x1r5g5b5 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -520,8 +504,7 @@ fetch_scanline_a1b5g5r5 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -547,8 +530,7 @@ fetch_scanline_x1b5g5r5 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -573,8 +555,7 @@ fetch_scanline_a4r4g4b4 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -600,8 +581,7 @@ fetch_scanline_x4r4g4b4 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -626,8 +606,7 @@ fetch_scanline_a4b4g4r4 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -653,8 +632,7 @@ fetch_scanline_x4b4g4r4 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint16_t *pixel = (const uint16_t *)bits + x;
@@ -679,8 +657,7 @@ fetch_scanline_a8 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -696,8 +673,7 @@ fetch_scanline_r3g3b2 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -725,8 +701,7 @@ fetch_scanline_b2g3r3 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -762,8 +737,7 @@ fetch_scanline_a2r2g2b2 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -789,8 +763,7 @@ fetch_scanline_a2b2g2r2 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -816,8 +789,7 @@ fetch_scanline_c8 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const pixman_indexed_t * indexed = image->bits.indexed;
@@ -838,8 +810,7 @@ fetch_scanline_x4a4 (pixman_image_t *image,
                      int             y,
                      int             width,
                      uint32_t *      buffer,
-                     const uint32_t *mask,
-                     uint32_t        mask_bits)
+                     const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const uint8_t *pixel = (const uint8_t *)bits + x;
@@ -868,8 +839,7 @@ fetch_scanline_a4 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     int i;
@@ -890,8 +860,7 @@ fetch_scanline_r1g2b1 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     int i;
@@ -915,8 +884,7 @@ fetch_scanline_b1g2r1 (pixman_image_t *image,
                        int             y,
                        int             width,
                        uint32_t *      buffer,
-                       const uint32_t *mask,
-                       uint32_t        mask_bits)
+                       const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     int i;
@@ -940,8 +908,7 @@ fetch_scanline_a1r1g1b1 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     uint32_t a, r, g, b;
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
@@ -966,8 +933,7 @@ fetch_scanline_a1b1g1r1 (pixman_image_t *image,
                          int             y,
                          int             width,
                          uint32_t *      buffer,
-                         const uint32_t *mask,
-                         uint32_t        mask_bits)
+                         const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     int i;
@@ -992,8 +958,7 @@ fetch_scanline_c4 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const pixman_indexed_t * indexed = image->bits.indexed;
@@ -1013,8 +978,7 @@ fetch_scanline_a1 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     int i;
@@ -1044,8 +1008,7 @@ fetch_scanline_g1 (pixman_image_t *image,
                    int             y,
                    int             width,
                    uint32_t *      buffer,
-                   const uint32_t *mask,
-                   uint32_t        mask_bits)
+                   const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
     const pixman_indexed_t * indexed = image->bits.indexed;
@@ -1073,8 +1036,7 @@ fetch_scanline_yuy2 (pixman_image_t *image,
                      int             line,
                      int             width,
                      uint32_t *      buffer,
-                     const uint32_t *mask,
-                     uint32_t        mask_bits)
+                     const uint32_t *mask)
 {
     const uint32_t *bits = image->bits.bits + image->bits.rowstride * line;
     int i;
@@ -1108,8 +1070,7 @@ fetch_scanline_yv12 (pixman_image_t *image,
                      int             line,
                      int             width,
                      uint32_t *      buffer,
-                     const uint32_t *mask,
-                     uint32_t        mask_bits)
+                     const uint32_t *mask)
 {
     YV12_SETUP (image);
     uint8_t *y_line = YV12_Y (line);
@@ -2684,13 +2645,12 @@ fetch_scanline_generic_64 (pixman_image_t *image,
                            int             y,
                            int             width,
                            uint32_t *      buffer,
-                           const uint32_t *mask,
-                           uint32_t        mask_bits)
+                           const uint32_t *mask)
 {
     /* Fetch the pixels into the first half of buffer and then expand them in
      * place.
      */
-    image->bits.fetch_scanline_raw_32 (image, x, y, width, buffer, NULL, 0);
+    image->bits.fetch_scanline_raw_32 (image, x, y, width, buffer, NULL);
     
     pixman_expand ((uint64_t *)buffer, buffer, image->bits.format, width);
 }
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 3d78ff0..ff59a8f 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -330,8 +330,7 @@ bits_image_fetch_bilinear_no_repeat_8888 (pixman_image_t * ima,
 					  int              line,
 					  int              width,
 					  uint32_t *       buffer,
-					  const uint32_t * mask,
-					  uint32_t         mask_bits)
+					  const uint32_t * mask)
 {
     bits_image_t *bits = &ima->bits;
     pixman_fixed_t x_top, x_bottom, x;
@@ -407,8 +406,9 @@ bits_image_fetch_bilinear_no_repeat_8888 (pixman_image_t * ima,
      */
     if (!mask)
     {
+	uint32_t mask_bits = 1;
+
         mask_inc = 0;
-        mask_bits = 1;
         mask = &mask_bits;
     }
     else
@@ -643,8 +643,7 @@ bits_image_fetch_transformed (pixman_image_t * image,
                               int              line,
                               int              width,
                               uint32_t *       buffer,
-                              const uint32_t * mask,
-                              uint32_t         mask_bits)
+                              const uint32_t * mask)
 {
     pixman_fixed_t x, y, w;
     pixman_fixed_t ux, uy, uw;
@@ -682,7 +681,7 @@ bits_image_fetch_transformed (pixman_image_t * image,
     {
 	for (i = 0; i < width; ++i)
 	{
-	    if (!mask || (mask[i] & mask_bits))
+	    if (!mask || mask[i])
 	    {
 		buffer[i] =
 		    bits_image_fetch_pixel_filtered (&image->bits, x, y);
@@ -698,7 +697,7 @@ bits_image_fetch_transformed (pixman_image_t * image,
 	{
 	    pixman_fixed_t x0, y0;
 
-	    if (!mask || (mask[i] & mask_bits))
+	    if (!mask || mask[i])
 	    {
 		x0 = ((pixman_fixed_48_16_t)x << 16) / w;
 		y0 = ((pixman_fixed_48_16_t)y << 16) / w;
@@ -720,8 +719,7 @@ bits_image_fetch_solid_32 (pixman_image_t * image,
                            int              y,
                            int              width,
                            uint32_t *       buffer,
-                           const uint32_t * mask,
-                           uint32_t         mask_bits)
+                           const uint32_t * mask)
 {
     uint32_t color;
     uint32_t *end;
@@ -739,8 +737,7 @@ bits_image_fetch_solid_64 (pixman_image_t * image,
                            int              y,
                            int              width,
                            uint32_t *       b,
-                           const uint32_t * unused,
-                           uint32_t         unused2)
+                           const uint32_t * unused)
 {
     uint64_t color;
     uint64_t *buffer = (uint64_t *)b;
@@ -785,9 +782,9 @@ bits_image_fetch_untransformed_repeat_none (bits_image_t *image,
 	w = MIN (width, image->width - x);
 
 	if (wide)
-	    image->fetch_scanline_raw_64 ((pixman_image_t *)image, x, y, w, buffer, NULL, 0);
+	    image->fetch_scanline_raw_64 ((pixman_image_t *)image, x, y, w, buffer, NULL);
 	else
-	    image->fetch_scanline_raw_32 ((pixman_image_t *)image, x, y, w, buffer, NULL, 0);
+	    image->fetch_scanline_raw_32 ((pixman_image_t *)image, x, y, w, buffer, NULL);
 
 	width -= w;
 	buffer += w * (wide? 2 : 1);
@@ -823,9 +820,9 @@ bits_image_fetch_untransformed_repeat_normal (bits_image_t *image,
 	w = MIN (width, image->width - x);
 
 	if (wide)
-	    image->fetch_scanline_raw_64 ((pixman_image_t *)image, x, y, w, buffer, NULL, 0);
+	    image->fetch_scanline_raw_64 ((pixman_image_t *)image, x, y, w, buffer, NULL);
 	else
-	    image->fetch_scanline_raw_32 ((pixman_image_t *)image, x, y, w, buffer, NULL, 0);
+	    image->fetch_scanline_raw_32 ((pixman_image_t *)image, x, y, w, buffer, NULL);
 
 	buffer += w * (wide? 2 : 1);
 	x += w;
@@ -839,8 +836,7 @@ bits_image_fetch_untransformed_32 (pixman_image_t * image,
                                    int              y,
                                    int              width,
                                    uint32_t *       buffer,
-                                   const uint32_t * mask,
-                                   uint32_t         mask_bits)
+                                   const uint32_t * mask)
 {
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
@@ -860,8 +856,7 @@ bits_image_fetch_untransformed_64 (pixman_image_t * image,
                                    int              y,
                                    int              width,
                                    uint32_t *       buffer,
-                                   const uint32_t * unused,
-                                   uint32_t         unused2)
+                                   const uint32_t * unused)
 {
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
diff --git a/pixman/pixman-conical-gradient.c b/pixman/pixman-conical-gradient.c
index 0341a8e..1c8ddba 100644
--- a/pixman/pixman-conical-gradient.c
+++ b/pixman/pixman-conical-gradient.c
@@ -38,8 +38,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
                                   int             y,
                                   int             width,
                                   uint32_t *      buffer,
-                                  const uint32_t *mask,
-                                  uint32_t        mask_bits)
+                                  const uint32_t *mask)
 {
     source_image_t *source = (source_image_t *)image;
     gradient_t *gradient = (gradient_t *)source;
@@ -91,7 +90,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
 	{
 	    double angle;
 
-	    if (!mask || *mask++ & mask_bits)
+	    if (!mask || *mask++)
 	    {
 		pixman_fixed_48_16_t t;
 
@@ -114,7 +113,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
 	    double x, y;
 	    double angle;
 
-	    if (!mask || *mask++ & mask_bits)
+	    if (!mask || *mask++)
 	    {
 		pixman_fixed_48_16_t t;
 
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index bddf79a..fc742c0 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -206,7 +206,7 @@ general_composite_rect  (pixman_implementation_t *imp,
 		/* fetch mask before source so that fetching of
 		   source can be optimized */
 		fetch_mask (mask, mask_x, mask_y + i,
-		            width, (void *)mask_buffer, 0, 0);
+		            width, (void *)mask_buffer, 0);
 
 		if (mask_class == SOURCE_IMAGE_CLASS_HORIZONTAL)
 		    fetch_mask = NULL;
@@ -215,20 +215,19 @@ general_composite_rect  (pixman_implementation_t *imp,
 	    if (src_class == SOURCE_IMAGE_CLASS_HORIZONTAL)
 	    {
 		fetch_src (src, src_x, src_y + i,
-		           width, (void *)src_buffer, 0, 0);
+		           width, (void *)src_buffer, 0);
 		fetch_src = NULL;
 	    }
 	    else
 	    {
 		fetch_src (src, src_x, src_y + i,
-		           width, (void *)src_buffer, (void *)mask_buffer,
-		           0xffffffff);
+		           width, (void *)src_buffer, (void *)mask_buffer);
 	    }
 	}
 	else if (fetch_mask)
 	{
 	    fetch_mask (mask, mask_x, mask_y + i,
-	                width, (void *)mask_buffer, 0, 0);
+	                width, (void *)mask_buffer, 0);
 	}
 
 	if (store)
@@ -237,7 +236,7 @@ general_composite_rect  (pixman_implementation_t *imp,
 	    if (fetch_dest)
 	    {
 		fetch_dest (dest, dest_x, dest_y + i,
-		            width, (void *)dest_buffer, 0, 0);
+		            width, (void *)dest_buffer, 0);
 	    }
 
 	    /* blend */
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 6b0dc6d..b657b04 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -65,8 +65,7 @@ _pixman_image_get_scanline_generic_64 (pixman_image_t * image,
                                        int              y,
                                        int              width,
                                        uint32_t *       buffer,
-                                       const uint32_t * mask,
-                                       uint32_t         mask_bits)
+                                       const uint32_t * mask)
 {
     uint32_t *mask8 = NULL;
 
@@ -83,8 +82,7 @@ _pixman_image_get_scanline_generic_64 (pixman_image_t * image,
     }
 
     /* Fetch the source image into the first half of buffer. */
-    _pixman_image_get_scanline_32 (image, x, y, width, (uint32_t*)buffer, mask8,
-                                   mask_bits);
+    _pixman_image_get_scanline_32 (image, x, y, width, (uint32_t*)buffer, mask8);
 
     /* Expand from 32bpp to 64bpp in place. */
     pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, width);
@@ -142,10 +140,9 @@ _pixman_image_get_scanline_32 (pixman_image_t *image,
                                int             y,
                                int             width,
                                uint32_t *      buffer,
-                               const uint32_t *mask,
-                               uint32_t        mask_bits)
+                               const uint32_t *mask)
 {
-    image->common.get_scanline_32 (image, x, y, width, buffer, mask, mask_bits);
+    image->common.get_scanline_32 (image, x, y, width, buffer, mask);
 }
 
 /* Even thought the type of buffer is uint32_t *, the function actually expects
@@ -157,10 +154,9 @@ _pixman_image_get_scanline_64 (pixman_image_t *image,
                                int             y,
                                int             width,
                                uint32_t *      buffer,
-                               const uint32_t *unused,
-                               uint32_t        unused2)
+                               const uint32_t *unused)
 {
-    image->common.get_scanline_64 (image, x, y, width, buffer, unused, unused2);
+    image->common.get_scanline_64 (image, x, y, width, buffer, unused);
 }
 
 static void
@@ -756,7 +752,7 @@ _pixman_image_get_solid (pixman_image_t *     image,
 {
     uint32_t result;
 
-    _pixman_image_get_scanline_32 (image, 0, 0, 1, &result, NULL, 0);
+    _pixman_image_get_scanline_32 (image, 0, 0, 1, &result, NULL);
 
     /* If necessary, convert RGB <--> BGR. */
     if (PIXMAN_FORMAT_TYPE (format) != PIXMAN_TYPE_ARGB)
diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c
index d9409fe..47b2886 100644
--- a/pixman/pixman-linear-gradient.c
+++ b/pixman/pixman-linear-gradient.c
@@ -97,8 +97,7 @@ linear_gradient_get_scanline_32 (pixman_image_t *image,
                                  int             y,
                                  int             width,
                                  uint32_t *      buffer,
-                                 const uint32_t *mask,
-                                 uint32_t        mask_bits)
+                                 const uint32_t *mask)
 {
     pixman_vector_t v, unit;
     pixman_fixed_32_32_t l;
@@ -184,7 +183,7 @@ linear_gradient_get_scanline_32 (pixman_image_t *image,
 	    {
 		while (buffer < end)
 		{
-		    if (*mask++ & mask_bits)
+		    if (*mask++)
 			*buffer = _pixman_gradient_walker_pixel (&walker, t);
 
 		    buffer++;
@@ -223,7 +222,7 @@ linear_gradient_get_scanline_32 (pixman_image_t *image,
 	{
 	    while (buffer < end)
 	    {
-		if (!mask || *mask++ & mask_bits)
+		if (!mask || *mask++)
 		{
 		    if (v.vector[2] == 0)
 		    {
@@ -236,12 +235,12 @@ linear_gradient_get_scanline_32 (pixman_image_t *image,
 			y = ((pixman_fixed_48_16_t)v.vector[1] << 16) / v.vector[2];
 			t = ((a * x + b * y) >> 16) + off;
 		    }
-		    
+
 		    *buffer = _pixman_gradient_walker_pixel (&walker, t);
 		}
-		
+
 		++buffer;
-		
+
 		v.vector[0] += unit.vector[0];
 		v.vector[1] += unit.vector[1];
 		v.vector[2] += unit.vector[2];
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index d5767af..5b0eff3 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -36,8 +36,7 @@ typedef void (*fetch_scanline_t) (pixman_image_t *image,
 				  int             y,
 				  int             width,
 				  uint32_t       *buffer,
-				  const uint32_t *mask,
-				  uint32_t        mask_bits);
+				  const uint32_t *mask);
 
 typedef uint32_t (*fetch_pixel_32_t) (bits_image_t *image,
 				      int           x,
@@ -224,8 +223,7 @@ _pixman_image_get_scanline_generic_64  (pixman_image_t *image,
                                         int             y,
                                         int             width,
                                         uint32_t *      buffer,
-                                        const uint32_t *mask,
-                                        uint32_t        mask_bits);
+                                        const uint32_t *mask);
 
 source_image_class_t
 _pixman_image_classify (pixman_image_t *image,
@@ -240,8 +238,7 @@ _pixman_image_get_scanline_32 (pixman_image_t *image,
                                int             y,
                                int             width,
                                uint32_t *      buffer,
-                               const uint32_t *mask,
-                               uint32_t        mask_bits);
+                               const uint32_t *mask);
 
 /* Even thought the type of buffer is uint32_t *, the function actually expects
  * a uint64_t *buffer.
@@ -252,8 +249,7 @@ _pixman_image_get_scanline_64 (pixman_image_t *image,
                                int             y,
                                int             width,
                                uint32_t *      buffer,
-                               const uint32_t *unused,
-                               uint32_t        unused2);
+                               const uint32_t *unused);
 
 void
 _pixman_image_store_scanline_32 (bits_image_t *  image,
diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c
index 022157b..3cbede1 100644
--- a/pixman/pixman-radial-gradient.c
+++ b/pixman/pixman-radial-gradient.c
@@ -39,8 +39,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
                                  int             y,
                                  int             width,
                                  uint32_t *      buffer,
-                                 const uint32_t *mask,
-                                 uint32_t        mask_bits)
+                                 const uint32_t *mask)
 {
     /*
      * In the radial gradient problem we are given two circles (c₁,r₁) and
@@ -238,7 +237,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
 
 	while (buffer < end)
 	{
-	    if (!mask || *mask++ & mask_bits)
+	    if (!mask || *mask++)
 	    {
 		pixman_fixed_48_16_t t;
 		double det = B * B + A4 * (pdx * pdx + pdy * pdy - r1sq);
@@ -263,7 +262,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
 	/* projective */
 	while (buffer < end)
 	{
-	    if (!mask || *mask++ & mask_bits)
+	    if (!mask || *mask++)
 	    {
 		double pdx, pdy;
 		double B, C;
diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c
index 48c999a..44f3362 100644
--- a/pixman/pixman-solid-fill.c
+++ b/pixman/pixman-solid-fill.c
@@ -32,8 +32,7 @@ solid_fill_get_scanline_32 (pixman_image_t *image,
                             int             y,
                             int             width,
                             uint32_t *      buffer,
-                            const uint32_t *mask,
-                            uint32_t        mask_bits)
+                            const uint32_t *mask)
 {
     uint32_t *end = buffer + width;
     uint32_t color = image->solid.color_32;
@@ -50,8 +49,7 @@ solid_fill_get_scanline_64 (pixman_image_t *image,
 			    int             y,
 			    int             width,
 			    uint32_t *      buffer,
-			    const uint32_t *mask,
-			    uint32_t        mask_bits)
+			    const uint32_t *mask)
 {
     uint64_t *b = (uint64_t *)buffer;
     uint64_t *e = b + width;
-- 
1.6.0.6



More information about the Pixman mailing list