Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: src/effects/GrCircleBlurFragmentProcessor.cpp

Issue 1723383002: Ensure the Gaussian tail of circle blurs goes to zero. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Force-zero the tail instead of increasing the size. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/GrCircleBlurFragmentProcessor.cpp
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp
index f319e3d90fc1863805b44be9d784c1b07a1b478c..39e3947049e039d54f8923ad74baa6de5ba04b10 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698