From c834ab178e56009875dee8d2265dba35cf6e1e55 Mon Sep 17 00:00:00 2001 From: senorblanco Date: Thu, 17 Dec 2015 08:10:17 -0800 Subject: 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 --- gm/imagefilterscropexpand.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gm/imagefilterscropexpand.cpp') 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 cf( @@ -77,6 +77,9 @@ protected: Draw(canvas, checkerboard, rect, SkColorFilterImageFilter::Create( 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)); -- cgit v1.2.3