aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMaskBlurFilter.h
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2017-08-15 14:38:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-15 18:55:59 +0000
commit15bb26ec70c9df6dbfc259918d9d9b0d8b2fcccc (patch)
treec08058708c97ba205d5f61514549a094682e8e9e /src/core/SkMaskBlurFilter.h
parent8d4b56b3f566dbe3963029fe85356fd9bb014fb3 (diff)
Add an average mode for sigma < 2
The original code had an optimization when sigma < 2 that averaged pixels instead of Gaussian bluring them. This CL adds that behavior back to the new implementation. Add the flag SK_LEGACY_USE_GAUSS_FOR_SMALL_RADII to control the new behavior. BUG=chromium:745290 Change-Id: I6e7417ce7f42949f88376b549743a9f047667f09 Reviewed-on: https://skia-review.googlesource.com/34624 Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkMaskBlurFilter.h')
-rw-r--r--src/core/SkMaskBlurFilter.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/SkMaskBlurFilter.h b/src/core/SkMaskBlurFilter.h
index c530488efb..000d9493a0 100644
--- a/src/core/SkMaskBlurFilter.h
+++ b/src/core/SkMaskBlurFilter.h
@@ -37,8 +37,13 @@ public:
// A factor used to simulate division using multiplication and shift.
uint64_t scaledWeight() const;
+ // Returned when sigma < 2.
+ bool isSmall() const;
+
private:
+ const bool fIsSmall;
const uint32_t fFilterWindow;
+ const uint64_t fWeight;
const uint64_t fScaledWeight;
};
@@ -59,6 +64,14 @@ private:
const uint8_t* src, size_t srcStride, const uint8_t* srcEnd,
uint8_t* dst, size_t dstStride, uint8_t* dstEnd) const;
+ void blurOneScanBox(FilterInfo gen,
+ const uint8_t* src, size_t srcStride, const uint8_t* srcEnd,
+ uint8_t* dst, size_t dstStride, uint8_t* dstEnd) const;
+
+ void blurOneScanGauss(FilterInfo gen,
+ const uint8_t* src, size_t srcStride, const uint8_t* srcEnd,
+ uint8_t* dst, size_t dstStride, uint8_t* dstEnd) const;
+
const FilterInfo fInfoW,
fInfoH;