aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar xidachen <xidachen@chromium.org>2015-12-10 12:08:44 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-10 12:08:44 -0800
commit467ddc0b24a63ee1525fa18d1dcf62e47975588a (patch)
treeda2da65b17a5faab7305f46d822a222a45c77809 /include/effects
parent671c06f9798d44fcb1cff741880dff07fed71a36 (diff)
SkBlurImageFilter returns input when sigma = 0
In the current implementation, a blur filter is always created even in the case when sigma.fX == 0 && sigma.fY == 0. This CL makes the blur filter return input in this case. BUG=568393 Review URL: https://codereview.chromium.org/1518643002
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkBlurImageFilter.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index 7f62634a9e..5ae013d78e 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -15,6 +15,9 @@ class SK_API SkBlurImageFilter : public SkImageFilter {
public:
static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = NULL,
const CropRect* cropRect = NULL) {
+ if (0 == sigmaX && 0 == sigmaY && nullptr == cropRect) {
+ return SkSafeRef(input);
+ }
return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect);
}