Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b79f1b5

Browse files
paraboulSkia Commit-Bot
authored andcommitted
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>
1 parent 648b41b commit b79f1b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/effects/imagefilters/SkDropShadowImageFilter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ sk_sp<SkSpecialImage> SkDropShadowImageFilterImpl::onFilterImage(const Context&
125125

126126
SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
127127
ctx.ctm().mapVectors(&sigma, 1);
128-
sigma.fX = SkMaxScalar(0, sigma.fX);
129-
sigma.fY = SkMaxScalar(0, sigma.fY);
128+
sigma.fX = SkScalarAbs(sigma.fX);
129+
sigma.fY = SkScalarAbs(sigma.fY);
130130

131131
SkPaint paint;
132132
paint.setAntiAlias(true);

0 commit comments

Comments
 (0)