diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-12-12 07:34:42 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-01-18 12:42:26 -0500 |
commit | 7f4eabbeec92e55fd8f812c0e5d8568eacbb633d (patch) | |
tree | e8760aa48542c19b8f3ddc0d29e0dbcb4628ae2e | |
parent | 9489c2e04a5361fe19a89a0da9d7be28436c0a4b (diff) |
Fix destination fetching
When fetching from destinations, we need to ignore transformations,
repeat and filtering. Currently we don't ignore them, which means all
kinds of bad things can happen.
This bug fixes this problem by directly calling the scanline fetchers
for destinations instead of going through the full
get_scanline_32/64().
-rw-r--r-- | pixman/pixman-bits-image.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 8cabfdc2..98a2b6de 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -1377,8 +1377,22 @@ _pixman_bits_image_src_iter_init (pixman_image_t *image, static uint32_t * dest_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) { - iter->image->bits.get_scanline_32 ( - iter->image, iter->x, iter->y, iter->width, iter->buffer, mask); + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t * buffer = iter->buffer; + + image->bits.fetch_scanline_32 (image, x, y, width, buffer, mask); + if (image->common.alpha_map) + { + x -= image->common.alpha_origin_x; + y -= image->common.alpha_origin_y; + + image->common.alpha_map->fetch_scanline_32 ( + (pixman_image_t *)image->common.alpha_map, + x, y, width, buffer, mask); + } return iter->buffer; } @@ -1386,8 +1400,22 @@ dest_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) static uint32_t * dest_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) { - iter->image->bits.get_scanline_64 ( - iter->image, iter->x, iter->y, iter->width, iter->buffer, mask); + bits_image_t * image = &iter->image->bits; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t * buffer = iter->buffer; + + image->fetch_scanline_64 ( + (pixman_image_t *)image, x, y, width, buffer, mask); + if (image->common.alpha_map) + { + x -= image->common.alpha_origin_x; + y -= image->common.alpha_origin_y; + + image->common.alpha_map->fetch_scanline_64 ( + (pixman_image_t *)image->common.alpha_map, x, y, width, buffer, mask); + } return iter->buffer; } |