From 262ed8d7377738165aa85a8c343376b2e3e43ca5 Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Thu, 25 Feb 2010 00:51:42 -0500 Subject: Change the image_cover() function to take dest->src deltas. Then, in image_covers(), translate the extents box into source coordinates and check whether it is contained within the image. Previously, image_covers() would translate the image bounding box into destination coordinates and then check those against the extents. It's just a sign change in preparation for making the function deal with transformations too. --- pixman/pixman.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pixman/pixman.c b/pixman/pixman.c index 7ac8fcd4..07659d34 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -477,15 +477,14 @@ walk_region_internal (pixman_implementation_t *imp, static force_inline pixman_bool_t image_covers (pixman_image_t *image, pixman_box32_t *extents, - int x, - int y) + int dx, + int dy) { if (image->common.type == BITS && image->common.repeat == PIXMAN_REPEAT_NONE) { - if (x > extents->x1 || y > extents->y1 || - x + image->bits.width < extents->x2 || - y + image->bits.height < extents->y2) + if (extents->x1 + dx < 0 || extents->x2 + dx > image->bits.width || + extents->y1 + dy < 0 || extents->y2 + dy > image->bits.height) { return FALSE; } @@ -672,10 +671,10 @@ do_composite (pixman_implementation_t *imp, extents = pixman_region32_extents (®ion); - if (image_covers (src, extents, dest_x - src_x, dest_y - src_y)) + if (image_covers (src, extents, src_x - dest_x, src_y - dest_y)) src_flags |= FAST_PATH_COVERS_CLIP; - if (mask && image_covers (mask, extents, dest_x - mask_x, dest_y - mask_y)) + if (mask && image_covers (mask, extents, mask_x - dest_x, mask_y - dest_y)) mask_flags |= FAST_PATH_COVERS_CLIP; /* -- cgit v1.2.3