summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-12 02:11:12 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-11-17 00:42:21 -0500
commit542b79c30d88788028d391285aa8cd038e96f2b3 (patch)
treeb802ce9053227393e55e66a64476e25de11f7e07
parent12108ecbe488d1b65e6787585e1caa57af17a008 (diff)
Compute src_format outside the fast path loop.
Inside the loop all we have to do is check that the formats match.
-rw-r--r--pixman/pixman-utils.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index 74b59ea..1db1b37 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -506,9 +506,21 @@ get_fast_path (const pixman_fast_path_t *fast_paths,
pixman_image_t * dst_image,
pixman_bool_t is_pixbuf)
{
+ pixman_format_code_t src_format, mask_format;
const pixman_fast_path_t *info;
- pixman_format_code_t mask_format;
+ if (_pixman_image_is_solid (src_image))
+ {
+ src_format = PIXMAN_solid;
+ }
+ else if (src_image->type == BITS)
+ {
+ src_format = src_image->bits.format;
+ }
+ else
+ {
+ return NULL;
+ }
if (!mask_image)
{
@@ -548,22 +560,11 @@ get_fast_path (const pixman_fast_path_t *fast_paths,
for (info = fast_paths; info->op != PIXMAN_OP_NONE; info++)
{
- pixman_bool_t valid_src = FALSE;
-
if (info->op != op)
continue;
- if ((info->src_format == PIXMAN_solid &&
- _pixman_image_is_solid (src_image)) ||
- (src_image->type == BITS &&
- info->src_format == src_image->bits.format))
- {
- valid_src = TRUE;
- }
-
- if (!valid_src)
+ if (info->src_format != src_format)
continue;
-
if (info->mask_format != mask_format)
continue;
@@ -652,8 +653,7 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths,
if (has_fast_path)
{
- has_fast_path = (src->type == BITS || _pixman_image_is_solid (src)) &&
- !src->common.transform &&
+ has_fast_path = !src->common.transform &&
!src->common.alpha_map &&
src->common.filter != PIXMAN_FILTER_CONVOLUTION &&
src->common.repeat != PIXMAN_REPEAT_PAD &&
@@ -669,7 +669,6 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths,
if (mask && has_fast_path)
{
has_fast_path =
- mask->type == BITS &&
!mask->common.transform &&
!mask->common.alpha_map &&
!mask->bits.read_func &&