Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: src/core/SkBlitter_RGB16.cpp

Issue 1213723002: Optimize RGB16 blitV functions with NEON for ARM platform. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Adding AUTHORS Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | src/opts/SkBlitMask_opts_arm_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_RGB16.cpp
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index 6724b12ace423493cbb02871dc3c3307783439fa..8caf90831231fdcc61cd6c166e193a9eab1ee281 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -22,6 +22,11 @@ extern void blitmask_d565_opaque_mips(int width, int height, uint16_t* device,
#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
#include <arm_neon.h>
+extern void SkRGB16BlitterBlitV_neon(uint16_t* device,
+ int height,
+ size_t deviceRB,
+ unsigned scale,
+ uint32_t src32);
#else
// if we don't have neon, then our black blitter is worth the extra code
#define USE_BLACK_BLITTER
@@ -484,11 +489,15 @@ void SkRGB16_Opaque_Blitter::blitV(int x, int y, int height, SkAlpha alpha) {
unsigned scale5 = SkAlpha255To256(alpha) >> 3;
uint32_t src32 = fExpandedRaw16 * scale5;
scale5 = 32 - scale5;
+#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ SkRGB16BlitterBlitV_neon(device, height, deviceRB, scale5, src32);
+#else
do {
uint32_t dst32 = SkExpand_rgb_16(*device) * scale5;
*device = SkCompact_rgb_16((src32 + dst32) >> 5);
device = (uint16_t*)((char*)device + deviceRB);
} while (--height != 0);
+#endif
}
void SkRGB16_Opaque_Blitter::blitRect(int x, int y, int width, int height) {
@@ -659,11 +668,15 @@ void SkRGB16_Blitter::blitV(int x, int y, int height, SkAlpha alpha) {
unsigned scale5 = SkAlpha255To256(alpha) * fScale >> (8 + 3);
uint32_t src32 = fExpandedRaw16 * scale5;
scale5 = 32 - scale5;
+#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ SkRGB16BlitterBlitV_neon(device, height, deviceRB, scale5, src32);
+#else
do {
uint32_t dst32 = SkExpand_rgb_16(*device) * scale5;
*device = SkCompact_rgb_16((src32 + dst32) >> 5);
device = (uint16_t*)((char*)device + deviceRB);
} while (--height != 0);
+#endif
}
void SkRGB16_Blitter::blitRect(int x, int y, int width, int height) {
« no previous file with comments | « AUTHORS ('k') | src/opts/SkBlitMask_opts_arm_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698