Eliminate _pixman_image_is_solid()
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 18 Sep 2009 08:17:57 +0000 (04:17 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 25 Feb 2010 04:20:27 +0000 (23:20 -0500)
Instead of calling this function in compute_image_info(), just do the
relevant checks when the extended format is computed.

Move computation of solidness to validate

pixman/pixman-image.c
pixman/pixman-private.h

index 89a5a09..ff0fbbb 100644 (file)
@@ -295,18 +295,27 @@ compute_image_info (pixman_image_t *image)
     else
        flags |= FAST_PATH_UNIFIED_ALPHA;
 
-    if (_pixman_image_is_solid (image))
+    if (image->type == SOLID)
     {
        code = PIXMAN_solid;
     }
     else if (image->common.type == BITS)
     {
-       code = image->bits.format;
-
-       if (!image->common.transform &&
-           image->common.repeat == PIXMAN_REPEAT_NORMAL)
+       if (image->bits.width == 1      &&
+           image->bits.height == 1     &&
+           image->common.repeat != PIXMAN_REPEAT_NONE)
+       {
+           code = PIXMAN_solid;
+       }
+       else
        {
-           flags |= FAST_PATH_SIMPLE_REPEAT;
+           code = image->bits.format;
+
+           if (!image->common.transform &&
+               image->common.repeat == PIXMAN_REPEAT_NORMAL)
+           {
+               flags |= FAST_PATH_SIMPLE_REPEAT;
+           }
        }
     }
     else
@@ -600,25 +609,6 @@ pixman_image_get_depth (pixman_image_t *image)
     return 0;
 }
 
-pixman_bool_t
-_pixman_image_is_solid (pixman_image_t *image)
-{
-    if (image->type == SOLID)
-       return TRUE;
-
-    if (image->type != BITS     ||
-        image->bits.width != 1  ||
-        image->bits.height != 1)
-    {
-       return FALSE;
-    }
-
-    if (image->common.repeat == PIXMAN_REPEAT_NONE)
-       return FALSE;
-
-    return TRUE;
-}
-
 uint32_t
 _pixman_image_get_solid (pixman_image_t *     image,
                          pixman_format_code_t format)
index edee738..1ad452a 100644 (file)
@@ -287,9 +287,6 @@ _pixman_image_validate (pixman_image_t *image);
 pixman_bool_t
 _pixman_image_is_opaque (pixman_image_t *image);
 
-pixman_bool_t
-_pixman_image_is_solid (pixman_image_t *image);
-
 uint32_t
 _pixman_image_get_solid (pixman_image_t *     image,
                          pixman_format_code_t format);