Don't propogate the BreadcrumbTriangleList across args lists

Bug: chromium:1171754
Change-Id: I75f7427c2aa349a115593e88c0922d35af8aa6ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362479
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTriangulator.cpp b/src/gpu/GrTriangulator.cpp
index 4c73d08..71f2349 100644
--- a/src/gpu/GrTriangulator.cpp
+++ b/src/gpu/GrTriangulator.cpp
@@ -204,8 +204,7 @@
     }
 }
 
-void* GrTriangulator::emitMonotonePoly(const MonotonePoly* monotonePoly, void* data,
-                                       BreadcrumbTriangleList* breadcrumbList) const {
+void* GrTriangulator::emitMonotonePoly(const MonotonePoly* monotonePoly, void* data) const {
     SkASSERT(monotonePoly->fWinding != 0);
     Edge* e = monotonePoly->fFirstEdge;
     VertexList vertices;
@@ -229,16 +228,14 @@
         Vertex* curr = v;
         Vertex* next = v->fNext;
         if (count == 3) {
-            return this->emitTriangle(prev, curr, next, monotonePoly->fWinding, data,
-                                      breadcrumbList);
+            return this->emitTriangle(prev, curr, next, monotonePoly->fWinding, data);
         }
         double ax = static_cast<double>(curr->fPoint.fX) - prev->fPoint.fX;
         double ay = static_cast<double>(curr->fPoint.fY) - prev->fPoint.fY;
         double bx = static_cast<double>(next->fPoint.fX) - curr->fPoint.fX;
         double by = static_cast<double>(next->fPoint.fY) - curr->fPoint.fY;
         if (ax * by - ay * bx >= 0.0) {
-            data = this->emitTriangle(prev, curr, next, monotonePoly->fWinding, data,
-                                      breadcrumbList);
+            data = this->emitTriangle(prev, curr, next, monotonePoly->fWinding, data);
             v->fPrev->fNext = v->fNext;
             v->fNext->fPrev = v->fPrev;
             count--;
@@ -255,17 +252,17 @@
 }
 
 void* GrTriangulator::emitTriangle(Vertex* prev, Vertex* curr, Vertex* next, int winding,
-                                   void* data, BreadcrumbTriangleList* breadcrumbList) const {
+                                   void* data) const {
     if (winding > 0) {
         // Ensure our triangles always wind in the same direction as if the path had been
         // triangulated as a simple fan (a la red book).
         std::swap(prev, next);
     }
-    if (breadcrumbList && abs(winding) > 1 &&
+    if (fCollectBreadcrumbTriangles && abs(winding) > 1 &&
         fPath.getFillType() == SkPathFillType::kWinding) {
         // The first winding count will come from the actual triangle we emit. The remaining counts
         // come from the breadcrumb triangle.
-        breadcrumbList->prepend(fAlloc, prev->fPoint, curr->fPoint, next->fPoint, abs(winding) - 1);
+        fBreadcrumbList.append(fAlloc, prev->fPoint, curr->fPoint, next->fPoint, abs(winding) - 1);
     }
     return emit_triangle(prev, curr, next, fEmitCoverage, data);
 }
@@ -311,14 +308,13 @@
     }
     return poly;
 }
-void* GrTriangulator::emitPoly(const Poly* poly, void *data,
-                               BreadcrumbTriangleList* breadcrumbList) const {
+void* GrTriangulator::emitPoly(const Poly* poly, void *data) const {
     if (poly->fCount < 3) {
         return data;
     }
     TESS_LOG("emit() %d, size %d\n", fID, fCount);
     for (MonotonePoly* m = poly->fHead; m != nullptr; m = m->fNext) {
-        data = this->emitMonotonePoly(m, data, breadcrumbList);
+        data = this->emitMonotonePoly(m, data);
     }
     return data;
 }
@@ -654,36 +650,35 @@
 }
 
 void GrTriangulator::setTop(Edge* edge, Vertex* v, EdgeList* activeEdges, Vertex** current,
-                            const Comparator& c, BreadcrumbTriangleList* breadcrumbList) const {
+                            const Comparator& c) const {
     remove_edge_below(edge);
-    if (breadcrumbList) {
-        breadcrumbList->prepend(fAlloc, edge->fTop->fPoint, edge->fBottom->fPoint, v->fPoint,
-                                edge->fWinding);
+    if (fCollectBreadcrumbTriangles) {
+        fBreadcrumbList.append(fAlloc, edge->fTop->fPoint, edge->fBottom->fPoint, v->fPoint,
+                               edge->fWinding);
     }
     edge->fTop = v;
     edge->recompute();
     edge->insertBelow(v, c);
     rewind_if_necessary(edge, activeEdges, current, c);
-    this->mergeCollinearEdges(edge, activeEdges, current, c, breadcrumbList);
+    this->mergeCollinearEdges(edge, activeEdges, current, c);
 }
 
 void GrTriangulator::setBottom(Edge* edge, Vertex* v, EdgeList* activeEdges, Vertex** current,
-                               const Comparator& c, BreadcrumbTriangleList* breadcrumbList) const {
+                               const Comparator& c) const {
     remove_edge_above(edge);
-    if (breadcrumbList) {
-        breadcrumbList->prepend(fAlloc, edge->fTop->fPoint, edge->fBottom->fPoint, v->fPoint,
-                                edge->fWinding);
+    if (fCollectBreadcrumbTriangles) {
+        fBreadcrumbList.append(fAlloc, edge->fTop->fPoint, edge->fBottom->fPoint, v->fPoint,
+                               edge->fWinding);
     }
     edge->fBottom = v;
     edge->recompute();
     edge->insertAbove(v, c);
     rewind_if_necessary(edge, activeEdges, current, c);
-    this->mergeCollinearEdges(edge, activeEdges, current, c, breadcrumbList);
+    this->mergeCollinearEdges(edge, activeEdges, current, c);
 }
 
 void GrTriangulator::mergeEdgesAbove(Edge* edge, Edge* other, EdgeList* activeEdges,
-                                     Vertex** current, const Comparator& c,
-                                     BreadcrumbTriangleList* breadcrumbList) const {
+                                     Vertex** current, const Comparator& c) const {
     if (coincident(edge->fTop->fPoint, other->fTop->fPoint)) {
         TESS_LOG("merging coincident above edges (%g, %g) -> (%g, %g)\n",
                  edge->fTop->fPoint.fX, edge->fTop->fPoint.fY,
@@ -695,17 +690,16 @@
     } else if (c.sweep_lt(edge->fTop->fPoint, other->fTop->fPoint)) {
         rewind(activeEdges, current, edge->fTop, c);
         other->fWinding += edge->fWinding;
-        this->setBottom(edge, other->fTop, activeEdges, current, c, breadcrumbList);
+        this->setBottom(edge, other->fTop, activeEdges, current, c);
     } else {
         rewind(activeEdges, current, other->fTop, c);
         edge->fWinding += other->fWinding;
-        this->setBottom(other, edge->fTop, activeEdges, current, c, breadcrumbList);
+        this->setBottom(other, edge->fTop, activeEdges, current, c);
     }
 }
 
 void GrTriangulator::mergeEdgesBelow(Edge* edge, Edge* other, EdgeList* activeEdges,
-                                     Vertex** current, const Comparator& c,
-                                     BreadcrumbTriangleList* breadcrumbList) const {
+                                     Vertex** current, const Comparator& c) const {
     if (coincident(edge->fBottom->fPoint, other->fBottom->fPoint)) {
         TESS_LOG("merging coincident below edges (%g, %g) -> (%g, %g)\n",
                  edge->fTop->fPoint.fX, edge->fTop->fPoint.fY,
@@ -717,11 +711,11 @@
     } else if (c.sweep_lt(edge->fBottom->fPoint, other->fBottom->fPoint)) {
         rewind(activeEdges, current, other->fTop, c);
         edge->fWinding += other->fWinding;
-        this->setTop(other, edge->fBottom, activeEdges, current, c, breadcrumbList);
+        this->setTop(other, edge->fBottom, activeEdges, current, c);
     } else {
         rewind(activeEdges, current, edge->fTop, c);
         other->fWinding += edge->fWinding;
-        this->setTop(edge, other->fBottom, activeEdges, current, c, breadcrumbList);
+        this->setTop(edge, other->fBottom, activeEdges, current, c);
     }
 }
 
@@ -742,21 +736,16 @@
 }
 
 void GrTriangulator::mergeCollinearEdges(Edge* edge, EdgeList* activeEdges, Vertex** current,
-                                         const Comparator& c,
-                                         BreadcrumbTriangleList* breadcrumbList) const {
+                                         const Comparator& c) const {
     for (;;) {
         if (top_collinear(edge->fPrevEdgeAbove, edge)) {
-            this->mergeEdgesAbove(edge->fPrevEdgeAbove, edge, activeEdges, current, c,
-                                  breadcrumbList);
+            this->mergeEdgesAbove(edge->fPrevEdgeAbove, edge, activeEdges, current, c);
         } else if (top_collinear(edge, edge->fNextEdgeAbove)) {
-            this->mergeEdgesAbove(edge->fNextEdgeAbove, edge, activeEdges, current, c,
-                                  breadcrumbList);
+            this->mergeEdgesAbove(edge->fNextEdgeAbove, edge, activeEdges, current, c);
         } else if (bottom_collinear(edge->fPrevEdgeBelow, edge)) {
-            this->mergeEdgesBelow(edge->fPrevEdgeBelow, edge, activeEdges, current, c,
-                                  breadcrumbList);
+            this->mergeEdgesBelow(edge->fPrevEdgeBelow, edge, activeEdges, current, c);
         } else if (bottom_collinear(edge, edge->fNextEdgeBelow)) {
-            this->mergeEdgesBelow(edge->fNextEdgeBelow, edge, activeEdges, current, c,
-                                  breadcrumbList);
+            this->mergeEdgesBelow(edge->fNextEdgeBelow, edge, activeEdges, current, c);
         } else {
             break;
         }
@@ -768,7 +757,7 @@
 }
 
 bool GrTriangulator::splitEdge(Edge* edge, Vertex* v, EdgeList* activeEdges, Vertex** current,
-                               const Comparator& c, BreadcrumbTriangleList* breadcrumbList) const {
+                               const Comparator& c) const {
     if (!edge->fTop || !edge->fBottom || v == edge->fTop || v == edge->fBottom) {
         return false;
     }
@@ -780,26 +769,25 @@
     if (c.sweep_lt(v->fPoint, edge->fTop->fPoint)) {
         top = v;
         bottom = edge->fTop;
-        this->setTop(edge, v, activeEdges, current, c, breadcrumbList);
+        this->setTop(edge, v, activeEdges, current, c);
     } else if (c.sweep_lt(edge->fBottom->fPoint, v->fPoint)) {
         top = edge->fBottom;
         bottom = v;
-        this->setBottom(edge, v, activeEdges, current, c, breadcrumbList);
+        this->setBottom(edge, v, activeEdges, current, c);
     } else {
         top = v;
         bottom = edge->fBottom;
-        this->setBottom(edge, v, activeEdges, current, c, breadcrumbList);
+        this->setBottom(edge, v, activeEdges, current, c);
     }
     Edge* newEdge = fAlloc->make<Edge>(top, bottom, winding, edge->fType);
     newEdge->insertBelow(top, c);
     newEdge->insertAbove(bottom, c);
-    this->mergeCollinearEdges(newEdge, activeEdges, current, c, breadcrumbList);
+    this->mergeCollinearEdges(newEdge, activeEdges, current, c);
     return true;
 }
 
 bool GrTriangulator::intersectEdgePair(Edge* left, Edge* right, EdgeList* activeEdges,
-                                       Vertex** current, const Comparator& c,
-                                       BreadcrumbTriangleList* breadcrumbList) const {
+                                       Vertex** current, const Comparator& c) const {
     if (!left->fTop || !left->fBottom || !right->fTop || !right->fBottom) {
         return false;
     }
@@ -809,32 +797,30 @@
     if (c.sweep_lt(left->fTop->fPoint, right->fTop->fPoint)) {
         if (!left->isLeftOf(right->fTop)) {
             rewind(activeEdges, current, right->fTop, c);
-            return this->splitEdge(left, right->fTop, activeEdges, current, c, breadcrumbList);
+            return this->splitEdge(left, right->fTop, activeEdges, current, c);
         }
     } else {
         if (!right->isRightOf(left->fTop)) {
             rewind(activeEdges, current, left->fTop, c);
-            return this->splitEdge(right, left->fTop, activeEdges, current, c, breadcrumbList);
+            return this->splitEdge(right, left->fTop, activeEdges, current, c);
         }
     }
     if (c.sweep_lt(right->fBottom->fPoint, left->fBottom->fPoint)) {
         if (!left->isLeftOf(right->fBottom)) {
             rewind(activeEdges, current, right->fBottom, c);
-            return this->splitEdge(left, right->fBottom, activeEdges, current, c, breadcrumbList);
+            return this->splitEdge(left, right->fBottom, activeEdges, current, c);
         }
     } else {
         if (!right->isRightOf(left->fBottom)) {
             rewind(activeEdges, current, left->fBottom, c);
-            return this->splitEdge(right, left->fBottom, activeEdges, current, c, breadcrumbList);
+            return this->splitEdge(right, left->fBottom, activeEdges, current, c);
         }
     }
     return false;
 }
 
 Edge* GrTriangulator::makeConnectingEdge(Vertex* prev, Vertex* next, EdgeType type,
-                                         const Comparator& c,
-                                         BreadcrumbTriangleList* breadcrumbList,
-                                         int windingScale) const {
+                                         const Comparator& c, int windingScale) const {
     if (!prev || !next || prev->fPoint == next->fPoint) {
         return nullptr;
     }
@@ -842,13 +828,12 @@
     edge->insertBelow(edge->fTop, c);
     edge->insertAbove(edge->fBottom, c);
     edge->fWinding *= windingScale;
-    this->mergeCollinearEdges(edge, nullptr, nullptr, c, breadcrumbList);
+    this->mergeCollinearEdges(edge, nullptr, nullptr, c);
     return edge;
 }
 
 void GrTriangulator::mergeVertices(Vertex* src, Vertex* dst, VertexList* mesh,
-                                   const Comparator& c,
-                                   BreadcrumbTriangleList* breadcrumbList) const {
+                                   const Comparator& c) const {
     TESS_LOG("found coincident verts at %g, %g; merging %g into %g\n",
              src->fPoint.fX, src->fPoint.fY, src->fID, dst->fID);
     dst->fAlpha = std::max(src->fAlpha, dst->fAlpha);
@@ -856,10 +841,10 @@
         src->fPartner->fPartner = dst;
     }
     while (Edge* edge = src->fFirstEdgeAbove) {
-        this->setBottom(edge, dst, nullptr, nullptr, c, breadcrumbList);
+        this->setBottom(edge, dst, nullptr, nullptr, c);
     }
     while (Edge* edge = src->fFirstEdgeBelow) {
-        this->setTop(edge, dst, nullptr, nullptr, c, breadcrumbList);
+        this->setTop(edge, dst, nullptr, nullptr, c);
     }
     mesh->remove(src);
     dst->fSynthetic = true;
@@ -937,8 +922,8 @@
 }
 
 bool GrTriangulator::checkForIntersection(Edge* left, Edge* right, EdgeList* activeEdges,
-                                          Vertex** current, VertexList* mesh, const Comparator& c,
-                                          BreadcrumbTriangleList* breadcrumbList) const {
+                                          Vertex** current, VertexList* mesh,
+                                          const Comparator& c) const {
     if (!left || !right) {
         return false;
     }
@@ -976,12 +961,12 @@
             }
         }
         rewind(activeEdges, current, top ? top : v, c);
-        this->splitEdge(left, v, activeEdges, current, c, breadcrumbList);
-        this->splitEdge(right, v, activeEdges, current, c, breadcrumbList);
+        this->splitEdge(left, v, activeEdges, current, c);
+        this->splitEdge(right, v, activeEdges, current, c);
         v->fAlpha = std::max(v->fAlpha, alpha);
         return true;
     }
-    return this->intersectEdgePair(left, right, activeEdges, current, c, breadcrumbList);
+    return this->intersectEdgePair(left, right, activeEdges, current, c);
 }
 
 void GrTriangulator::sanitizeContours(VertexList* contours, int contourCnt) const {
@@ -1003,7 +988,7 @@
             } else if (!v->fPoint.isFinite()) {
                 TESS_LOG("vertex %g,%g non-finite; removing\n", v->fPoint.fX, v->fPoint.fY);
                 contour->remove(v);
-            } else if (fCullCollinearVertices &&
+            } else if (!fPreserveCollinearVertices &&
                        Line(prev->fPoint, nextWrap->fPoint).dist(v->fPoint) == 0.0) {
                 TESS_LOG("vertex %g,%g collinear; removing\n", v->fPoint.fX, v->fPoint.fY);
                 contour->remove(v);
@@ -1015,8 +1000,7 @@
     }
 }
 
-bool GrTriangulator::mergeCoincidentVertices(VertexList* mesh, const Comparator& c,
-                                             BreadcrumbTriangleList* breadcrumbList) const {
+bool GrTriangulator::mergeCoincidentVertices(VertexList* mesh, const Comparator& c) const {
     if (!mesh->fHead) {
         return false;
     }
@@ -1027,7 +1011,7 @@
             v->fPoint = v->fPrev->fPoint;
         }
         if (coincident(v->fPrev->fPoint, v->fPoint)) {
-            this->mergeVertices(v, v->fPrev, mesh, c, breadcrumbList);
+            this->mergeVertices(v, v->fPrev, mesh, c);
             merged = true;
         }
         v = next;
@@ -1038,12 +1022,12 @@
 // Stage 2: convert the contours to a mesh of edges connecting the vertices.
 
 void GrTriangulator::buildEdges(VertexList* contours, int contourCnt, VertexList* mesh,
-                                const Comparator& c, BreadcrumbTriangleList* breadcrumbList) const {
+                                const Comparator& c) const {
     for (VertexList* contour = contours; contourCnt > 0; --contourCnt, ++contour) {
         Vertex* prev = contour->fTail;
         for (Vertex* v = contour->fHead; v;) {
             Vertex* next = v->fNext;
-            this->makeConnectingEdge(prev, v, EdgeType::kInner, c, breadcrumbList);
+            this->makeConnectingEdge(prev, v, EdgeType::kInner, c);
             mesh->append(v);
             prev = v;
             v = next;
@@ -1172,8 +1156,8 @@
 
 // Stage 4: Simplify the mesh by inserting new vertices at intersecting edges.
 
-GrTriangulator::SimplifyResult GrTriangulator::simplify(
-        VertexList* mesh, const Comparator& c, BreadcrumbTriangleList* breadcrumbList) const {
+GrTriangulator::SimplifyResult GrTriangulator::simplify(VertexList* mesh,
+                                                        const Comparator& c) const {
     TESS_LOG("simplifying complex polygons\n");
     EdgeList activeEdges;
     auto result = SimplifyResult::kAlreadySimple;
@@ -1194,9 +1178,9 @@
             if (v->fFirstEdgeBelow) {
                 for (Edge* edge = v->fFirstEdgeBelow; edge; edge = edge->fNextEdgeBelow) {
                     if (this->checkForIntersection(
-                            leftEnclosingEdge, edge, &activeEdges, &v, mesh, c, breadcrumbList) ||
+                            leftEnclosingEdge, edge, &activeEdges, &v, mesh, c) ||
                         this->checkForIntersection(
-                            edge, rightEnclosingEdge, &activeEdges, &v, mesh, c, breadcrumbList)) {
+                            edge, rightEnclosingEdge, &activeEdges, &v, mesh, c)) {
                         result = SimplifyResult::kFoundSelfIntersection;
                         restartChecks = true;
                         break;
@@ -1204,7 +1188,7 @@
                 }
             } else {
                 if (this->checkForIntersection(leftEnclosingEdge, rightEnclosingEdge, &activeEdges,
-                                               &v, mesh, c, breadcrumbList)) {
+                                               &v, mesh, c)) {
                     result = SimplifyResult::kFoundSelfIntersection;
                     restartChecks = true;
                 }
@@ -1346,8 +1330,7 @@
 // This is a driver function that calls stages 2-5 in turn.
 
 void GrTriangulator::contoursToMesh(VertexList* contours, int contourCnt, VertexList* mesh,
-                                    const Comparator& c,
-                                    BreadcrumbTriangleList* breadcrumbList) const {
+                                    const Comparator& c) const {
 #if TRIANGULATOR_LOGGING
     for (int i = 0; i < contourCnt; ++i) {
         Vertex* v = contours[i].fHead;
@@ -1359,7 +1342,7 @@
     }
 #endif
     this->sanitizeContours(contours, contourCnt);
-    this->buildEdges(contours, contourCnt, mesh, c, breadcrumbList);
+    this->buildEdges(contours, contourCnt, mesh, c);
 }
 
 void GrTriangulator::SortMesh(VertexList* vertices, const Comparator& c) {
@@ -1381,16 +1364,15 @@
 #endif
 }
 
-Poly* GrTriangulator::contoursToPolys(VertexList* contours, int contourCnt,
-                                      BreadcrumbTriangleList* breadcrumbList) const {
+Poly* GrTriangulator::contoursToPolys(VertexList* contours, int contourCnt) const {
     const SkRect& pathBounds = fPath.getBounds();
     Comparator c(pathBounds.width() > pathBounds.height() ? Comparator::Direction::kHorizontal
                                                           : Comparator::Direction::kVertical);
     VertexList mesh;
-    this->contoursToMesh(contours, contourCnt, &mesh, c, breadcrumbList);
+    this->contoursToMesh(contours, contourCnt, &mesh, c);
     SortMesh(&mesh, c);
-    this->mergeCoincidentVertices(&mesh, c, breadcrumbList);
-    this->simplify(&mesh, c, breadcrumbList);
+    this->mergeCoincidentVertices(&mesh, c);
+    this->simplify(&mesh, c);
     TESS_LOG("\nsimplified mesh:\n");
     DUMP_MESH(mesh);
     return this->tessellate(mesh, c);
@@ -1398,11 +1380,10 @@
 
 // Stage 6: Triangulate the monotone polygons into a vertex buffer.
 void* GrTriangulator::polysToTriangles(Poly* polys, void* data,
-                                       BreadcrumbTriangleList* breadcrumbList,
                                        SkPathFillType overrideFillType) const {
     for (Poly* poly = polys; poly; poly = poly->fNext) {
         if (apply_fill_type(overrideFillType, poly)) {
-            data = this->emitPoly(poly, data, breadcrumbList);
+            data = this->emitPoly(poly, data);
         }
     }
     return data;
@@ -1442,8 +1423,7 @@
     return contourCnt;
 }
 
-Poly* GrTriangulator::pathToPolys(float tolerance, const SkRect& clipBounds,
-                                  BreadcrumbTriangleList* breadcrumbList, bool* isLinear) const {
+Poly* GrTriangulator::pathToPolys(float tolerance, const SkRect& clipBounds, bool* isLinear) const {
     int contourCnt = get_contour_count(fPath, tolerance);
     if (contourCnt <= 0) {
         *isLinear = true;
@@ -1456,7 +1436,7 @@
     std::unique_ptr<VertexList[]> contours(new VertexList[contourCnt]);
 
     this->pathToContours(tolerance, clipBounds, contours.get(), isLinear);
-    return this->contoursToPolys(contours.get(), contourCnt, breadcrumbList);
+    return this->contoursToPolys(contours.get(), contourCnt);
 }
 
 int64_t GrTriangulator::CountPoints(Poly* polys, SkPathFillType overrideFillType) {
@@ -1471,8 +1451,7 @@
 
 // Stage 6: Triangulate the monotone polygons into a vertex buffer.
 
-int GrTriangulator::polysToTriangles(Poly* polys, GrEagerVertexAllocator* vertexAllocator,
-                                     BreadcrumbTriangleList* breadcrumbList) const {
+int GrTriangulator::polysToTriangles(Poly* polys, GrEagerVertexAllocator* vertexAllocator) const {
     int64_t count64 = CountPoints(polys, fPath.getFillType());
     if (0 == count64 || count64 > SK_MaxS32) {
         return 0;
@@ -1490,7 +1469,7 @@
     }
 
     TESS_LOG("emitting %d verts\n", count);
-    void* end = this->polysToTriangles(polys, verts, breadcrumbList, fPath.getFillType());
+    void* end = this->polysToTriangles(polys, verts, fPath.getFillType());
 
     int actualCount = static_cast<int>((static_cast<uint8_t*>(end) - static_cast<uint8_t*>(verts))
                                        / vertexStride);
@@ -1504,7 +1483,7 @@
     SkArenaAlloc alloc(kArenaDefaultChunkSize);
     GrTriangulator triangulator(path, &alloc);
     bool isLinear;
-    Poly* polys = triangulator.pathToPolys(tolerance, clipBounds, nullptr, &isLinear);
+    Poly* polys = triangulator.pathToPolys(tolerance, clipBounds, &isLinear);
     int64_t count64 = CountPoints(polys, path.getFillType());
     if (0 == count64 || count64 > SK_MaxS32) {
         *verts = nullptr;
@@ -1519,7 +1498,7 @@
     for (Poly* poly = polys; poly; poly = poly->fNext) {
         if (apply_fill_type(path.getFillType(), poly)) {
             SkPoint* start = pointsEnd;
-            pointsEnd = static_cast<SkPoint*>(triangulator.emitPoly(poly, pointsEnd, nullptr));
+            pointsEnd = static_cast<SkPoint*>(triangulator.emitPoly(poly, pointsEnd));
             while (start != pointsEnd) {
                 vertsEnd->fPos = *start;
                 vertsEnd->fWinding = poly->fWinding;