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

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: 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..c2d27c77373c02b09cbf33c5e36148d8c4a61cef 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/effects/GrCircleBlurFragmentProcessor.cpp
@@ -186,7 +186,7 @@ static inline void compute_profile_offset_and_size(float halfWH, float sigma,
// blurred circle is solid.
*offset = halfWH - 3 * sigma; // This location maps to 0.5f in the weights texture.
// It should always be 255.
- *size = SkScalarCeilToInt(6*sigma);
+ *size = SkScalarCeilToInt(6*sigma) + 1;
} else {
// The Gaussian is bigger than the circle.
*offset = 0.0f;
@@ -213,6 +213,7 @@ static uint8_t* create_profile(float halfWH, float sigma) {
weights[i] = eval_at(offset+i, halfWH, halfKernel.get(), kernelWH);
}
robertphillips 2016/02/24 12:52:56 Are we guaranteed that weights[numSteps-1] will al
dogben 2016/02/24 15:31:22 sgtm
+ SkASSERT(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