Remove GrTriangulator::fIsLinear

I think it makes sense for the class functions to not have internal side
effects. Meaning, you can call pathToPolys and polysToTriangles all you
want without worrying about internal state.

Bug: skia:10419
Change-Id: I5e2136719bbf65a6a8e4c032c1c1326f0a9a98c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356496
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/GrTriangulator.cpp b/src/gpu/GrTriangulator.cpp
index 6a016f4..8deb091 100644
--- a/src/gpu/GrTriangulator.cpp
+++ b/src/gpu/GrTriangulator.cpp
@@ -401,10 +401,10 @@
 // Stage 1: convert the input path to a set of linear contours (linked list of Vertices).
 
 void GrTriangulator::pathToContours(float tolerance, const SkRect& clipBounds,
-                                    VertexList* contours) {
+                                    VertexList* contours, bool* isLinear) {
     SkScalar toleranceSqd = tolerance * tolerance;
     SkPoint pts[4];
-    fIsLinear = true;
+    *isLinear = true;
     VertexList* contour = contours;
     SkPath::Iter iter(fPath, false);
     if (fPath.isInverseFillType()) {
@@ -420,7 +420,7 @@
     while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
         switch (verb) {
             case SkPath::kConic_Verb: {
-                fIsLinear = false;
+                *isLinear = false;
                 if (toleranceSqd == 0) {
                     this->appendPointToContour(pts[2], contour);
                     break;
@@ -444,7 +444,7 @@
                 break;
             }
             case SkPath::kQuad_Verb: {
-                fIsLinear = false;
+                *isLinear = false;
                 if (toleranceSqd == 0) {
                     this->appendPointToContour(pts[2], contour);
                     break;
@@ -453,7 +453,7 @@
                 break;
             }
             case SkPath::kCubic_Verb: {
-                fIsLinear = false;
+                *isLinear = false;
                 if (toleranceSqd == 0) {
                     this->appendPointToContour(pts[3], contour);
                     break;
@@ -1434,10 +1434,10 @@
     return contourCnt;
 }
 
-Poly* GrTriangulator::pathToPolys(float tolerance, const SkRect& clipBounds) {
+Poly* GrTriangulator::pathToPolys(float tolerance, const SkRect& clipBounds, bool* isLinear) {
     int contourCnt = get_contour_count(fPath, tolerance);
     if (contourCnt <= 0) {
-        fIsLinear = true;
+        *isLinear = true;
         return nullptr;
     }
 
@@ -1446,7 +1446,7 @@
     }
     std::unique_ptr<VertexList[]> contours(new VertexList[contourCnt]);
 
-    this->pathToContours(tolerance, clipBounds, contours.get());
+    this->pathToContours(tolerance, clipBounds, contours.get(), isLinear);
     return this->contoursToPolys(contours.get(), contourCnt);
 }
 
@@ -1492,7 +1492,8 @@
 int GrTriangulator::PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds,
                                    WindingVertex** verts) {
     GrTriangulator triangulator(path);
-    Poly* polys = triangulator.pathToPolys(tolerance, clipBounds);
+    bool isLinear;
+    Poly* polys = triangulator.pathToPolys(tolerance, clipBounds, &isLinear);
     int64_t count64 = CountPoints(polys, path.getFillType());
     if (0 == count64 || count64 > SK_MaxS32) {
         *verts = nullptr;