summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-05-24 03:10:34 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-05-30 04:42:29 -0400
commitc2230fe2aff709de21cc2ee3fa27c3f7578e7f9d (patch)
tree17ca5a3fdadfefa349bd5508ee3a4f8851f6f727
parentc1065a9cb4ab1f5847b2373847c65d8ea68975f1 (diff)
Make use of image flags in mmx and sse2 iterators
Now that we have the full image flags available, the SSE2 and MMX iterators can simply check against SAMPLES_COVER_CLIP_NEAREST (which is computed in pixman_image_composite32()) instead of comparing all the x/y/width/height parameters.
-rw-r--r--pixman/pixman-mmx.c14
-rw-r--r--pixman/pixman-sse2.c14
2 files changed, 8 insertions, 20 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index cf3c4e4d..d869c04c 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3656,19 +3656,13 @@ static void
mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
{
pixman_image_t *image = iter->image;
- int x = iter->x;
- int y = iter->y;
- int width = iter->width;
- int height = iter->height;
#define FLAGS \
- (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | FAST_PATH_BITS_IMAGE)
+ (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | \
+ FAST_PATH_BITS_IMAGE | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST)
if ((iter->iter_flags & ITER_NARROW) &&
- (iter->image_flags & FLAGS) == FLAGS &&
- x >= 0 && y >= 0 &&
- x + width <= image->bits.width &&
- y + height <= image->bits.height)
+ (iter->image_flags & FLAGS) == FLAGS)
{
const fetcher_info_t *f;
@@ -3679,7 +3673,7 @@ mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
uint8_t *b = (uint8_t *)image->bits.bits;
int s = image->bits.rowstride * 4;
- iter->bits = b + s * iter->y + x * PIXMAN_FORMAT_BPP (f->format) / 8;
+ iter->bits = b + s * iter->y + iter->x * PIXMAN_FORMAT_BPP (f->format) / 8;
iter->stride = s;
iter->get_scanline = f->get_scanline;
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 111317d7..70f8b77c 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5976,19 +5976,13 @@ static void
sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
{
pixman_image_t *image = iter->image;
- int x = iter->x;
- int y = iter->y;
- int width = iter->width;
- int height = iter->height;
#define FLAGS \
- (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | FAST_PATH_BITS_IMAGE)
+ (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | \
+ FAST_PATH_BITS_IMAGE | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST)
if ((iter->iter_flags & ITER_NARROW) &&
- (iter->image_flags & FLAGS) == FLAGS &&
- x >= 0 && y >= 0 &&
- x + width <= image->bits.width &&
- y + height <= image->bits.height)
+ (iter->image_flags & FLAGS) == FLAGS)
{
const fetcher_info_t *f;
@@ -5999,7 +5993,7 @@ sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
uint8_t *b = (uint8_t *)image->bits.bits;
int s = image->bits.rowstride * 4;
- iter->bits = b + s * iter->y + x * PIXMAN_FORMAT_BPP (f->format) / 8;
+ iter->bits = b + s * iter->y + iter->x * PIXMAN_FORMAT_BPP (f->format) / 8;
iter->stride = s;
iter->get_scanline = f->get_scanline;