aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColorPriv.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-14 13:34:42 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-14 13:34:42 +0000
commitf70e917df73ab776c8869e6f9caa381a03e5f595 (patch)
treed3118e8f2e6de6e7e9710b5c0543a65b9e609ba6 /include/core/SkColorPriv.h
parentfc6dfbab7565bb02db50f38f21b2c7d6c8f61c5c (diff)
By default, Chromium optimizes for size when compiling on Android.
Forcing the SkAlphaMulQ() function inline can yield as much as a 5-10% improvement in rasterization time for some of Chromium's telemetry tests on the Nexus 10, since it's in the inner loop of complex blends. R=mtklein@google.com, reed@google.com, tomhudson@google.com Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/283753003 git-svn-id: http://skia.googlecode.com/svn/trunk@14723 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkColorPriv.h')
-rw-r--r--include/core/SkColorPriv.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h
index 8fd1e57fa7..21e17836dd 100644
--- a/include/core/SkColorPriv.h
+++ b/include/core/SkColorPriv.h
@@ -524,7 +524,9 @@ SkPMColor SkPremultiplyARGBInline(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
return SkPackARGB32(a, r, g, b);
}
-static inline uint32_t SkAlphaMulQ(uint32_t c, unsigned scale) {
+// When Android is compiled optimizing for size, SkAlphaMulQ doesn't get
+// inlined; forcing inlining significantly improves performance.
+static SK_ALWAYS_INLINE uint32_t SkAlphaMulQ(uint32_t c, unsigned scale) {
uint32_t mask = 0xFF00FF;
uint32_t rb = ((c & mask) * scale) >> 8;