diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2015-08-25 17:54:38 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2015-08-25 18:35:57 +0300 |
commit | 42e7d76864c79ebd02da883632e055822319bece (patch) | |
tree | 9f0fa02aa685a41a46ac50dbe616f287d9b589fa | |
parent | f8bb81f65d5f9be3c148b6f69cc70f8e3d94943e (diff) |
vmx: implement fast path vmx_composite_over_n_8888implement_vmx_fastpaths
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r-- | pixman/pixman-vmx.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c index 23bee2f..7fbef83 100644 --- a/pixman/pixman-vmx.c +++ b/pixman/pixman-vmx.c @@ -3164,6 +3164,75 @@ vmx_composite_src_x888_8888 (pixman_implementation_t *imp, } static void +vmx_composite_over_n_8888 (pixman_implementation_t *imp, + pixman_composite_info_t *info) +{ + PIXMAN_COMPOSITE_ARGS (info); + uint32_t src; + uint32_t *dst_line, *dst, d; + int32_t w; + int dst_stride; + vector unsigned int vmx_src, vmx_alpha; + vector unsigned int vmx_dst, vmx_dst_lo, vmx_dst_hi; + + src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format); + + if (src == 0) + return; + + PIXMAN_IMAGE_GET_LINE ( + dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1); + + vmx_src = expand_pixel_32_1x128 (src); + vmx_alpha = expand_alpha_1x128 (vmx_src); + + while (height--) + { + dst = dst_line; + + dst_line += dst_stride; + w = width; + + while (w && (uintptr_t)dst & 15) + { + d = *dst; + *dst++ = pack_1x128_32 (over (vmx_src, + vmx_alpha, + unpack_32_1x128 (d))); + w--; + } + + while (w >= 4) + { + vmx_dst = load_128_aligned(dst); + + unpack_128_2x128 (vmx_dst, (vector unsigned int) AVV(0), + &vmx_dst_lo, &vmx_dst_hi); + + over_2x128 (&vmx_src, &vmx_src, + &vmx_alpha, &vmx_alpha, + &vmx_dst_lo, &vmx_dst_hi); + + /* rebuild the 4 pixel data and save*/ + save_128_aligned (dst, pack_2x128_128 (vmx_dst_lo, vmx_dst_hi)); + + w -= 4; + dst += 4; + } + + while (w) + { + d = *dst; + *dst++ = pack_1x128_32 (over (vmx_src, + vmx_alpha, + unpack_32_1x128 (d))); + w--; + } + + } +} + +static void vmx_composite_over_8888_8888 (pixman_implementation_t *imp, pixman_composite_info_t *info) { @@ -3499,6 +3568,8 @@ FAST_NEAREST_MAINLOOP (vmx_8888_8888_normal_OVER, static const pixman_fast_path_t vmx_fast_paths[] = { /* PIXMAN_OP_OVER */ + PIXMAN_STD_FAST_PATH (OVER, solid, null, a8r8g8b8, vmx_composite_over_n_8888), + PIXMAN_STD_FAST_PATH (OVER, solid, null, x8r8g8b8, vmx_composite_over_n_8888), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, vmx_composite_over_8888_8888), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, x8r8g8b8, vmx_composite_over_8888_8888), PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, vmx_composite_over_8888_8888), |