From b712a85aea212cf5bfe5514a4fefc184545a8d3c Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 18 Apr 2017 16:56:06 -0400 Subject: [PATCH] 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 Commit-Queue: Robert Phillips --- src/gpu/GrPathUtils.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp index 57bb86fc5b..8e0a9fc0cc 100644 --- a/src/gpu/GrPathUtils.cpp +++ b/src/gpu/GrPathUtils.cpp @@ -36,8 +36,7 @@ SkScalar GrPathUtils::scaleToleranceToSrc(SkScalar devTol, 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 @@ uint32_t GrPathUtils::generateCubicPoints(const SkPoint& p0, 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 @@ int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths, 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); } -- 2.34.1