Add antialiasing to SkDropShadowImageFilter's shadow draw
authorRobert Phillips <robertphillips@google.com>
Wed, 7 Dec 2016 16:28:11 +0000 (11:28 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 7 Dec 2016 17:37:59 +0000 (17:37 +0000)
A BW draw in the SkDropShadowImageFilter can lead to unexpected popping of the shadow when the dest rect lies on half pixel boundaries.

Change-Id: Ibc59dacc79bca8955981ec2889e79facd7d2de83
Reviewed-on: https://skia-review.googlesource.com/5669
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

src/effects/SkDropShadowImageFilter.cpp

index f2a41ee0dc3d7850ce05148af04cc46a5c512221..f461cd7e674f92ecd466ff0424f049a19da67af4 100644 (file)
@@ -93,6 +93,7 @@ sk_sp<SkSpecialImage> SkDropShadowImageFilter::onFilterImage(SkSpecialImage* sou
     sigma.fY = SkMaxScalar(0, sigma.fY);
 
     SkPaint paint;
+    paint.setAntiAlias(true);
     paint.setImageFilter(SkBlurImageFilter::Make(sigma.fX, sigma.fY, nullptr));
     paint.setColorFilter(SkColorFilter::MakeModeFilter(fColor, SkBlendMode::kSrcIn));