From 2a6ba862abd8859014d11a742247fa1f1225729b Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Fri, 18 Sep 2009 04:17:57 -0400 Subject: 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 --- pixman/pixman-image.c | 40 +++++++++++++++------------------------- pixman/pixman-private.h | 3 --- 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); -- cgit v1.2.3