Revert "switch to new filltype for SkPath"
This reverts commit 3a50981a834b1502151038e3e511fe78805ab0e3.
Reason for revert: chrome win build found compile-problem in xpsdevice
Original change's description:
> switch to new filltype for SkPath
>
> Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=fmalita@chromium.org,reed@google.com
Change-Id: Iacb3566da61c2512b9bd6b7e42b592febc85e031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256530
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/pathops/SkOpBuilder.cpp b/src/pathops/SkOpBuilder.cpp
index 8a9eccd..9dac160 100644
--- a/src/pathops/SkOpBuilder.cpp
+++ b/src/pathops/SkOpBuilder.cpp
@@ -36,11 +36,11 @@
}
bool SkOpBuilder::FixWinding(SkPath* path) {
- SkPathFillType fillType = path->getNewFillType();
- if (fillType == SkPathFillType::kInverseEvenOdd) {
- fillType = SkPathFillType::kInverseWinding;
- } else if (fillType == SkPathFillType::kEvenOdd) {
- fillType = SkPathFillType::kWinding;
+ SkPath::FillType fillType = path->getFillType();
+ if (fillType == SkPath::kInverseEvenOdd_FillType) {
+ fillType = SkPath::kInverseWinding_FillType;
+ } else if (fillType == SkPath::kEvenOdd_FillType) {
+ fillType = SkPath::kWinding_FillType;
}
SkPathPriv::FirstDirection dir;
if (one_contour(*path) && SkPathPriv::CheapComputeFirstDirection(*path, &dir)) {
diff --git a/src/pathops/SkOpEdgeBuilder.cpp b/src/pathops/SkOpEdgeBuilder.cpp
index 7e97c03..3efb0e0 100644
--- a/src/pathops/SkOpEdgeBuilder.cpp
+++ b/src/pathops/SkOpEdgeBuilder.cpp
@@ -10,7 +10,7 @@
void SkOpEdgeBuilder::init() {
fOperand = false;
- fXorMask[0] = fXorMask[1] = ((int)fPath->getFillType() & 1) ? kEvenOdd_PathOpsMask
+ fXorMask[0] = fXorMask[1] = (fPath->getFillType() & 1) ? kEvenOdd_PathOpsMask
: kWinding_PathOpsMask;
fUnparseable = false;
fSecondHalf = preFetch();
@@ -40,7 +40,7 @@
SkASSERT(fPathVerbs.count() > 0 && fPathVerbs.end()[-1] == SkPath::kDone_Verb);
fPathVerbs.pop();
fPath = &path;
- fXorMask[1] = ((int)fPath->getFillType() & 1) ? kEvenOdd_PathOpsMask
+ fXorMask[1] = (fPath->getFillType() & 1) ? kEvenOdd_PathOpsMask
: kWinding_PathOpsMask;
preFetch();
}
diff --git a/src/pathops/SkPathOpsAsWinding.cpp b/src/pathops/SkPathOpsAsWinding.cpp
index 3f7050d..b3d92a9 100644
--- a/src/pathops/SkPathOpsAsWinding.cpp
+++ b/src/pathops/SkPathOpsAsWinding.cpp
@@ -367,7 +367,7 @@
const SkPath& fPath;
};
-static bool set_result_path(SkPath* result, const SkPath& path, SkPathFillType fillType) {
+static bool set_result_path(SkPath* result, const SkPath& path, SkPath::FillType fillType) {
*result = path;
result->setFillType(fillType);
return true;
@@ -377,13 +377,13 @@
if (!path.isFinite()) {
return false;
}
- SkPathFillType fillType = path.getNewFillType();
- if (fillType == SkPathFillType::kWinding
- || fillType == SkPathFillType::kInverseWinding ) {
+ SkPath::FillType fillType = path.getFillType();
+ if (fillType == SkPath::kWinding_FillType
+ || fillType == SkPath::kInverseWinding_FillType ) {
return set_result_path(result, path, fillType);
}
- fillType = path.isInverseFillType() ? SkPathFillType::kInverseWinding :
- SkPathFillType::kWinding;
+ fillType = path.isInverseFillType() ? SkPath::kInverseWinding_FillType :
+ SkPath::kWinding_FillType;
if (path.isEmpty() || path.isConvex()) {
return set_result_path(result, path, fillType);
}
diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp
index b610e9b..da4e76b 100644
--- a/src/pathops/SkPathOpsDebug.cpp
+++ b/src/pathops/SkPathOpsDebug.cpp
@@ -2901,10 +2901,10 @@
}
static const char* gFillTypeStr[] = {
- "kWinding",
- "kEvenOdd",
- "kInverseWinding",
- "kInverseEvenOdd"
+ "kWinding_FillType",
+ "kEvenOdd_FillType",
+ "kInverseWinding_FillType",
+ "kInverseEvenOdd_FillType"
};
void SkPathOpsDebug::ShowOnePath(const SkPath& path, const char* name, bool includeDeclaration) {
@@ -2927,12 +2927,12 @@
return;
}
#endif
- SkPathFillType fillType = path.getNewFillType();
- SkASSERT(fillType >= SkPathFillType::kWinding && fillType <= SkPathFillType::kInverseEvenOdd);
+ SkPath::FillType fillType = path.getFillType();
+ SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInverseEvenOdd_FillType);
if (includeDeclaration) {
SkDebugf(" SkPath %s;\n", name);
}
- SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[(int)fillType]);
+ SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]);
iter.setPath(path);
showPathContours(iter, name);
}
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp
index 2c89f35..825ae7b 100644
--- a/src/pathops/SkPathOpsOp.cpp
+++ b/src/pathops/SkPathOpsOp.cpp
@@ -248,8 +248,8 @@
#endif
op = gOpInverse[op][one.isInverseFillType()][two.isInverseFillType()];
bool inverseFill = gOutInverse[op][one.isInverseFillType()][two.isInverseFillType()];
- SkPathFillType fillType = inverseFill ? SkPathFillType::kInverseEvenOdd :
- SkPathFillType::kEvenOdd;
+ SkPath::FillType fillType = inverseFill ? SkPath::kInverseEvenOdd_FillType :
+ SkPath::kEvenOdd_FillType;
SkRect rect1, rect2;
if (kIntersect_SkPathOp == op && one.isRect(&rect1) && two.isRect(&rect2)) {
result->reset();
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index 6c522f4..f079b50 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -140,8 +140,8 @@
bool SimplifyDebug(const SkPath& path, SkPath* result
SkDEBUGPARAMS(bool skipAssert) SkDEBUGPARAMS(const char* testName)) {
// returns 1 for evenodd, -1 for winding, regardless of inverse-ness
- SkPathFillType fillType = path.isInverseFillType() ? SkPathFillType::kInverseEvenOdd
- : SkPathFillType::kEvenOdd;
+ SkPath::FillType fillType = path.isInverseFillType() ? SkPath::kInverseEvenOdd_FillType
+ : SkPath::kEvenOdd_FillType;
if (path.isConvex()) {
if (result != &path) {
*result = path;