diff options
author | Mike Reed <reed@google.com> | 2017-05-05 09:25:08 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-05 14:24:28 +0000 |
commit | e12c69e78db3b6451c42e36524ae9e87f75f24fc (patch) | |
tree | dd08f6e4f7f705a3771305e6c3a95d972a63cb16 /src/utils/SkShadowUtils.cpp | |
parent | ce78bad054060c5fac3bd216ee437f6fe34df8b7 (diff) |
optimize gaussian with herbs quartic
Bug: skia:
Change-Id: Ia06ad1023129dfcade3f648087b2070eab29b4b2
Reviewed-on: https://skia-review.googlesource.com/15523
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/utils/SkShadowUtils.cpp')
-rw-r--r-- | src/utils/SkShadowUtils.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utils/SkShadowUtils.cpp b/src/utils/SkShadowUtils.cpp index ebd27e02b9..159b2e7859 100644 --- a/src/utils/SkShadowUtils.cpp +++ b/src/utils/SkShadowUtils.cpp @@ -56,8 +56,11 @@ private: }; static inline float eval_gaussian(float x) { - float factor = 1 - x; - return sk_float_exp(-factor * factor * 4) - 0.018f; + x = 1 - x; +// return sk_float_exp(-x * x * 4) - 0.018f; + return 1 + x*(-0.209218561649322509765625f + + x*(-4.692357540130615234375f + + x*(6.168495655059814453125f + x*(-2.2666122913360595703125f)))); } static void build_table() { |