From dcfade3df96559ce942df5d16b7915c94f7d9e57 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Wed, 4 Nov 2009 15:29:27 +0200 Subject: [PATCH] ARM: enabled new implementation for pixman_fill_neon --- pixman/pixman-arm-neon.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c index 9052061..494f06c 100644 --- a/pixman/pixman-arm-neon.c +++ b/pixman/pixman-arm-neon.c @@ -33,6 +33,27 @@ #include #include "pixman-private.h" +void +pixman_composite_src_n_8_asm_neon (int32_t w, + int32_t h, + uint8_t *dst, + int32_t dst_stride, + uint8_t src); + +void +pixman_composite_src_n_0565_asm_neon (int32_t w, + int32_t h, + uint16_t *dst, + int32_t dst_stride, + uint16_t src); + +void +pixman_composite_src_n_8888_asm_neon (int32_t w, + int32_t h, + uint32_t *dst, + int32_t dst_stride, + uint32_t src); + static pixman_bool_t pixman_fill_neon (uint32_t *bits, int stride, @@ -43,7 +64,38 @@ pixman_fill_neon (uint32_t *bits, int height, uint32_t _xor) { - return FALSE; + /* stride is always multiple of 32bit units in pixman */ + uint32_t byte_stride = stride * sizeof(uint32_t); + + switch (bpp) + { + case 8: + pixman_composite_src_n_8_asm_neon ( + width, + height, + (uint8_t *)(((char *) bits) + y * byte_stride + x), + byte_stride, + _xor & 0xff); + return TRUE; + case 16: + pixman_composite_src_n_0565_asm_neon ( + width, + height, + (uint16_t *)(((char *) bits) + y * byte_stride + x * 2), + byte_stride / 2, + _xor & 0xffff); + return TRUE; + case 32: + pixman_composite_src_n_8888_asm_neon ( + width, + height, + (uint32_t *)(((char *) bits) + y * byte_stride + x * 4), + byte_stride / 4, + _xor); + return TRUE; + default: + return FALSE; + } } static const pixman_fast_path_t arm_neon_fast_path_array[] = -- 2.7.4