aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColorPriv.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-09-15 10:20:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-15 10:20:55 -0700
commit30c4cae7d3a26252e7e45adf6e5722b34adf6848 (patch)
tree51e48fb3326a2a4a76a762d932069357e3b7c56f /include/core/SkColorPriv.h
parentde5973b05be6ecc80309cded8541f9c305135d15 (diff)
Add special case circle blur for Ganesh
This makes the blurcircles bench go from ~33us to ~8us on Windows desktop. It will require layout test suppressions Review URL: https://codereview.chromium.org/1311583005
Diffstat (limited to 'include/core/SkColorPriv.h')
-rw-r--r--include/core/SkColorPriv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h
index 3dec49b73e..6347660dbc 100644
--- a/include/core/SkColorPriv.h
+++ b/include/core/SkColorPriv.h
@@ -218,6 +218,16 @@ static inline int SkAlphaBlend255(S16CPU src, S16CPU dst, U8CPU alpha) {
return dst + prod;
}
+static inline U8CPU SkUnitScalarClampToByte(SkScalar x) {
+ if (x < 0) {
+ return 0;
+ }
+ if (x >= SK_Scalar1) {
+ return 255;
+ }
+ return SkScalarToFixed(x) >> 8;
+}
+
#define SK_R16_BITS 5
#define SK_G16_BITS 6
#define SK_B16_BITS 5