From 9d24023c6664a1469ea4d31ab1c9b5bd764beca5 Mon Sep 17 00:00:00 2001 From: benjaminwagner Date: Wed, 24 Feb 2016 07:51:33 -0800 Subject: 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 --- src/effects/GrCircleBlurFragmentProcessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/effects/GrCircleBlurFragmentProcessor.cpp') 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; } -- cgit v1.2.3