Improve the curve tessellation subdivision of the path renderers.
The stencil-and-cover and tessellating path renderers currently
tessellate curves to linear segments to within one screen space pixel.
This is fairly poor accuracy, as can be seen from the strokecircle GM:
there are noticeable rotating bumps on the circles.
Improving the tolerance to 0.25 pixel eliminates the bumps, and
approximates the 16x supersampling of the raster path.
This does have a performance hit: 3-6% on desktop on
the IE chalkboard demo, ~1% on Nexus 7 2013.
Note: this will require rebaselining a number of GPU and MSAA images
in Skia, but nothing in Chrome (yet).
BUG=skia:3731
Review URL: https://codereview.chromium.org/1072273007
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index c80b693..1c1663d 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -1392,7 +1392,8 @@
c.sweep_lt = sweep_lt_vert;
c.sweep_gt = sweep_gt_vert;
}
- SkScalar tol = GrPathUtils::scaleToleranceToSrc(SK_Scalar1, fViewMatrix, pathBounds);
+ SkScalar screenSpaceTol = GrPathUtils::kDefaultTolerance;
+ SkScalar tol = GrPathUtils::scaleToleranceToSrc(screenSpaceTol, fViewMatrix, pathBounds);
int contourCnt;
int maxPts = GrPathUtils::worstCasePointCount(fPath, &contourCnt, tol);
if (maxPts <= 0) {