Fix gaussian blur for small sigma.
authorsenorblanco <senorblanco@chromium.org>
Thu, 17 Dec 2015 16:10:17 +0000 (08:10 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Dec 2015 16:10:17 +0000 (08:10 -0800)
commitc834ab178e56009875dee8d2265dba35cf6e1e55
tree11a9ee3a919ddfe171fa3163da6f14fe031e128b
parent70509762c88df911c58c3984e6b1e673b5ecaeac
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
src/effects/SkGpuBlurUtils.cpp