From: Søren Sandmann Pedersen Date: Thu, 24 May 2012 07:10:34 +0000 (-0400) Subject: Make use of image flags in mmx and sse2 iterators X-Git-Tag: 1.0_branch~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fupstream;p=profile%2Fivi%2Fpixman.git 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. --- diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index cf3c4e4..d869c04 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 111317d..70f8b77 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;