aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefilterscropexpand.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-12-17 08:10:17 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-17 08:10:17 -0800
commitc834ab178e56009875dee8d2265dba35cf6e1e55 (patch)
tree11a9ee3a919ddfe171fa3163da6f14fe031e128b /gm/imagefilterscropexpand.cpp
parent70509762c88df911c58c3984e6b1e673b5ecaeac (diff)
Fix gaussian blur for small sigma.
I broke this in https://skia.googlesource.com/skia/+/c57e0ded7d535523cfc6bf07c78e5f3479bb8c42. That change added support for cropping during blur, but did not do the correct thing for the small-sigma 2D matrix convolution optimization when blurring from small-to-large textures. The fix is pass the correct dstRect and srcOffset to convolve_gaussian_2d. I also changed convolve_gaussian_1d() and convolve_gaussian_2d() to take the original (non-negated) srcOffset, and to negate them when constructing the local matrix. Test: added a new (blur 0.3 0.3) column to imagefilterscropexpand, so that GM will have to be rebaselined. BUG=skia:4719,569883 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1529313003 Review URL: https://codereview.chromium.org/1529313003
Diffstat (limited to 'gm/imagefilterscropexpand.cpp')
-rw-r--r--gm/imagefilterscropexpand.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index b173648a8c..4fa9b0084e 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -35,7 +35,7 @@ protected:
return SkString("imagefilterscropexpand");
}
- SkISize onISize() override { return SkISize::Make(570, 650); }
+ SkISize onISize() override { return SkISize::Make(650, 650); }
void onDraw(SkCanvas* canvas) override {
SkAutoTUnref<SkColorFilter> cf(
@@ -78,6 +78,9 @@ protected:
cfAlphaTrans, noopCropped.get(), &big_rect));
Draw(canvas, checkerboard, rect, SkBlurImageFilter::Create(
+ 0.3f, 0.3f, noopCropped.get(), &big_rect));
+
+ Draw(canvas, checkerboard, rect, SkBlurImageFilter::Create(
8.0f, 8.0f, noopCropped.get(), &big_rect));
Draw(canvas, checkerboard, rect, SkDilateImageFilter::Create(