switched GrClipEdge to an enum class

Bug: skia:
Change-Id: Idf41580314a32739c70721530fc3ca48e566b044
Reviewed-on: https://skia-review.googlesource.com/70023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 706e2c8..ebcd27b 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -159,9 +159,9 @@
                 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)},
                 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}
             };
-            for(GrClipEdgeType edgeType : {kFillBW_GrClipEdgeType,
-                                           kFillAA_GrClipEdgeType,
-                                           kHairlineAA_GrClipEdgeType}) {
+            for(GrClipEdgeType edgeType : {GrClipEdgeType::kFillBW,
+                                           GrClipEdgeType::kFillAA,
+                                           GrClipEdgeType::kHairlineAA}) {
                 SkScalar x = col * w;
                 SkScalar y = row * h;
                 SkPoint controlPts[] = {
@@ -343,7 +343,7 @@
                 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}
             };
             SkScalar weight = rand.nextRangeF(0.f, 2.f);
-            for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType) {
+            for(int edgeType = 0; edgeType < kGrClipEdgeTypeCnt; ++edgeType) {
                 sk_sp<GrGeometryProcessor> gp;
                 GrClipEdgeType et = (GrClipEdgeType)edgeType;
                 gp = GrConicEffect::Make(color, SkMatrix::I(), et,
@@ -551,7 +551,7 @@
                 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)},
                 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}
             };
-            for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType) {
+            for(int edgeType = 0; edgeType < kGrClipEdgeTypeCnt; ++edgeType) {
                 sk_sp<GrGeometryProcessor> gp;
                 GrClipEdgeType et = (GrClipEdgeType)edgeType;
                 gp = GrQuadEffect::Make(color, SkMatrix::I(), et,
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index c04f3e7..62c9da8 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -61,8 +61,8 @@
         int y = kPad;
         int x = kPad;
         constexpr GrClipEdgeType kEdgeTypes[] = {
-            kFillAA_GrClipEdgeType,
-            kInverseFillAA_GrClipEdgeType,
+            GrClipEdgeType::kFillAA,
+            GrClipEdgeType::kInverseFillAA,
         };
         SkRect testBounds = SkRect::MakeIWH(fTestWidth, fTestHeight);
         for (size_t et = 0; et < SK_ARRAY_COUNT(kEdgeTypes); ++et) {
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 0814b0b..ca27e28 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -192,7 +192,7 @@
             const SkPath* path = iter.get();
             SkScalar x = 0;
 
-            for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
+            for (int et = 0; et < kGrClipEdgeTypeCnt; ++et) {
                 const SkMatrix m = SkMatrix::MakeTrans(x, y);
                 SkPath p;
                 path->transform(m, &p);
@@ -234,7 +234,7 @@
 
             SkScalar x = 0;
 
-            for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
+            for (int et = 0; et < kGrClipEdgeTypeCnt; ++et) {
                 SkRect rect = *iter.get();
                 rect.offset(x, y);
                 GrClipEdgeType edgeType = (GrClipEdgeType) et;
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 431f017..217e528 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -83,7 +83,7 @@
 #endif
 
 #if SK_SUPPORT_GPU
-        int lastEdgeType = (kEffect_Type == fType) ? kLast_GrClipEdgeType: 0;
+        int lastEdgeType = (kEffect_Type == fType) ? (int) GrClipEdgeType::kLast: 0;
 #else
         int lastEdgeType = 0;
 #endif
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index f23b686..4376642 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -649,46 +649,46 @@
  * GrProcessorEdgeType will succeed with all values and it is up to the caller to check for
  * a NULL return.
  */
-enum GrClipEdgeType {
-    kFillBW_GrClipEdgeType,
-    kFillAA_GrClipEdgeType,
-    kInverseFillBW_GrClipEdgeType,
-    kInverseFillAA_GrClipEdgeType,
-    kHairlineAA_GrClipEdgeType,
+enum class GrClipEdgeType {
+    kFillBW,
+    kFillAA,
+    kInverseFillBW,
+    kInverseFillAA,
+    kHairlineAA,
 
-    kLast_GrClipEdgeType = kHairlineAA_GrClipEdgeType
+    kLast = kHairlineAA
 };
 
-static const int kGrProcessorEdgeTypeCnt = kLast_GrClipEdgeType + 1;
+static const int kGrClipEdgeTypeCnt = (int) GrClipEdgeType::kLast + 1;
 
 static inline bool GrProcessorEdgeTypeIsFill(const GrClipEdgeType edgeType) {
-    return (kFillAA_GrClipEdgeType == edgeType || kFillBW_GrClipEdgeType == edgeType);
+    return (GrClipEdgeType::kFillAA == edgeType || GrClipEdgeType::kFillBW == edgeType);
 }
 
 static inline bool GrProcessorEdgeTypeIsInverseFill(const GrClipEdgeType edgeType) {
-    return (kInverseFillAA_GrClipEdgeType == edgeType ||
-            kInverseFillBW_GrClipEdgeType == edgeType);
+    return (GrClipEdgeType::kInverseFillAA == edgeType ||
+            GrClipEdgeType::kInverseFillBW == edgeType);
 }
 
 static inline bool GrProcessorEdgeTypeIsAA(const GrClipEdgeType edgeType) {
-    return (kFillBW_GrClipEdgeType != edgeType &&
-            kInverseFillBW_GrClipEdgeType != edgeType);
+    return (GrClipEdgeType::kFillBW != edgeType &&
+            GrClipEdgeType::kInverseFillBW != edgeType);
 }
 
 static inline GrClipEdgeType GrInvertProcessorEdgeType(const GrClipEdgeType edgeType) {
     switch (edgeType) {
-        case kFillBW_GrClipEdgeType:
-            return kInverseFillBW_GrClipEdgeType;
-        case kFillAA_GrClipEdgeType:
-            return kInverseFillAA_GrClipEdgeType;
-        case kInverseFillBW_GrClipEdgeType:
-            return kFillBW_GrClipEdgeType;
-        case kInverseFillAA_GrClipEdgeType:
-            return kFillAA_GrClipEdgeType;
-        case kHairlineAA_GrClipEdgeType:
+        case GrClipEdgeType::kFillBW:
+            return GrClipEdgeType::kInverseFillBW;
+        case GrClipEdgeType::kFillAA:
+            return GrClipEdgeType::kInverseFillAA;
+        case GrClipEdgeType::kInverseFillBW:
+            return GrClipEdgeType::kFillBW;
+        case GrClipEdgeType::kInverseFillAA:
+            return GrClipEdgeType::kFillAA;
+        case GrClipEdgeType::kHairlineAA:
             SK_ABORT("Hairline fill isn't invertible.");
     }
-    return kFillAA_GrClipEdgeType;  // suppress warning.
+    return GrClipEdgeType::kFillAA;  // suppress warning.
 }
 
 /**
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 99acc53..c0fe106 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -212,10 +212,10 @@
                     return false;
                 }
                 edgeType =
-                    invert ? kInverseFillAA_GrClipEdgeType : kFillAA_GrClipEdgeType;
+                    invert ? GrClipEdgeType::kInverseFillAA : GrClipEdgeType::kFillAA;
             } else {
                 edgeType =
-                    invert ? kInverseFillBW_GrClipEdgeType : kFillBW_GrClipEdgeType;
+                    invert ? GrClipEdgeType::kInverseFillBW : GrClipEdgeType::kFillBW;
             }
 
             switch (iter.get()->getDeviceSpaceType()) {
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index ecb325a..141b45a 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1228,11 +1228,11 @@
 
     GrClipEdgeType innerEdgeType, outerEdgeType;
     if (GrAAType::kCoverage == aaType) {
-        innerEdgeType = kInverseFillAA_GrClipEdgeType;
-        outerEdgeType = kFillAA_GrClipEdgeType;
+        innerEdgeType = GrClipEdgeType::kInverseFillAA;
+        outerEdgeType = GrClipEdgeType::kFillAA;
     } else {
-        innerEdgeType = kInverseFillBW_GrClipEdgeType;
-        outerEdgeType = kFillBW_GrClipEdgeType;
+        innerEdgeType = GrClipEdgeType::kInverseFillBW;
+        outerEdgeType = GrClipEdgeType::kFillBW;
     }
 
     SkTCopyOnFirstWrite<SkRRect> inner(origInner), outer(origOuter);
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 86469b2..ffd7b06 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -125,7 +125,7 @@
     fragBuilder->declAppend(func);
 
     switch (fEdgeType) {
-        case kHairlineAA_GrClipEdgeType: {
+        case GrClipEdgeType::kHairlineAA: {
             fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn());
             fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn());
             fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;",
@@ -153,7 +153,7 @@
             // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);");
             break;
         }
-        case kFillAA_GrClipEdgeType: {
+        case GrClipEdgeType::kFillAA: {
             fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn());
             fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn());
             fragBuilder->codeAppendf("%s ="
@@ -182,7 +182,7 @@
             // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);");
             break;
         }
-        case kFillBW_GrClipEdgeType: {
+        case GrClipEdgeType::kFillBW: {
             fragBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;",
                                      edgeAlpha.c_str(), v.fsIn(), v.fsIn(), v.fsIn(), v.fsIn());
             fragBuilder->codeAppendf("%s = float(%s < 0.0);",
@@ -255,7 +255,7 @@
     do {
         GrClipEdgeType edgeType =
                 static_cast<GrClipEdgeType>(
-                        d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+                        d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
         gp = GrConicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
                                  edgeType, *d->caps(), GrTest::TestMatrix(d->fRandom),
                                  d->fRandom->nextBool());
@@ -358,7 +358,7 @@
     fragBuilder->codeAppendf("half edgeAlpha;");
 
     switch (fEdgeType) {
-        case kHairlineAA_GrClipEdgeType: {
+        case GrClipEdgeType::kHairlineAA: {
             fragBuilder->codeAppendf("half2 duvdx = dFdx(%s.xy);", v.fsIn());
             fragBuilder->codeAppendf("half2 duvdy = dFdy(%s.xy);", v.fsIn());
             fragBuilder->codeAppendf("half2 gF = half2(2.0 * %s.x * duvdx.x - duvdx.y,"
@@ -372,7 +372,7 @@
             // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);");
             break;
         }
-        case kFillAA_GrClipEdgeType: {
+        case GrClipEdgeType::kFillAA: {
             fragBuilder->codeAppendf("half2 duvdx = dFdx(%s.xy);", v.fsIn());
             fragBuilder->codeAppendf("half2 duvdy = dFdy(%s.xy);", v.fsIn());
             fragBuilder->codeAppendf("half2 gF = half2(2.0 * %s.x * duvdx.x - duvdx.y,"
@@ -386,7 +386,7 @@
             // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);");
             break;
         }
-        case kFillBW_GrClipEdgeType: {
+        case GrClipEdgeType::kFillBW: {
             fragBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);",
                                      v.fsIn(), v.fsIn(), v.fsIn());
             fragBuilder->codeAppend("edgeAlpha = half(edgeAlpha < 0.0);");
@@ -456,7 +456,7 @@
     sk_sp<GrGeometryProcessor> gp;
     do {
         GrClipEdgeType edgeType = static_cast<GrClipEdgeType>(
-                d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+                d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
         gp = GrQuadEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom), edgeType,
                                 *d->caps(), GrTest::TestMatrix(d->fRandom),
                                 d->fRandom->nextBool());
@@ -561,7 +561,7 @@
 
 
     GrGLSLVertToFrag gradCoeffs(kFloat4_GrSLType);
-    if (kFillAA_GrClipEdgeType == fEdgeType || kHairlineAA_GrClipEdgeType == fEdgeType) {
+    if (GrClipEdgeType::kFillAA == fEdgeType || GrClipEdgeType::kHairlineAA == fEdgeType) {
         varyingHandler->addVarying("GradCoeffs", &gradCoeffs);
         vertBuilder->codeAppendf("float k = %s[0], l = %s[1], m = %s[2];",
                                  v.vsOut(), v.vsOut(), v.vsOut());
@@ -592,7 +592,7 @@
     fragBuilder->declAppend(func);
 
     switch (fEdgeType) {
-        case kHairlineAA_GrClipEdgeType: {
+        case GrClipEdgeType::kHairlineAA: {
             fragBuilder->codeAppendf("%s = %s.x * %s.xy + %s.zw;",
                                      gF.c_str(), v.fsIn(), gradCoeffs.fsIn(), gradCoeffs.fsIn());
             fragBuilder->codeAppendf("%s = %s.x * %s.x * %s.x - %s.y * %s.z;",
@@ -609,7 +609,7 @@
             //                        edgeAlpha.c_str());
             break;
         }
-        case kFillAA_GrClipEdgeType: {
+        case GrClipEdgeType::kFillAA: {
             fragBuilder->codeAppendf("%s = %s.x * %s.xy + %s.zw;",
                                      gF.c_str(), v.fsIn(), gradCoeffs.fsIn(), gradCoeffs.fsIn());
             fragBuilder->codeAppendf("%s = %s.x * %s.x * %s.x - %s.y * %s.z;",
@@ -625,7 +625,7 @@
             //                        edgeAlpha.c_str());
             break;
         }
-        case kFillBW_GrClipEdgeType: {
+        case GrClipEdgeType::kFillBW: {
             fragBuilder->codeAppendf("%s = %s.x * %s.x * %s.x - %s.y * %s.z;",
                                      edgeAlpha.c_str(), v.fsIn(), v.fsIn(),
                                      v.fsIn(), v.fsIn(), v.fsIn());
@@ -681,7 +681,7 @@
     do {
         GrClipEdgeType edgeType =
                 static_cast<GrClipEdgeType>(
-                        d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+                        d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
         gp = GrCubicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
                                  GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool(), edgeType,
                                  *d->caps());
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h
index 3aac887..267259e 100644
--- a/src/gpu/effects/GrBezierEffect.h
+++ b/src/gpu/effects/GrBezierEffect.h
@@ -65,24 +65,24 @@
                                            bool usesLocalCoords,
                                            uint8_t coverage = 0xff) {
         switch (edgeType) {
-            case kFillAA_GrClipEdgeType:
+            case GrClipEdgeType::kFillAA:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return nullptr;
                 }
                 return sk_sp<GrGeometryProcessor>(
-                    new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrClipEdgeType,
+                    new GrConicEffect(color, viewMatrix, coverage, GrClipEdgeType::kFillAA,
                                       localMatrix, usesLocalCoords));
-            case kHairlineAA_GrClipEdgeType:
+            case GrClipEdgeType::kHairlineAA:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return nullptr;
                 }
                 return sk_sp<GrGeometryProcessor>(
                     new GrConicEffect(color, viewMatrix, coverage,
-                                      kHairlineAA_GrClipEdgeType, localMatrix,
+                                      GrClipEdgeType::kHairlineAA, localMatrix,
                                       usesLocalCoords));
-            case kFillBW_GrClipEdgeType:
+            case GrClipEdgeType::kFillBW:
                 return sk_sp<GrGeometryProcessor>(
-                    new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrClipEdgeType,
+                    new GrConicEffect(color, viewMatrix, coverage, GrClipEdgeType::kFillBW,
                                       localMatrix, usesLocalCoords));
             default:
                 return nullptr;
@@ -147,24 +147,24 @@
                                            bool usesLocalCoords,
                                            uint8_t coverage = 0xff) {
         switch (edgeType) {
-            case kFillAA_GrClipEdgeType:
+            case GrClipEdgeType::kFillAA:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return nullptr;
                 }
                 return sk_sp<GrGeometryProcessor>(
-                    new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrClipEdgeType,
+                    new GrQuadEffect(color, viewMatrix, coverage, GrClipEdgeType::kFillAA,
                                      localMatrix, usesLocalCoords));
-            case kHairlineAA_GrClipEdgeType:
+            case GrClipEdgeType::kHairlineAA:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return nullptr;
                 }
                 return sk_sp<GrGeometryProcessor>(
                     new GrQuadEffect(color, viewMatrix, coverage,
-                                     kHairlineAA_GrClipEdgeType, localMatrix,
+                                     GrClipEdgeType::kHairlineAA, localMatrix,
                                      usesLocalCoords));
-            case kFillBW_GrClipEdgeType:
+            case GrClipEdgeType::kFillBW:
                 return sk_sp<GrGeometryProcessor>(
-                    new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrClipEdgeType,
+                    new GrQuadEffect(color, viewMatrix, coverage, GrClipEdgeType::kFillBW,
                                      localMatrix, usesLocalCoords));
             default:
                 return nullptr;
@@ -240,15 +240,15 @@
         }
 
         switch (edgeType) {
-            case kFillAA_GrClipEdgeType:
+            case GrClipEdgeType::kFillAA:
                 return sk_sp<GrGeometryProcessor>(
-                    new GrCubicEffect(color, viewMatrix, devKLM, kFillAA_GrClipEdgeType));
-            case kHairlineAA_GrClipEdgeType:
+                    new GrCubicEffect(color, viewMatrix, devKLM, GrClipEdgeType::kFillAA));
+            case GrClipEdgeType::kHairlineAA:
                 return sk_sp<GrGeometryProcessor>(
-                    new GrCubicEffect(color, viewMatrix, devKLM, kHairlineAA_GrClipEdgeType));
-            case kFillBW_GrClipEdgeType:
+                    new GrCubicEffect(color, viewMatrix, devKLM, GrClipEdgeType::kHairlineAA));
+            case GrClipEdgeType::kFillBW:
                 return sk_sp<GrGeometryProcessor>(
-                    new GrCubicEffect(color, viewMatrix, devKLM, kFillBW_GrClipEdgeType));
+                    new GrCubicEffect(color, viewMatrix, devKLM, GrClipEdgeType::kFillBW));
             default:
                 return nullptr;
         }
diff --git a/src/gpu/effects/GrCircleEffect.cpp b/src/gpu/effects/GrCircleEffect.cpp
index 0c998d5..eccf8bf 100644
--- a/src/gpu/effects/GrCircleEffect.cpp
+++ b/src/gpu/effects/GrCircleEffect.cpp
@@ -111,9 +111,9 @@
     SkScalar radius = testData->fRandom->nextRangeF(0.f, 1000.f);
     GrClipEdgeType et;
     do {
-        et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
-    } while (kHairlineAA_GrClipEdgeType == et);
-    return GrCircleEffect::Make(et, center, radius);
+        et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
+    } while (GrClipEdgeType::kHairlineAA == et);
+    return GrCircleEffect::Make((int)et, center, radius);
 }
 #endif
 #endif
diff --git a/src/gpu/effects/GrCircleEffect.fp b/src/gpu/effects/GrCircleEffect.fp
index 04edc5d..95cbeb0 100644
--- a/src/gpu/effects/GrCircleEffect.fp
+++ b/src/gpu/effects/GrCircleEffect.fp
@@ -37,15 +37,15 @@
     // radius and then denormalized. This is to prevent overflow on devices that have a "real"
     // mediump. It'd be nice to only do this on mediump devices.
     half d;
-    @if (edgeType == 2 /* kInverseFillBW_GrClipEdgeType */ ||
-         edgeType == 3 /* kInverseFillAA_GrClipEdgeType */) {
+    @if (edgeType == 2 /* GrClipEdgeType::kInverseFillBW */ ||
+         edgeType == 3 /* GrClipEdgeType::kInverseFillAA */) {
         d = (length((circle.xy - sk_FragCoord.xy) * circle.w) - 1.0) * circle.z;
     } else {
         d = (1.0 - length((circle.xy - sk_FragCoord.xy) *  circle.w)) * circle.z;
     }
-    @if (edgeType == 1 /* kFillAA_GrClipEdgeType */ ||
-         edgeType == 3 /* kInverseFillAA_GrClipEdgeType */ ||
-         edgeType == 4 /* kHairlineAA_GrClipEdgeType */) {
+    @if (edgeType == 1 /* GrClipEdgeType::kFillAA */ ||
+         edgeType == 3 /* GrClipEdgeType::kInverseFillAA */ ||
+         edgeType == 4 /* GrClipEdgeType::kHairlineAA */) {
         d = clamp(d, 0.0, 1.0);
     } else {
         d = d > 0.5 ? 1.0 : 0.0;
@@ -61,7 +61,7 @@
     SkScalar radius = testData->fRandom->nextRangeF(0.f, 1000.f);
     GrClipEdgeType et;
     do {
-        et = (GrClipEdgeType) testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
-    } while (kHairlineAA_GrClipEdgeType == et);
-    return GrCircleEffect::Make(et, center, radius);
+        et = (GrClipEdgeType) testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
+    } while (GrClipEdgeType::kHairlineAA == et);
+    return GrCircleEffect::Make((int) et, center, radius);
 }
\ No newline at end of file
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 4da2898..d3954fc 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -66,7 +66,7 @@
     std::unique_ptr<GrFragmentProcessor> fp;
     do {
         GrClipEdgeType edgeType = static_cast<GrClipEdgeType>(
-                d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+                d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
 
         fp = AARectEffect::Make(edgeType, rect);
     } while (nullptr == fp);
@@ -144,7 +144,7 @@
 void GLAARectEffect::GenKey(const GrProcessor& processor, const GrShaderCaps&,
                             GrProcessorKeyBuilder* b) {
     const AARectEffect& aare = processor.cast<AARectEffect>();
-    b->add32(aare.getEdgeType());
+    b->add32((int) aare.getEdgeType());
 }
 
 void AARectEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
@@ -221,8 +221,8 @@
 void GrGLConvexPolyEffect::GenKey(const GrProcessor& processor, const GrShaderCaps&,
                                   GrProcessorKeyBuilder* b) {
     const GrConvexPolyEffect& cpe = processor.cast<GrConvexPolyEffect>();
-    GR_STATIC_ASSERT(kGrProcessorEdgeTypeCnt <= 8);
-    uint32_t key = (cpe.getEdgeCount() << 3) | cpe.getEdgeType();
+    GR_STATIC_ASSERT(kGrClipEdgeTypeCnt <= 8);
+    uint32_t key = (cpe.getEdgeCount() << 3) | (int) cpe.getEdgeType();
     b->add32(key);
 }
 
@@ -230,7 +230,7 @@
 
 std::unique_ptr<GrFragmentProcessor> GrConvexPolyEffect::Make(GrClipEdgeType type,
                                                               const SkPath& path) {
-    if (kHairlineAA_GrClipEdgeType == type) {
+    if (GrClipEdgeType::kHairlineAA == type) {
         return nullptr;
     }
     if (path.getSegmentMasks() != SkPath::kLine_SegmentMask ||
@@ -301,7 +301,7 @@
 
 std::unique_ptr<GrFragmentProcessor> GrConvexPolyEffect::Make(GrClipEdgeType edgeType,
                                                               const SkRect& rect) {
-    if (kHairlineAA_GrClipEdgeType == edgeType){
+    if (GrClipEdgeType::kHairlineAA == edgeType){
         return nullptr;
     }
     return AARectEffect::Make(edgeType, rect);
@@ -365,7 +365,7 @@
     std::unique_ptr<GrFragmentProcessor> fp;
     do {
         GrClipEdgeType edgeType = static_cast<GrClipEdgeType>(
-                d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+                d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
         fp = GrConvexPolyEffect::Make(edgeType, count, edges);
     } while (nullptr == fp);
     return fp;
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index 6202d60..d2ab4c9 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -40,7 +40,7 @@
      */
     static std::unique_ptr<GrFragmentProcessor> Make(GrClipEdgeType edgeType, int n,
                                                      const SkScalar edges[]) {
-        if (n <= 0 || n > kMaxEdges || kHairlineAA_GrClipEdgeType == edgeType) {
+        if (n <= 0 || n > kMaxEdges || GrClipEdgeType::kHairlineAA == edgeType) {
             return nullptr;
         }
         return std::unique_ptr<GrFragmentProcessor>(new GrConvexPolyEffect(edgeType, n, edges));
diff --git a/src/gpu/effects/GrEllipseEffect.cpp b/src/gpu/effects/GrEllipseEffect.cpp
index 9556a63..20afa93 100644
--- a/src/gpu/effects/GrEllipseEffect.cpp
+++ b/src/gpu/effects/GrEllipseEffect.cpp
@@ -138,9 +138,9 @@
     SkScalar ry = testData->fRandom->nextRangeF(0.f, 1000.f);
     GrClipEdgeType et;
     do {
-        et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
-    } while (kHairlineAA_GrClipEdgeType == et);
-    return GrEllipseEffect::Make(et, center, SkPoint::Make(rx, ry));
+        et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
+    } while (GrClipEdgeType::kHairlineAA == et);
+    return GrEllipseEffect::Make((int)et, center, SkPoint::Make(rx, ry));
 }
 #endif
 #endif
diff --git a/src/gpu/effects/GrEllipseEffect.fp b/src/gpu/effects/GrEllipseEffect.fp
index 8effaeb..f3feae1 100644
--- a/src/gpu/effects/GrEllipseEffect.fp
+++ b/src/gpu/effects/GrEllipseEffect.fp
@@ -72,16 +72,16 @@
 
     half alpha;
     @switch (edgeType) {
-        case 0 /* kFillBW_GrClipEdgeType */:
+        case 0 /* GrClipEdgeType::kFillBW */:
             alpha = approx_dist > 0.0 ? 0.0 : 1.0;
             break;
-        case 1 /* kFillAA_GrClipEdgeType */:
+        case 1 /* GrClipEdgeType::kFillAA */:
             alpha = clamp(0.5 - approx_dist, 0.0, 1.0);
             break;
-        case 2 /* kInverseFillBW_GrClipEdgeType */:
+        case 2 /* GrClipEdgeType::kInverseFillBW */:
             alpha = approx_dist > 0.0 ? 1.0 : 0.0;
             break;
-        case 3 /* kInverseFillAA_GrClipEdgeType */:
+        case 3 /* GrClipEdgeType::kInverseFillAA */:
             alpha = clamp(0.5 + approx_dist, 0.0, 1.0);
             break;
         default:
@@ -99,7 +99,7 @@
     SkScalar ry = testData->fRandom->nextRangeF(0.f, 1000.f);
     GrClipEdgeType et;
     do {
-        et = (GrClipEdgeType) testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
-    } while (kHairlineAA_GrClipEdgeType == et);
-    return GrEllipseEffect::Make(et, center, SkPoint::Make(rx, ry));
+        et = (GrClipEdgeType) testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
+    } while (GrClipEdgeType::kHairlineAA == et);
+    return GrEllipseEffect::Make((int) et, center, SkPoint::Make(rx, ry));
 }
\ No newline at end of file
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index ed90a7b..60ea9df 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -13,18 +13,19 @@
 
 std::unique_ptr<GrFragmentProcessor> GrOvalEffect::Make(GrClipEdgeType edgeType,
                                                         const SkRect& oval) {
-    if (kHairlineAA_GrClipEdgeType == edgeType) {
+    if (GrClipEdgeType::kHairlineAA == edgeType) {
         return nullptr;
     }
     SkScalar w = oval.width();
     SkScalar h = oval.height();
     if (SkScalarNearlyEqual(w, h)) {
         w /= 2;
-        return GrCircleEffect::Make(edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + w), w);
+        return GrCircleEffect::Make((int) edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + w),
+                                    w);
     } else {
         w /= 2;
         h /= 2;
-        return GrEllipseEffect::Make(edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + h),
+        return GrEllipseEffect::Make((int) edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + h),
                                      SkPoint::Make(w, h));
     }
 
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 1247c2f..4b56443 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -81,7 +81,7 @@
 std::unique_ptr<GrFragmentProcessor> CircularRRectEffect::Make(GrClipEdgeType edgeType,
                                                                uint32_t circularCornerFlags,
                                                                const SkRRect& rrect) {
-    if (kFillAA_GrClipEdgeType != edgeType && kInverseFillAA_GrClipEdgeType != edgeType) {
+    if (GrClipEdgeType::kFillAA != edgeType && GrClipEdgeType::kInverseFillAA != edgeType) {
         return nullptr;
     }
     return std::unique_ptr<GrFragmentProcessor>(
@@ -121,7 +121,7 @@
     std::unique_ptr<GrFragmentProcessor> fp;
     do {
         GrClipEdgeType et =
-                (GrClipEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
+                (GrClipEdgeType)d->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
         fp = GrRRectEffect::Make(et, rrect);
     } while (nullptr == fp);
     return fp;
@@ -277,7 +277,7 @@
             break;
     }
 
-    if (kInverseFillAA_GrClipEdgeType == crre.getEdgeType()) {
+    if (GrClipEdgeType::kInverseFillAA == crre.getEdgeType()) {
         fragBuilder->codeAppend("alpha = 1.0 - alpha;");
     }
 
@@ -287,8 +287,8 @@
 void GLCircularRRectEffect::GenKey(const GrProcessor& processor, const GrShaderCaps&,
                                    GrProcessorKeyBuilder* b) {
     const CircularRRectEffect& crre = processor.cast<CircularRRectEffect>();
-    GR_STATIC_ASSERT(kGrProcessorEdgeTypeCnt <= 8);
-    b->add32((crre.getCircularCornerFlags() << 3) | crre.getEdgeType());
+    GR_STATIC_ASSERT(kGrClipEdgeTypeCnt <= 8);
+    b->add32((crre.getCircularCornerFlags() << 3) | (int) crre.getEdgeType());
 }
 
 void GLCircularRRectEffect::onSetData(const GrGLSLProgramDataManager& pdman,
@@ -417,7 +417,7 @@
 
 std::unique_ptr<GrFragmentProcessor> EllipticalRRectEffect::Make(GrClipEdgeType edgeType,
                                                                  const SkRRect& rrect) {
-    if (kFillAA_GrClipEdgeType != edgeType && kInverseFillAA_GrClipEdgeType != edgeType) {
+    if (GrClipEdgeType::kFillAA != edgeType && GrClipEdgeType::kInverseFillAA != edgeType) {
         return nullptr;
     }
     return std::unique_ptr<GrFragmentProcessor>(new EllipticalRRectEffect(edgeType, rrect));
@@ -472,7 +472,7 @@
     }
     std::unique_ptr<GrFragmentProcessor> fp;
     do {
-        GrClipEdgeType et = (GrClipEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
+        GrClipEdgeType et = (GrClipEdgeType)d->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
         fp = GrRRectEffect::Make(et, rrect);
     } while (nullptr == fp);
     return fp;
@@ -584,7 +584,7 @@
         fragBuilder->codeAppendf("approx_dist *= %s.x;", scaleName);
     }
 
-    if (kFillAA_GrClipEdgeType == erre.getEdgeType()) {
+    if (GrClipEdgeType::kFillAA == erre.getEdgeType()) {
         fragBuilder->codeAppend("half alpha = clamp(0.5 - approx_dist, 0.0, 1.0);");
     } else {
         fragBuilder->codeAppend("half alpha = clamp(0.5 + approx_dist, 0.0, 1.0);");
@@ -596,8 +596,8 @@
 void GLEllipticalRRectEffect::GenKey(const GrProcessor& effect, const GrShaderCaps&,
                                      GrProcessorKeyBuilder* b) {
     const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>();
-    GR_STATIC_ASSERT(kLast_GrClipEdgeType < (1 << 3));
-    b->add32(erre.getRRect().getType() | erre.getEdgeType() << 3);
+    GR_STATIC_ASSERT((int) GrClipEdgeType::kLast < (1 << 3));
+    b->add32(erre.getRRect().getType() | (int) erre.getEdgeType() << 3);
 }
 
 void GLEllipticalRRectEffect::onSetData(const GrGLSLProgramDataManager& pdman,
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index 0382720..2dcee7a 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -978,7 +978,7 @@
     if (quadCount || conicCount) {
         sk_sp<GrGeometryProcessor> quadGP(GrQuadEffect::Make(this->color(),
                                                              *geometryProcessorViewM,
-                                                             kHairlineAA_GrClipEdgeType,
+                                                             GrClipEdgeType::kHairlineAA,
                                                              target->caps(),
                                                              *geometryProcessorLocalM,
                                                              fHelper.usesLocalCoords(),
@@ -986,7 +986,7 @@
 
         sk_sp<GrGeometryProcessor> conicGP(GrConicEffect::Make(this->color(),
                                                                *geometryProcessorViewM,
-                                                               kHairlineAA_GrClipEdgeType,
+                                                               GrClipEdgeType::kHairlineAA,
                                                                target->caps(),
                                                                *geometryProcessorLocalM,
                                                                fHelper.usesLocalCoords(),