diff options
author | benjaminwagner <benjaminwagner@google.com> | 2016-02-24 07:51:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-24 07:51:33 -0800 |
commit | 9d24023c6664a1469ea4d31ab1c9b5bd764beca5 (patch) | |
tree | 41dacf21a31ad2fb78e73ac296096d43bab4dd83 /src | |
parent | 7ea5cb18389db11a94175de95c9db2b44972630c (diff) |
Ensure the Gaussian tail of circle blurs goes to zero.
Compare blurcircle GM masked so that values <255 are white and =255 are black:
https://x20web.corp.google.com/~benjaminwagner/review/1723383002/blurcircles-lt255-before.png
https://x20web.corp.google.com/~benjaminwagner/review/1723383002/blurcircles-lt255-after.png
This is a spinoff of https://codereview.chromium.org/1691403002, which was previously causing more "rectangles" in this GM.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1723383002
Review URL: https://codereview.chromium.org/1723383002
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index f319e3d90f..39e3947049 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -209,9 +209,11 @@ static uint8_t* create_profile(float halfWH, float sigma) { compute_profile_offset_and_size(halfWH, sigma, &offset, &numSteps); uint8_t* weights = new uint8_t[numSteps]; - for (int i = 0; i < numSteps; ++i) { + for (int i = 0; i < numSteps - 1; ++i) { weights[i] = eval_at(offset+i, halfWH, halfKernel.get(), kernelWH); } + // Ensure the tail of the Gaussian goes to zero. + weights[numSteps-1] = 0; return weights; } |