Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: src/effects/SkDropShadowImageFilter.cpp

Issue 1518643002: SkBlurImageFilter returns input when sigma = 0 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDropShadowImageFilter.cpp
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index eb05cf09eca99dfdbf0e381050fb6ae1b0074a42..55a75a8325e886ce590c1ceb652b8973c06905d9 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -77,11 +77,16 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
ctx.ctm().mapVectors(&sigma, 1);
sigma.fX = SkMaxScalar(0, sigma.fX);
sigma.fY = SkMaxScalar(0, sigma.fY);
- SkAutoTUnref<SkImageFilter> blurFilter(SkBlurImageFilter::Create(sigma.fX, sigma.fY));
+ SkAutoTUnref<SkImageFilter> blurFilter;
+ if (sigma.fX != 0 || sigma.fY != 0)
reed1 2015/12/10 13:36:49 It seems that for the most part, if the sigmas are
Stephen White 2015/12/10 14:57:18 If it's drawing shadow & foreground, an offset may
xidachen 2015/12/10 15:16:41 Done.
+ blurFilter = SkAutoTUnref<SkImageFilter>(SkBlurImageFilter::Create(sigma.fX, sigma.fY));
SkAutoTUnref<SkColorFilter> colorFilter(
SkColorFilter::CreateModeFilter(fColor, SkXfermode::kSrcIn_Mode));
SkPaint paint;
- paint.setImageFilter(blurFilter.get());
+ if (blurFilter)
reed1 2015/12/10 13:36:49 This check seems unnecessary, since line 87 will e
xidachen 2015/12/10 15:16:41 Done.
+ paint.setImageFilter(blurFilter.get());
+ else
+ paint.setImageFilter(nullptr);
paint.setColorFilter(colorFilter.get());
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
SkVector offsetVec = SkVector::Make(fDx, fDy);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698