aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkDropShadowImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar jbroman <jbroman@chromium.org>2016-07-11 14:07:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-11 14:07:59 -0700
commit203a993c77ea146e0a4e7f1e0c079cc79fd09167 (patch)
tree260bc5289e61acc51fe9b65da5368f7d0876aac1 /src/effects/SkDropShadowImageFilter.cpp
parentb42b785d1cbc98bd34aceae338060831b974f9c5 (diff)
Handle negative scale in SkDropShadowImageFilter::onFilterNodeBounds.
Add unit tests for positive and negative scale factors for the two effects that apply a Gaussian blur like this: blur and drop-shadow. The last two assertions fail without the fix in SkDropShadowImageFilter. BUG=chromium:600821 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2114313002 Review-Url: https://codereview.chromium.org/2114313002
Diffstat (limited to 'src/effects/SkDropShadowImageFilter.cpp')
-rw-r--r--src/effects/SkDropShadowImageFilter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 31c45082b2..5befe71194 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -139,8 +139,9 @@ SkIRect SkDropShadowImageFilter::onFilterNodeBounds(const SkIRect& src, const Sk
SkScalarCeilToInt(offsetVec.y()));
SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
ctm.mapVectors(&sigma, 1);
- dst.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))),
- SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
+ dst.outset(
+ SkScalarCeilToInt(SkScalarAbs(SkScalarMul(sigma.x(), SkIntToScalar(3)))),
+ SkScalarCeilToInt(SkScalarAbs(SkScalarMul(sigma.y(), SkIntToScalar(3)))));
if (fShadowMode == kDrawShadowAndForeground_ShadowMode) {
dst.join(src);
}