diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-02-25 00:51:42 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-03-14 12:59:38 -0400 |
commit | 262ed8d7377738165aa85a8c343376b2e3e43ca5 (patch) | |
tree | 1990ddaf457de197f01145f146f82349eb587ec0 | |
parent | a0f127692f5a4379caa88383819e5340829cb0af (diff) |
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.
-rw-r--r-- | pixman/pixman.c | 13 |
1 files 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; /* |