diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-06-27 19:29:13 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-06-27 19:36:26 -0400 |
commit | eaa6f0f7fd181acdbaad1dfe084ec372ce0ec450 (patch) | |
tree | d5ec53dee29b326c41132e620d7bc5a51502e1e1 | |
parent | 7553a1070a7a7fc1671e25d60b342a5c5e96e263 (diff) |
tiled repeatsimple-repeat
-rw-r--r-- | pixman/pixman-fast-path.c | 74 | ||||
-rw-r--r-- | pixman/pixman-image.c | 2 | ||||
-rw-r--r-- | pixman/pixman-private.h | 1 | ||||
-rw-r--r-- | pixman/pixman-sse2.c | 3 |
4 files changed, 80 insertions, 0 deletions
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 3c05383f..073f71ff 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -1188,6 +1188,70 @@ FAST_NEAREST (8888_565_none, 8888, 0565, uint32_t, uint16_t, OVER, NONE) FAST_NEAREST (8888_565_pad, 8888, 0565, uint32_t, uint16_t, OVER, PAD) FAST_NEAREST (8888_565_normal, 8888, 0565, uint32_t, uint16_t, OVER, NORMAL) +static void +fast_composite_tiled_repeat (pixman_implementation_t *imp, + pixman_composite_info_t *info) +{ + uint32_t src_flags = (info->src_flags & ~FAST_PATH_NORMAL_REPEAT) | FAST_PATH_SAMPLES_COVER_CLIP; + pixman_composite_func_t func; + pixman_image_t *src = info->src_image; + pixman_image_t *dest = info->dest_image; + + if (_pixman_lookup_composite_function ( + imp->toplevel, info->op, + src->common.extended_format_code, src_flags, + PIXMAN_null, 0, + dest->common.extended_format_code, info->dest_flags, + &imp, &func)) + { + int w, h; + int src_dx = info->src_x - info->dest_x; + int src_dy = info->src_y - info->dest_y; + pixman_composite_info_t info2; + + info2 = *info; + + h = info->height; + + info2.src_y = info2.dest_y + src_dy; + + while (h) + { + info2.height = h; + info2.src_y = MOD (info2.src_y, src->bits.height); + if (info2.height > src->bits.height - info2.src_y) + info2.height = src->bits.height - info2.src_y; + + info2.src_x = info2.dest_x + src_dx; + + w = info->width; + while (w) + { + info2.width = w; + info2.src_x = MOD (info2.src_x, src->bits.width); + if (info2.width > src->bits.width - info2.src_x) + info2.width = src->bits.width - info2.src_x; + + func (imp, &info2); + + w -= info2.width; + info2.src_x += info2.width; + info2.dest_x += info2.width; + } + + h -= info2.height; + info2.src_y += info2.height; + info2.dest_y += info2.height; + + info2.dest_x = info->dest_x; + } + } + else + { + _pixman_log_error (FUNC, "Didn't find a suitable function "); + } +} + /* Use more unrolling for src_0565_0565 because it is typically CPU bound */ static force_inline void scaled_nearest_scanline_565_565_SRC (uint16_t * dst, @@ -1777,6 +1841,16 @@ static const pixman_fast_path_t c_fast_paths[] = SIMPLE_ROTATE_FAST_PATH (SRC, r5g6b5, r5g6b5, 565), SIMPLE_ROTATE_FAST_PATH (SRC, a8, a8, 8), + { PIXMAN_OP_any, + PIXMAN_any, + (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | FAST_PATH_BITS_IMAGE | + FAST_PATH_NORMAL_REPEAT), + PIXMAN_null, 0, + PIXMAN_any, + FAST_PATH_STD_DEST_FLAGS, + fast_composite_tiled_repeat + }, + { PIXMAN_OP_NONE }, }; diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 84bacf87..09a9ba30 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -320,6 +320,8 @@ compute_image_info (pixman_image_t *image) else { code = image->bits.format; + + flags |= FAST_PATH_BITS_IMAGE; } if (!PIXMAN_FORMAT_A (image->bits.format) && diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 12b02e52..fadec498 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -621,6 +621,7 @@ _pixman_iter_get_scanline_noop (pixman_iter_t *iter, const uint32_t *mask); #define FAST_PATH_ROTATE_90_TRANSFORM (1 << 21) #define FAST_PATH_ROTATE_180_TRANSFORM (1 << 22) #define FAST_PATH_ROTATE_270_TRANSFORM (1 << 23) +#define FAST_PATH_BITS_IMAGE (1 << 24) #define FAST_PATH_PAD_REPEAT \ (FAST_PATH_NO_NONE_REPEAT | \ diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 79ef6880..10258406 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c @@ -5403,6 +5403,9 @@ static const pixman_fast_path_t sse2_fast_paths[] = PIXMAN_STD_FAST_PATH (OVER, solid, null, a8r8g8b8, sse2_composite_over_n_8888), PIXMAN_STD_FAST_PATH (OVER, solid, null, x8r8g8b8, sse2_composite_over_n_8888), PIXMAN_STD_FAST_PATH (OVER, solid, null, r5g6b5, sse2_composite_over_n_0565), + PIXMAN_STD_FAST_PATH (OVER, solid, null, a8b8g8r8, sse2_composite_over_n_8888), + PIXMAN_STD_FAST_PATH (OVER, solid, null, x8b8g8r8, sse2_composite_over_n_8888), + PIXMAN_STD_FAST_PATH (OVER, solid, null, b5g6r5, sse2_composite_over_n_0565), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, sse2_composite_over_8888_8888), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, x8r8g8b8, sse2_composite_over_8888_8888), PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, sse2_composite_over_8888_8888), |