aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Herbert Derby <herb@google.com>2017-10-20 14:53:45 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-16 18:06:22 +0000
commit5e18cdea0a0a3f23d8e8b8140c82a4b54e121402 (patch)
tree20df99a3ea7ed5cb80eac3fcb0438b167cf028ec /bench
parent3b2f5b60ff9a82ade01746d7e7cbbcc9348d6c03 (diff)
Direct evaluation of gaussian
The SVG(CSS) standard allows the 3 pass algorithm for sigma >= 2. But sigma < 2, the code must evaluate to the convolution. The old code used an interpolation scheme between windowed filters. This code directly evaluates the gaussian kernel for sigma < 2. This code produces cleaner results, is 25% faster, and does not use a temporary memory buffer. Change-Id: Ibd0caa73cadd06b637f55ba7bd4fefcfe7ac73db Reviewed-on: https://skia-review.googlesource.com/62540 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/BlurBench.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp
index 20afd4a2e5..5b94d66ff6 100644
--- a/bench/BlurBench.cpp
+++ b/bench/BlurBench.cpp
@@ -15,9 +15,11 @@
#define MINI 0.01f
#define SMALL SkIntToScalar(2)
-#define REAL 1.5f
+#define REAL 0.5f
#define BIG SkIntToScalar(10)
#define REALBIG 100.5f
+// The value that produces a sigma of just over 2.
+#define CUTOVER 2.6f
static const char* gStyleName[] = {
"normal",
@@ -111,5 +113,6 @@ DEF_BENCH(return new BlurBench(BIG, kNormal_SkBlurStyle, SkBlurMaskFilter::kHigh
DEF_BENCH(return new BlurBench(REALBIG, kNormal_SkBlurStyle, SkBlurMaskFilter::kHighQuality_BlurFlag);)
DEF_BENCH(return new BlurBench(REAL, kNormal_SkBlurStyle, SkBlurMaskFilter::kHighQuality_BlurFlag);)
+DEF_BENCH(return new BlurBench(CUTOVER, kNormal_SkBlurStyle, SkBlurMaskFilter::kHighQuality_BlurFlag);)
DEF_BENCH(return new BlurBench(0, kNormal_SkBlurStyle);)