diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-12-11 08:10:04 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-01-18 12:42:26 -0500 |
commit | fffeda703e40ced90ec5ad6d6cd37a44294d3fe4 (patch) | |
tree | ab30f84269072f8104468d01fab86991c697bb89 /pixman/pixman-bits-image.c | |
parent | 3e635d6491d883304662aff3c72558dc9065f1f1 (diff) |
Skip fetching pixels when possible
Add two new iterator flags, ITER_IGNORE_ALPHA and ITER_IGNORE_RGB that
are set when the alpha and rgb values are not needed. If both are set,
then we can skip fetching entirely and just use
_pixman_iter_get_scanline_noop.
Diffstat (limited to 'pixman/pixman-bits-image.c')
-rw-r--r-- | pixman/pixman-bits-image.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 8d4e4f5..8cabfdc 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -1466,7 +1466,16 @@ _pixman_bits_image_dest_iter_init (pixman_image_t *image, } else { - iter->get_scanline = dest_get_scanline_narrow; + if ((flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) == + (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) + { + iter->get_scanline = _pixman_iter_get_scanline_noop; + } + else + { + iter->get_scanline = dest_get_scanline_narrow; + } + iter->write_back = dest_write_back_narrow; } } |