Use tolerance==0 to flatten curves in GrTriangulator
Bug: skia:10419
Change-Id: I6e331a10622a4e2d17442910f9ed6b3af92614e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353337
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrTriangulator.cpp b/src/gpu/GrTriangulator.cpp
index a9d897a..fd9ec0e 100644
--- a/src/gpu/GrTriangulator.cpp
+++ b/src/gpu/GrTriangulator.cpp
@@ -415,7 +415,7 @@
switch (verb) {
case SkPath::kConic_Verb: {
fIsLinear = false;
- if (fSimpleInnerPolygons) {
+ if (toleranceSqd == 0) {
this->appendPointToContour(pts[2], contour);
break;
}
@@ -439,7 +439,7 @@
}
case SkPath::kQuad_Verb: {
fIsLinear = false;
- if (fSimpleInnerPolygons) {
+ if (toleranceSqd == 0) {
this->appendPointToContour(pts[2], contour);
break;
}
@@ -448,7 +448,7 @@
}
case SkPath::kCubic_Verb: {
fIsLinear = false;
- if (fSimpleInnerPolygons) {
+ if (toleranceSqd == 0) {
this->appendPointToContour(pts[3], contour);
break;
}
@@ -1163,7 +1163,7 @@
leftEnclosingEdge, edge, &activeEdges, &v, mesh, c) ||
this->checkForIntersection(
edge, rightEnclosingEdge, &activeEdges, &v, mesh, c)) {
- if (fSimpleInnerPolygons) {
+ if (fDisallowSelfIntersection) {
return SimplifyResult::kAbort;
}
result = SimplifyResult::kFoundSelfIntersection;
@@ -1174,7 +1174,7 @@
} else {
if (this->checkForIntersection(leftEnclosingEdge, rightEnclosingEdge, &activeEdges,
&v, mesh, c)) {
- if (fSimpleInnerPolygons) {
+ if (fDisallowSelfIntersection) {
return SimplifyResult::kAbort;
}
result = SimplifyResult::kFoundSelfIntersection;
@@ -1204,7 +1204,7 @@
Poly* GrTriangulator::tessellate(const VertexList& vertices, const Comparator&) {
TESS_LOG("\ntessellating simple polygons\n");
int maxWindMagnitude = std::numeric_limits<int>::max();
- if (fSimpleInnerPolygons && !SkPathFillType_IsEvenOdd(fPath.getFillType())) {
+ if (fDisallowSelfIntersection && !SkPathFillType_IsEvenOdd(fPath.getFillType())) {
maxWindMagnitude = 1;
}
EdgeList activeEdges;