Constify the mask argument to scanline fetchers.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Wed, 24 Jun 2009 01:28:28 +0000 (21:28 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Wed, 24 Jun 2009 16:37:47 +0000 (12:37 -0400)
pixman/pixman-bits-image.c
pixman/pixman-conical-gradient.c
pixman/pixman-image.c
pixman/pixman-linear-gradient.c
pixman/pixman-private.h
pixman/pixman-radial-gradient.c
pixman/pixman-solid-fill.c

index e267962..0c5f07c 100644 (file)
@@ -492,9 +492,9 @@ bits_image_fetch_filtered (bits_image_t *pict, uint32_t *buffer, int n_pixels)
 }
 
 static void
-bits_image_fetch_transformed (pixman_image_t * pict, int x, int y, int width,
-                             uint32_t *buffer, uint32_t *mask,
-                             uint32_t maskBits)
+bits_image_fetch_transformed (pixman_image_t * pict, int x, int y,
+                             int width, uint32_t *buffer,
+                             const uint32_t *mask, uint32_t maskBits)
 {
     uint32_t     *bits;
     int32_t    stride;
@@ -587,10 +587,9 @@ bits_image_fetch_transformed (pixman_image_t * pict, int x, int y, int width,
 }
 
 static void
-bits_image_fetch_solid_32 (pixman_image_t * image,
-                          int x, int y, int width,
-                          uint32_t *buffer,
-                          uint32_t *mask, uint32_t maskBits)
+bits_image_fetch_solid_32 (pixman_image_t * image, int x, int y,
+                          int width, uint32_t *buffer,
+                          const uint32_t *mask, uint32_t maskBits)
 {
     uint32_t color[2];
     uint32_t *end;
@@ -606,11 +605,9 @@ bits_image_fetch_solid_32 (pixman_image_t * image,
 }
 
 static void
-bits_image_fetch_solid_64 (pixman_image_t * image,
-                          int x, int y, int width,
-                          uint32_t *b,
-                          uint32_t *unused,
-                          uint32_t unused2)
+bits_image_fetch_solid_64 (pixman_image_t * image, int x, int y,
+                          int width, uint32_t *b,
+                          const uint32_t *unused, uint32_t unused2)
 {
     uint32_t color[2];
     uint32_t *coords = (uint32_t *)color;
@@ -701,10 +698,9 @@ bits_image_fetch_untransformed_repeat_normal (bits_image_t *image, pixman_bool_t
 }
 
 static void
-bits_image_fetch_untransformed_32 (pixman_image_t * image,
-                                  int x, int y, int width,
-                                  uint32_t *buffer,
-                                  uint32_t *mask, uint32_t maskBits)
+bits_image_fetch_untransformed_32 (pixman_image_t * image, int x, int y,
+                                  int width, uint32_t *buffer,
+                                  const uint32_t *mask, uint32_t maskBits)
 {
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
@@ -719,10 +715,9 @@ bits_image_fetch_untransformed_32 (pixman_image_t * image,
 }
 
 static void
-bits_image_fetch_untransformed_64 (pixman_image_t * image,
-                                  int x, int y, int width,
-                                  uint32_t *buffer,
-                                  uint32_t *unused, uint32_t unused2)
+bits_image_fetch_untransformed_64 (pixman_image_t * image, int x, int y,
+                                  int width, uint32_t *buffer,
+                                  const uint32_t *unused, uint32_t unused2)
 {
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
@@ -762,10 +757,8 @@ bits_image_property_changed (pixman_image_t *image)
             (bits->common.repeat == PIXMAN_REPEAT_NONE ||
              bits->common.repeat == PIXMAN_REPEAT_NORMAL))
     {
-       image->common.get_scanline_64 =
-           bits_image_fetch_untransformed_64;
-       image->common.get_scanline_32 =
-           bits_image_fetch_untransformed_32;
+       image->common.get_scanline_64 = bits_image_fetch_untransformed_64;
+       image->common.get_scanline_32 = bits_image_fetch_untransformed_32;
     }
     else
     {
index ea6744f..c73be56 100644 (file)
 #include "pixman-private.h"
 
 static void
-conical_gradient_get_scanline_32 (pixman_image_t *image,
-                                 int x, int y, int width,
-                                 uint32_t *buffer,
-                                 uint32_t *mask, uint32_t maskBits)
+conical_gradient_get_scanline_32 (pixman_image_t *image, int x, int y,
+                                 int width, uint32_t *buffer,
+                                 const uint32_t *mask, uint32_t maskBits)
 {
     source_image_t *source = (source_image_t *)image;
     gradient_t *gradient = (gradient_t *)source;
index 8793eca..32b83d3 100644 (file)
@@ -63,10 +63,9 @@ _pixman_init_gradient (gradient_t     *gradient,
  * depth, but that's a project for the future.
  */
 void
-_pixman_image_get_scanline_64_generic (pixman_image_t * pict,
-                                      int x, int y, int width,
-                                      uint32_t *buffer,
-                                      uint32_t *mask, uint32_t maskBits)
+_pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y,
+                                      int width, uint32_t *buffer,
+                                      const uint32_t *mask, uint32_t maskBits)
 {
     uint32_t *mask8 = NULL;
 
@@ -136,8 +135,8 @@ _pixman_image_classify (pixman_image_t *image,
 }
 
 void
-_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
-                              uint32_t *buffer, uint32_t *mask, uint32_t mask_bits)
+_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                              const uint32_t *mask, uint32_t mask_bits)
 {
     image->common.get_scanline_32 (image, x, y, width, buffer, mask, mask_bits);
 }
@@ -146,8 +145,8 @@ _pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
  * a uint64_t *buffer.
  */
 void
-_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width,
-                              uint32_t *buffer, uint32_t *unused, uint32_t unused2)
+_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                              const uint32_t *unused, uint32_t unused2)
 {
     image->common.get_scanline_64 (image, x, y, width, buffer, unused, unused2);
 }
index 3e76b4d..f01c62c 100644 (file)
@@ -88,8 +88,8 @@ linear_gradient_classify (pixman_image_t *image,
 }
 
 static void
-linear_gradient_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
-                                uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+linear_gradient_get_scanline_32 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                                const uint32_t *mask, uint32_t maskBits)
 {
     pixman_vector_t v, unit;
     pixman_fixed_32_32_t l;
index b62bfa2..cd5b97a 100644 (file)
@@ -39,7 +39,7 @@ typedef void     (*store_scanline_t)  (bits_image_t *image,
 
 typedef void     (*scanFetchProc)     (pixman_image_t *,
                                       int, int, int, uint32_t *,
-                                      uint32_t *, uint32_t);
+                                      const uint32_t *, uint32_t);
 
 typedef enum
 {
@@ -205,7 +205,7 @@ _pixman_image_get_scanline_64_generic  (pixman_image_t *pict,
                                        int             y,
                                        int             width,
                                        uint32_t       *buffer,
-                                       uint32_t       *mask,
+                                       const uint32_t *mask,
                                        uint32_t        maskBits);
 
 source_pict_class_t
@@ -216,17 +216,15 @@ _pixman_image_classify (pixman_image_t *image,
                        int             height);
 
 void
-_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
-                              uint32_t *buffer, uint32_t *mask,
-                              uint32_t mask_bits);
+_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                              const uint32_t *mask, uint32_t mask_bits);
 
 /* Even thought the type of buffer is uint32_t *, the function actually expects
  * a uint64_t *buffer.
  */
 void
-_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width,
-                              uint32_t *buffer,
-                              uint32_t *unused, uint32_t unused2);
+_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                              const uint32_t *unused, uint32_t unused2);
 
 void
 _pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
index 80ac64d..00fdae0 100644 (file)
@@ -32,8 +32,8 @@
 #include "pixman-private.h"
 
 static void
-radial_gradient_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
-                                uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+radial_gradient_get_scanline_32 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                                const uint32_t *mask, uint32_t maskBits)
 {
     /*
      * In the radial gradient problem we are given two circles (c₁,r₁) and
index 284b6d3..0801267 100644 (file)
@@ -25,8 +25,8 @@
 #include "pixman-private.h"
 
 static void
-solid_fill_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
-                           uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+solid_fill_get_scanline_32 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer,
+                           const uint32_t *mask, uint32_t maskBits)
 {
     uint32_t *end = buffer + width;
     register uint32_t color = ((solid_fill_t *)image)->color;