aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts/SkOpts_neon.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-01-13 14:31:59 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-13 14:31:59 -0800
commit3a24f459582f2665f0e66bd35a0d8f46a1c4c72f (patch)
tree5faea85984dc8be63ebbd79e9b9c6ed346177efc /src/opts/SkOpts_neon.cpp
parent06d54ad09a03edd62d597b2ba67ad3c05944fd92 (diff)
Optimized premultiplying swizzles for NEON
Improves decode performance for RGBA encoded PNGs. Swizzle Time on Nexus 9 (with clang): SwapPremul 0.44x Premul 0.44x Decode Time On Nexus 9 (with clang): ZeroInit Decodes 0.85x Regular Decodes 0.86x Swizzle Time on Nexus 6P (with clang) SwapPremul 0.14x Premul 0.14x Decode Time On Nexus 6P (with clang): ZeroInit Decodes 0.93x Regular Decodes 0.95x Notes: ZeroInit means memory is zero initialized, and we do not write to memory for large sections of zero pixels (memory use opt for Android). A profile on Nexus 9 shows that the premultiplication step of PNG decoding is now ~5% of decode time (down from ~20%). BUG=skia:4767 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577703006 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1577703006
Diffstat (limited to 'src/opts/SkOpts_neon.cpp')
-rw-r--r--src/opts/SkOpts_neon.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opts/SkOpts_neon.cpp b/src/opts/SkOpts_neon.cpp
index a0388b0654..3a07ebb765 100644
--- a/src/opts/SkOpts_neon.cpp
+++ b/src/opts/SkOpts_neon.cpp
@@ -15,6 +15,7 @@
#include "SkFloatingPoint_opts.h"
#include "SkMatrix_opts.h"
#include "SkMorphologyImageFilter_opts.h"
+#include "SkSwizzler_opts.h"
#include "SkTextureCompressor_opts.h"
#include "SkUtils_opts.h"
#include "SkXfermode_opts.h"
@@ -47,5 +48,9 @@ namespace SkOpts {
matrix_translate = sk_neon::matrix_translate;
matrix_scale_translate = sk_neon::matrix_scale_translate;
matrix_affine = sk_neon::matrix_affine;
+
+ premul_xxxa = sk_neon::premul_xxxa;
+ premul_swaprb_xxxa = sk_neon::premul_swaprb_xxxa;
+ swaprb_xxxa = sk_neon::swaprb_xxxa;
}
}