summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-18 04:17:57 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-02-24 23:20:27 -0500
commit2a6ba862abd8859014d11a742247fa1f1225729b (patch)
tree1a8941fe6d1489845270ceec7fced48ac80c2f12
parent45006e5e648b85df65b922f893c9802c9ecce38e (diff)
Eliminate _pixman_image_is_solid()
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
-rw-r--r--pixman/pixman-image.c40
-rw-r--r--pixman/pixman-private.h3
2 files changed, 15 insertions, 28 deletions
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 89a5a09d..ff0fbbb5 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -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)
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index edee7388..1ad452a1 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -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);