From: Søren Sandmann Pedersen Date: Sat, 12 Sep 2009 06:11:12 +0000 (-0400) Subject: Compute src_format outside the fast path loop. X-Git-Tag: pixman-0.17.2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=542b79c30d88788028d391285aa8cd038e96f2b3;p=platform%2Fupstream%2Fpixman.git Compute src_format outside the fast path loop. Inside the loop all we have to do is check that the formats match. --- 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 &&