Clamp negative sigma to 0 in SkDropShadowImageFilter.

This can occur when the matrix includes a perspective transform.

BUG=skia:2094
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/137833004

git-svn-id: http://skia.googlecode.com/svn/trunk@13220 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
senorblanco@chromium.org 2014-01-28 17:57:26 +00:00
parent c1587f94a7
commit 74bdde0d50

View File

@ -79,6 +79,8 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY);
matrix.mapVectors(&sigma, &localSigma, 1);
sigma.fX = SkMaxScalar(0, sigma.fX);
sigma.fY = SkMaxScalar(0, sigma.fY);
SkAutoTUnref<SkImageFilter> blurFilter(new SkBlurImageFilter(sigma.fX, sigma.fY));
SkAutoTUnref<SkColorFilter> colorFilter(SkColorFilter::CreateModeFilter(fColor, SkXfermode::kSrcIn_Mode));
SkPaint paint;