Fix missing tolerance in GrPathUtils::worstCasePointCount
https://skia-review.googlesource.com/c/10752/ (Use correct tolerance for
conic chopping in MSAA and default path renderers) changed the tolerance
used in createGeom but didn't change the setting in worstCasePointCount.
Bug: 711936, 712749
Change-Id: I540d8bc8cfdebc3eae5204e1acfeba3cefc2b12e
Reviewed-on: https://skia-review.googlesource.com/13768
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 57bb86f..8e0a9fc 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -36,8 +36,7 @@
static const int MAX_POINTS_PER_CURVE = 1 << 10;
static const SkScalar gMinCurveTol = 0.0001f;
-uint32_t GrPathUtils::quadraticPointCount(const SkPoint points[],
- SkScalar tol) {
+uint32_t GrPathUtils::quadraticPointCount(const SkPoint points[], SkScalar tol) {
if (tol < gMinCurveTol) {
tol = gMinCurveTol;
}
@@ -158,8 +157,7 @@
return a + b;
}
-int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths,
- SkScalar tol) {
+int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths, SkScalar tol) {
if (tol < gMinCurveTol) {
tol = gMinCurveTol;
}
@@ -183,7 +181,7 @@
case SkPath::kConic_Verb: {
SkScalar weight = iter.conicWeight();
SkAutoConicToQuads converter;
- const SkPoint* quadPts = converter.computeQuads(pts, weight, 0.25f);
+ const SkPoint* quadPts = converter.computeQuads(pts, weight, tol);
for (int i = 0; i < converter.countQuads(); ++i) {
pointCount += quadraticPointCount(quadPts + 2*i, tol);
}