Index: src/opts/SkColor_opts_neon.h |
diff --git a/src/opts/SkColor_opts_neon.h b/src/opts/SkColor_opts_neon.h |
index f81239712ab5bba90fb21b6896f7edbb4e658044..9f25b312dbd5a3393f92417a193c9cd009186656 100644 |
--- a/src/opts/SkColor_opts_neon.h |
+++ b/src/opts/SkColor_opts_neon.h |
@@ -2,6 +2,7 @@ |
#define SkColor_opts_neon_DEFINED |
#include "SkTypes.h" |
+#include "SkColorPriv.h" |
djsollen
2013/11/11 17:21:46
why do you need this include?
kevin.petit.not.used.account
2013/11/11 18:10:34
This is here to fix a pre-existing mistake. There
|
#include <arm_neon.h> |
@@ -65,4 +66,17 @@ static inline uint16x8_t SkPixel32ToPixel16_neon8(uint8x8x4_t vsrc) { |
return ret; |
} |
+static inline uint8x8_t SkBlend32_neon8(uint8x8_t src, uint8x8_t dst, uint16x8_t scale) { |
mtklein
2013/11/11 17:17:04
Add a brief comment like for 16->32 and 32->16 abo
kevin.petit.not.used.account
2013/11/11 18:10:34
Done.
|
+ int16x8_t src_wide, dst_wide; |
+ |
+ src_wide = vreinterpretq_s16_u16(vmovl_u8(src)); |
+ dst_wide = vreinterpretq_s16_u16(vmovl_u8(dst)); |
+ |
+ src_wide = (src_wide - dst_wide) * vreinterpretq_s16_u16(scale); |
+ |
+ dst_wide += vshrq_n_s16(src_wide, 5); |
+ |
+ return vmovn_u16(vreinterpretq_u16_s16(dst_wide)); |
+} |
+ |
#endif /* #ifndef SkColor_opts_neon_DEFINED */ |