From: Søren Sandmann Pedersen Date: Wed, 24 Jun 2009 15:28:03 +0000 (-0400) Subject: Fix offset bug in pixman_run_fast_path(). X-Git-Tag: 1.0_branch~946 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=895a8da63370635b05ffb91d3d670c6627d8b2ab;p=profile%2Fivi%2Fpixman.git Fix offset bug in pixman_run_fast_path(). Fast paths should only run when the source images complete cover the composite region, because otherwise they would be required to sample the border, and fast paths generally don't know how to do that. The check for this did not work right because it didn't take the offset generated by the composite coordinates into account. This commits fixes that by adding (x, y) coordinates to image cover indicating the new position of the source in destination coordinates. Based on this we now compare against the region extents which are already in destination coordinates. --- diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c index 497e8c9..188cde8 100644 --- a/pixman/pixman-utils.c +++ b/pixman/pixman-utils.c @@ -567,13 +567,13 @@ get_fast_path (const pixman_fast_path_t *fast_paths, } static inline pixman_bool_t -image_covers (pixman_image_t *image, pixman_box32_t *extents) +image_covers (pixman_image_t *image, pixman_box32_t *extents, int x, int y) { if (image->common.type == BITS && image->common.repeat == PIXMAN_REPEAT_NONE) { - if (extents->x1 < 0 || extents->y1 < 0 || - extents->x2 >= image->bits.width || - extents->y2 >= image->bits.height) + if (x > extents->x1 || y > extents->y1 || + x + image->bits.width < extents->x2 || + y + image->bits.height < extents->y2) { return FALSE; } @@ -674,9 +674,9 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths, ®ion, src, mask, dest, src_x, src_y, mask_x, mask_y, dest_x, dest_y, width, height)) { pixman_box32_t *extents = pixman_region32_extents (®ion); - - if (image_covers (src, extents) && - (!mask || image_covers (mask, extents))) + + if (image_covers (src, extents, dest_x - src_x, dest_y - src_y) && + (!mask || image_covers (mask, extents, dest_x - mask_x, dest_y - mask_y))) { walk_region_internal (imp, op, src, mask, dest,