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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp

Issue 320573002: Revert of Fix Assert for gpu ConicalTwoPointGradient edgecase to be correct bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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/gradients/SkTwoPointConicalGradient_gpu.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index ef244a2f65478aa5a6f0c83adc5f923e610ad5d7..23fee850f5a3e4fda11937c00ce5ce9279b29d22 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -16,7 +16,6 @@
typedef GrGLUniformManager::UniformHandle UniformHandle;
static const SkScalar kErrorTol = 0.00001f;
-static const SkScalar kEdgeErrorTol = 5.f * kErrorTol;
/**
* We have three general cases for 2pt conical gradients. First we always assume that
@@ -97,8 +96,7 @@
fRadius0(shader.getStartRadius()),
fDiffRadius(shader.getDiffRadius()){
// We should only be calling this shader if we are degenerate case with touching circles
- SkASSERT(SkScalarAbs(SkScalarAbs(fDiffRadius) - SkScalarAbs(fCenterX1)) <
- fRadius0 * kEdgeErrorTol);
+ SkASSERT(SkScalarAbs(fDiffRadius) - SkScalarAbs(fCenterX1) < kErrorTol) ;
// We pass the linear part of the quadratic as a varying.
// float b = -2.0 * (fCenterX1 * x + fRadius0 * fDiffRadius * z)
@@ -330,9 +328,9 @@
// If the focal point is touching the edge of the circle it will
// cause a degenerate case that must be handled separately
- // kEdgeErrorTol = 5 * kErrorTol was picked after manual testing the
- // stability trade off versus the linear approx used in the Edge Shader
- if (SkScalarAbs(1.f - (*focalX)) < kEdgeErrorTol) {
+ // 5 * kErrorTol was picked after manual testing the stability trade off
+ // versus the linear approx used in the Edge Shader
+ if (SkScalarAbs(1.f - (*focalX)) < 5 * kErrorTol) {
return kEdge_ConicalType;
}
@@ -773,10 +771,9 @@
// Check to see if start circle is inside end circle with edges touching.
// If touching we return that it is of kEdge_ConicalType, and leave the matrix setting
- // to the edge shader. kEdgeErrorTol = 5 * kErrorTol was picked after manual testing
- // so that C = 1 / A is stable, and the linear approximation used in the Edge shader is
- // still accurate.
- if (SkScalarAbs(A) < kEdgeErrorTol) {
+ // to the edge shader. 5 * kErrorTol was picked after manual testing so that C = 1 / A
+ // is stable, and the linear approximation used in the Edge shader is still accurate.
+ if (SkScalarAbs(A) < 5 * kErrorTol) {
return kEdge_ConicalType;
}
« 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