add guard to switch to SkPathTypes

Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/gpu/geometry/GrShape.cpp b/src/gpu/geometry/GrShape.cpp
index 4fc3472..a510a19 100644
--- a/src/gpu/geometry/GrShape.cpp
+++ b/src/gpu/geometry/GrShape.cpp
@@ -201,7 +201,7 @@
     const int conicWeightCnt = SkPathPriv::ConicWeightCnt(path);
     SkASSERT(verbCnt <= GrShape::kMaxKeyFromDataVerbCnt);
     SkASSERT(pointCnt && verbCnt);
-    *key++ = path.getFillType();
+    *key++ = (uint32_t)path.getFillType();
     *key++ = verbCnt;
     memcpy(key, SkPathPriv::VerbData(path), verbCnt * sizeof(uint8_t));
     int verbKeySize = SkAlign4(verbCnt);
@@ -273,7 +273,7 @@
             case Type::kRRect:
                 fRRectData.fRRect.writeToMemory(key);
                 key += SkRRect::kSizeInMemory / sizeof(uint32_t);
-                *key = (fRRectData.fDir == SkPath::kCCW_Direction) ? (1 << 31) : 0;
+                *key = (fRRectData.fDir == SkPathDirection::kCCW) ? (1 << 31) : 0;
                 *key |= fRRectData.fInverted ? (1 << 30) : 0;
                 *key++ |= fRRectData.fStart;
                 SkASSERT(fRRectData.fStart < 8);
@@ -297,7 +297,7 @@
                 *key++ = fPathData.fGenID;
                 // We could canonicalize the fill rule for paths that don't differentiate between
                 // even/odd or winding fill (e.g. convex).
-                *key++ = this->path().getFillType();
+                *key++ = (uint32_t)this->path().getFillType();
                 break;
             }
         }
@@ -507,7 +507,7 @@
 void GrShape::attemptToSimplifyPath() {
     SkRect rect;
     SkRRect rrect;
-    SkPath::Direction rrectDir;
+    SkPathDirection rrectDir;
     unsigned rrectStart;
     bool inverted = this->path().isInverseFillType();
     SkPoint pts[2];
diff --git a/src/gpu/geometry/GrShape.h b/src/gpu/geometry/GrShape.h
index 37f38f8..8771c94 100644
--- a/src/gpu/geometry/GrShape.h
+++ b/src/gpu/geometry/GrShape.h
@@ -61,7 +61,7 @@
         this->attemptToSimplifyRRect();
     }
 
-    GrShape(const SkRRect& rrect, SkPath::Direction dir, unsigned start, bool inverted,
+    GrShape(const SkRRect& rrect, SkPathDirection dir, unsigned start, bool inverted,
             const GrStyle& style)
         : fStyle(style) {
         this->initType(Type::kRRect);
@@ -160,7 +160,7 @@
     }
 
     /** Returns the unstyled geometry as a rrect if possible. */
-    bool asRRect(SkRRect* rrect, SkPath::Direction* dir, unsigned* start, bool* inverted) const {
+    bool asRRect(SkRRect* rrect, SkPathDirection* dir, unsigned* start, bool* inverted) const {
         if (Type::kRRect != fType) {
             return false;
         }
@@ -255,12 +255,12 @@
             return false;
         }
 
-        SkPath::Direction dirs[2];
+        SkPathDirection dirs[2];
         if (!SkPathPriv::IsNestedFillRects(this->path(), rects, dirs)) {
             return false;
         }
 
-        if (SkPath::kWinding_FillType == this->path().getFillType() && dirs[0] == dirs[1]) {
+        if (SkPathFillType::kWinding == (SkPathFillType)this->path().getFillType() && dirs[0] == dirs[1]) {
             // The two rects need to be wound opposite to each other
             return false;
         }
@@ -550,15 +550,15 @@
     const SkPath* originalPathForListeners() const;
 
     // Defaults to use when there is no distinction between even/odd and winding fills.
-    static constexpr SkPath::FillType kDefaultPathFillType = SkPath::kEvenOdd_FillType;
-    static constexpr SkPath::FillType kDefaultPathInverseFillType =
-            SkPath::kInverseEvenOdd_FillType;
+    static constexpr SkPathFillType kDefaultPathFillType = SkPathFillType::kEvenOdd;
+    static constexpr SkPathFillType kDefaultPathInverseFillType =
+            SkPathFillType::kInverseEvenOdd;
 
-    static constexpr SkPath::Direction kDefaultRRectDir = SkPath::kCW_Direction;
+    static constexpr SkPathDirection kDefaultRRectDir = SkPathDirection::kCW;
     static constexpr unsigned kDefaultRRectStart = 0;
 
     static unsigned DefaultRectDirAndStartIndex(const SkRect& rect, bool hasPathEffect,
-                                                SkPath::Direction* dir) {
+                                                SkPathDirection* dir) {
         *dir = kDefaultRRectDir;
         // This comes from SkPath's interface. The default for adding a SkRect is counter clockwise
         // beginning at index 0 (which happens to correspond to rrect index 0 or 7).
@@ -575,11 +575,11 @@
             // 0 becomes start index 2 and times 2 to convert from rect the rrect indices.
             return 2 * 2;
         } else if (swapX) {
-            *dir = SkPath::kCCW_Direction;
+            *dir = SkPathDirection::kCCW;
             // 0 becomes start index 1 and times 2 to convert from rect the rrect indices.
             return 2 * 1;
         } else if (swapY) {
-            *dir = SkPath::kCCW_Direction;
+            *dir = SkPathDirection::kCCW;
             // 0 becomes start index 3 and times 2 to convert from rect the rrect indices.
             return 2 * 3;
         }
@@ -587,7 +587,7 @@
     }
 
     static unsigned DefaultRRectDirAndStartIndex(const SkRRect& rrect, bool hasPathEffect,
-                                                 SkPath::Direction* dir) {
+                                                 SkPathDirection* dir) {
         // This comes from SkPath's interface. The default for adding a SkRRect to a path is
         // clockwise beginning at starting index 6.
         static constexpr unsigned kPathRRectStartIdx = 6;
@@ -602,7 +602,7 @@
     union {
         struct {
             SkRRect fRRect;
-            SkPath::Direction fDir;
+            SkPathDirection fDir;
             unsigned fStart;
             bool fInverted;
         } fRRectData;