diff options
author | Mike Reed <reed@google.com> | 2017-07-21 12:23:12 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-21 16:47:23 +0000 |
commit | a7ba6e7fcc9a9774bee6c5613efa662c311d04ef (patch) | |
tree | df7db93c09570753e0a3fc992179e5161cd5ca34 /src/core/SkMaskBlurFilter.cpp | |
parent | 65e4c614f0edbcf8d05bfc2a25a6e60d277fb7df (diff) |
Revert "Revert "check for no blur and exit early""
This reverts commit 8825a09fc88f46dcec1d547dfbe7457ea224790b.
Bug: skia:
Change-Id: I01df7bf9e398012b5320655da3cab306256e31fb
Reviewed-on: https://skia-review.googlesource.com/25740
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkMaskBlurFilter.cpp')
-rw-r--r-- | src/core/SkMaskBlurFilter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkMaskBlurFilter.cpp b/src/core/SkMaskBlurFilter.cpp index 0f0286354c..42837f79a9 100644 --- a/src/core/SkMaskBlurFilter.cpp +++ b/src/core/SkMaskBlurFilter.cpp @@ -70,6 +70,10 @@ SkMaskBlurFilter::SkMaskBlurFilter(double sigmaW, double sigmaH) , fBuffer2{skstd::make_unique_default<uint32_t[]>(bufferSize(2))} { } +bool SkMaskBlurFilter::hasNoBlur() const { + return fInfoW.weight() <= 1 && fInfoH.weight() <= 1; +} + SkIPoint SkMaskBlurFilter::blur(const SkMask& src, SkMask* dst) const { uint64_t weightW = fInfoW.weight(); @@ -146,7 +150,7 @@ SkIPoint SkMaskBlurFilter::blur(const SkMask& src, SkMask* dst) const { } } else { // Copy to dst. No Blur. - + SkASSERT(false); // should not get here for (size_t y = 0; y < srcH; y++) { std::memcpy(&dst->fImage[y * dst->fRowBytes], &src.fImage[y * src.fRowBytes], dstW); } |