Use absolute sigma instead of clamping to 0 in SkDropShadowImageFilter.

If the CTM is scaled to negative value (without skew), mapVector returns a negative value. We want to use its absolute value rather than clamping to 0.

https://bugs.chromium.org/p/skia/issues/detail?id=9704

Change-Id: I7393a52aa7d646b1494d4f0ae1a520ab60d02104
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259137
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Anthony Catel 2019-12-10 22:29:38 +01:00 committed by Skia Commit-Bot
parent 648b41bf26
commit b79f1b527d

View File

@ -125,8 +125,8 @@ sk_sp<SkSpecialImage> SkDropShadowImageFilterImpl::onFilterImage(const Context&
SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
ctx.ctm().mapVectors(&sigma, 1);
sigma.fX = SkMaxScalar(0, sigma.fX);
sigma.fY = SkMaxScalar(0, sigma.fY);
sigma.fX = SkScalarAbs(sigma.fX);
sigma.fY = SkScalarAbs(sigma.fY);
SkPaint paint;
paint.setAntiAlias(true);