aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-11-10 11:58:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-10 17:42:27 +0000
commit1706f842086c089ebc496dfc7f45c959e5eda01e (patch)
tree3221e9f852ec68f995e5668d3ef613ce11f84e5d /include
parent5e9dfdbf4209fd6b41b1bc52190dabb32ae77e51 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/private/GrTypesPriv.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index f23b686e8f..437664275c 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -649,46 +649,46 @@ enum class GrSLRestrict {
* 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,
-
- kLast_GrClipEdgeType = kHairlineAA_GrClipEdgeType
+enum class GrClipEdgeType {
+ kFillBW,
+ kFillAA,
+ kInverseFillBW,
+ kInverseFillAA,
+ kHairlineAA,
+
+ 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.
}
/**