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/core/SkBlurMF.cpp b/src/core/SkBlurMF.cpp
index cb19ea4..9a4b8e2 100644
--- a/src/core/SkBlurMF.cpp
+++ b/src/core/SkBlurMF.cpp
@@ -370,7 +370,7 @@
SkPath path;
path.addRect(rects[0]);
path.addRect(rects[1]);
- path.setFillType(SkPathFillType::kEvenOdd);
+ path.setFillType(SkPath::kEvenOdd_FillType);
canvas.drawPath(path, paint);
}
return true;
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index f8dad04..9219f67 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -129,13 +129,13 @@
case DeviceSpaceType::kRect:
fDeviceSpacePath.init();
fDeviceSpacePath.get()->addRect(this->getDeviceSpaceRect());
- fDeviceSpacePath.get()->setFillType(SkPathFillType::kInverseEvenOdd);
+ fDeviceSpacePath.get()->setFillType(SkPath::kInverseEvenOdd_FillType);
fDeviceSpaceType = DeviceSpaceType::kPath;
break;
case DeviceSpaceType::kRRect:
fDeviceSpacePath.init();
fDeviceSpacePath.get()->addRRect(fDeviceSpaceRRect);
- fDeviceSpacePath.get()->setFillType(SkPathFillType::kInverseEvenOdd);
+ fDeviceSpacePath.get()->setFillType(SkPath::kInverseEvenOdd_FillType);
fDeviceSpaceType = DeviceSpaceType::kPath;
break;
case DeviceSpaceType::kPath:
@@ -752,7 +752,7 @@
bool isAA = false;
path->reset();
- path->setFillType(SkPathFillType::kInverseEvenOdd);
+ path->setFillType(SkPath::kInverseEvenOdd_FillType);
SkClipStack::Iter iter(*this, SkClipStack::Iter::kBottom_IterStart);
while (const SkClipStack::Element* element = iter.next()) {
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 6a31aee..b1d64b7 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -117,7 +117,7 @@
SkPath path;
path.addRRect(outer);
path.addRRect(inner);
- path.setFillType(SkPathFillType::kEvenOdd);
+ path.setFillType(SkPath::kEvenOdd_FillType);
path.setIsVolatile(true);
this->drawPath(path, paint, true);
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 296329a..e094da6 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -598,7 +598,7 @@
draw.fMatrix = matrix;
SkPath tmp;
tmp.addRect(prePaintRect);
- tmp.setFillType(SkPathFillType::kWinding);
+ tmp.setFillType(SkPath::kWinding_FillType);
draw.drawPath(tmp, paint, nullptr, true);
}
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 5679a9d..2d4d69f 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -151,7 +151,7 @@
void SkPath::resetFields() {
//fPathRef is assumed to have been emptied by the caller.
fLastMoveToIndex = INITIAL_LASTMOVETOINDEX_VALUE;
- fFillType = SkToU8(SkPathFillType::kWinding);
+ fFillType = kWinding_FillType;
this->setConvexityType(SkPathConvexityType::kUnknown);
this->setFirstDirection(SkPathPriv::kUnknown_FirstDirection);
@@ -1871,7 +1871,7 @@
"InverseWinding",
"InverseEvenOdd",
};
- builder.printf("path.setFillType(SkPathFillType::k%s);\n",
+ builder.printf("path.setFillType(SkPath::k%s_FillType);\n",
gFillTypeStrs[(int) this->getFillType()]);
while ((verb = iter.next(pts)) != kDone_Verb) {
switch (verb) {
@@ -2940,8 +2940,8 @@
break;
}
} while (!done);
- bool evenOddFill = SkPathFillType::kEvenOdd == this->getNewFillType()
- || SkPathFillType::kInverseEvenOdd == this->getNewFillType();
+ bool evenOddFill = SkPath::kEvenOdd_FillType == this->getFillType()
+ || SkPath::kInverseEvenOdd_FillType == this->getFillType();
if (evenOddFill) {
w &= 1;
}
@@ -3123,7 +3123,7 @@
path->reset();
path->setIsVolatile(true);
- path->setFillType(SkPathFillType::kWinding);
+ path->setFillType(SkPath::kWinding_FillType);
if (isFillNoPathEffect && SkScalarAbs(sweepAngle) >= 360.f) {
path->addOval(oval);
SkASSERT(path->isConvex() && DrawArcIsConvex(sweepAngle, false, isFillNoPathEffect));
diff --git a/src/core/SkPath_serial.cpp b/src/core/SkPath_serial.cpp
index b1d85f4..5c94c04 100644
--- a/src/core/SkPath_serial.cpp
+++ b/src/core/SkPath_serial.cpp
@@ -44,8 +44,8 @@
return packed & kVersion_SerializationMask;
}
-static SkPathFillType extract_filltype(uint32_t packed) {
- return static_cast<SkPathFillType>((packed >> kFillType_SerializationShift) & 0x3);
+static SkPath::FillType extract_filltype(uint32_t packed) {
+ return static_cast<SkPath::FillType>((packed >> kFillType_SerializationShift) & 0x3);
}
static SerializationType extract_serializationtype(uint32_t packed) {
@@ -167,7 +167,7 @@
SkASSERT(extract_serializationtype(packed) == SerializationType::kRRect);
uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3;
- SkPathFillType fillType = extract_filltype(packed);
+ FillType fillType = extract_filltype(packed);
SkPathDirection rrectDir;
SkRRect rrect;
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp
index 416df89..891018e 100644
--- a/src/core/SkScan_AAAPath.cpp
+++ b/src/core/SkScan_AAAPath.cpp
@@ -1545,7 +1545,7 @@
static void aaa_walk_edges(SkAnalyticEdge* prevHead,
SkAnalyticEdge* nextTail,
- SkPathFillType fillType,
+ SkPath::FillType fillType,
AdditiveBlitter* blitter,
int start_y,
int stop_y,
@@ -1569,8 +1569,10 @@
update_next_next_y(edge->fUpperY, y, &nextNextY);
}
- int windingMask = SkPathFillType_IsEvenOdd(fillType) ? 1 : -1;
- bool isInverse = SkPathFillType_IsInverse(fillType);
+ // returns 1 for evenodd, -1 for winding, regardless of inverse-ness
+ int windingMask = (fillType & 1) ? 1 : -1;
+
+ bool isInverse = SkPath::IsInverseFillType(fillType);
if (isInverse && SkIntToFixed(start_y) != y) {
int width = SkFixedFloorToInt(rightClip - leftClip);
@@ -1934,7 +1936,7 @@
aaa_walk_edges(&headEdge,
&tailEdge,
- path.getNewFillType(),
+ path.getFillType(),
blitter,
start_y,
stop_y,
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index cacc228..4271f4e 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -97,13 +97,14 @@
#define PREPOST_START true
#define PREPOST_END false
-static void walk_edges(SkEdge* prevHead, SkPathFillType fillType,
+static void walk_edges(SkEdge* prevHead, SkPath::FillType fillType,
SkBlitter* blitter, int start_y, int stop_y,
PrePostProc proc, int rightClip) {
validate_sort(prevHead->fNext);
int curr_y = start_y;
- int windingMask = SkPathFillType_IsEvenOdd(fillType) ? 1 : -1;
+ // returns 1 for evenodd, -1 for winding, regardless of inverse-ness
+ int windingMask = (fillType & 1) ? 1 : -1;
for (;;) {
int w = 0;
@@ -470,8 +471,8 @@
if (path.isConvex() && (nullptr == proc) && count >= 2) {
walk_simple_edges(&headEdge, blitter, start_y, stop_y);
} else {
- walk_edges(&headEdge, path.getNewFillType(), blitter, start_y, stop_y, proc,
- shiftedClip.right());
+ walk_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, proc,
+ shiftedClip.right());
}
}
diff --git a/src/gpu/GrDistanceFieldGenFromVector.cpp b/src/gpu/GrDistanceFieldGenFromVector.cpp
index 11e375c..29aa16d 100644
--- a/src/gpu/GrDistanceFieldGenFromVector.cpp
+++ b/src/gpu/GrDistanceFieldGenFromVector.cpp
@@ -763,7 +763,7 @@
workingPath = path;
}
- if (!IsDistanceFieldSupportedFillType(workingPath.getNewFillType())) {
+ if (!IsDistanceFieldSupportedFillType(workingPath.getFillType())) {
return false;
}
@@ -829,19 +829,15 @@
kOutside = 1
} dfSign;
- switch (workingPath.getNewFillType()) {
- case SkPathFillType::kWinding:
- dfSign = windingNumber ? kInside : kOutside;
- break;
- case SkPathFillType::kInverseWinding:
- dfSign = windingNumber ? kOutside : kInside;
- break;
- case SkPathFillType::kEvenOdd:
- dfSign = (windingNumber % 2) ? kInside : kOutside;
- break;
- case SkPathFillType::kInverseEvenOdd:
- dfSign = (windingNumber % 2) ? kOutside : kInside;
- break;
+ if (workingPath.getFillType() == SkPath::kWinding_FillType) {
+ dfSign = windingNumber ? kInside : kOutside;
+ } else if (workingPath.getFillType() == SkPath::kInverseWinding_FillType) {
+ dfSign = windingNumber ? kOutside : kInside;
+ } else if (workingPath.getFillType() == SkPath::kEvenOdd_FillType) {
+ dfSign = (windingNumber % 2) ? kInside : kOutside;
+ } else {
+ SkASSERT(workingPath.getFillType() == SkPath::kInverseEvenOdd_FillType);
+ dfSign = (windingNumber % 2) ? kOutside : kInside;
}
// The winding number at the end of a scanline should be zero.
diff --git a/src/gpu/GrDistanceFieldGenFromVector.h b/src/gpu/GrDistanceFieldGenFromVector.h
index 0362166..8e8d1b3 100644
--- a/src/gpu/GrDistanceFieldGenFromVector.h
+++ b/src/gpu/GrDistanceFieldGenFromVector.h
@@ -30,10 +30,10 @@
const SkPath& path, const SkMatrix& viewMatrix,
int width, int height, size_t rowBytes);
-inline bool IsDistanceFieldSupportedFillType(SkPathFillType fFillType)
+inline bool IsDistanceFieldSupportedFillType(SkPath::FillType fFillType)
{
- return (SkPathFillType::kEvenOdd == fFillType ||
- SkPathFillType::kInverseEvenOdd == fFillType);
+ return (SkPath::kEvenOdd_FillType == fFillType ||
+ SkPath::kInverseEvenOdd_FillType == fFillType);
}
#endif
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 8c9dde7..85dbe1a 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1315,7 +1315,7 @@
path.setIsVolatile(true);
path.addRRect(inner);
path.addRRect(outer);
- path.setFillType(SkPathFillType::kEvenOdd);
+ path.setFillType(SkPath::kEvenOdd_FillType);
this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, GrShape(path));
}
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 863e864..6f4fd44 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -861,15 +861,15 @@
}
}
-inline bool apply_fill_type(SkPathFillType fillType, int winding) {
+inline bool apply_fill_type(SkPath::FillType fillType, int winding) {
switch (fillType) {
- case SkPathFillType::kWinding:
+ case SkPath::kWinding_FillType:
return winding != 0;
- case SkPathFillType::kEvenOdd:
+ case SkPath::kEvenOdd_FillType:
return (winding & 1) != 0;
- case SkPathFillType::kInverseWinding:
+ case SkPath::kInverseWinding_FillType:
return winding == 1;
- case SkPathFillType::kInverseEvenOdd:
+ case SkPath::kInverseEvenOdd_FillType:
return (winding & 1) == 1;
default:
SkASSERT(false);
@@ -877,7 +877,7 @@
}
}
-inline bool apply_fill_type(SkPathFillType fillType, Poly* poly) {
+inline bool apply_fill_type(SkPath::FillType fillType, Poly* poly) {
return poly && apply_fill_type(fillType, poly->fWinding);
}
@@ -1699,7 +1699,7 @@
return polys;
}
-void remove_non_boundary_edges(const VertexList& mesh, SkPathFillType fillType,
+void remove_non_boundary_edges(const VertexList& mesh, SkPath::FillType fillType,
SkArenaAlloc& alloc) {
TESS_LOG("removing non-boundary edges\n");
EdgeList activeEdges;
@@ -2118,7 +2118,7 @@
outerMesh->append(outerVertices);
}
-void extract_boundary(EdgeList* boundary, Edge* e, SkPathFillType fillType, SkArenaAlloc& alloc) {
+void extract_boundary(EdgeList* boundary, Edge* e, SkPath::FillType fillType, SkArenaAlloc& alloc) {
TESS_LOG("\nextracting boundary\n");
bool down = apply_fill_type(fillType, e->fWinding);
Vertex* start = down ? e->fTop : e->fBottom;
@@ -2155,7 +2155,7 @@
// Stage 5b: Extract boundaries from mesh, simplify and stroke them into a new mesh.
void extract_boundaries(const VertexList& inMesh, VertexList* innerVertices,
- VertexList* outerVertices, SkPathFillType fillType,
+ VertexList* outerVertices, SkPath::FillType fillType,
Comparator& c, SkArenaAlloc& alloc) {
remove_non_boundary_edges(inMesh, fillType, alloc);
for (Vertex* v = inMesh.fHead; v; v = v->fNext) {
@@ -2205,7 +2205,7 @@
#endif
}
-Poly* contours_to_polys(VertexList* contours, int contourCnt, SkPathFillType fillType,
+Poly* contours_to_polys(VertexList* contours, int contourCnt, SkPath::FillType fillType,
const SkRect& pathBounds, bool antialias, VertexList* outerMesh,
SkArenaAlloc& alloc) {
Comparator c(pathBounds.width() > pathBounds.height() ? Comparator::Direction::kHorizontal
@@ -2260,7 +2260,7 @@
}
// Stage 6: Triangulate the monotone polygons into a vertex buffer.
-void* polys_to_triangles(Poly* polys, SkPathFillType fillType, bool emitCoverage, void* data) {
+void* polys_to_triangles(Poly* polys, SkPath::FillType fillType, bool emitCoverage, void* data) {
for (Poly* poly = polys; poly; poly = poly->fNext) {
if (apply_fill_type(fillType, poly)) {
data = poly->emit(emitCoverage, data);
@@ -2272,14 +2272,14 @@
Poly* path_to_polys(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds,
int contourCnt, SkArenaAlloc& alloc, bool antialias, bool* isLinear,
VertexList* outerMesh) {
- SkPathFillType fillType = path.getNewFillType();
- if (SkPathFillType_IsInverse(fillType)) {
+ SkPath::FillType fillType = path.getFillType();
+ if (SkPath::IsInverseFillType(fillType)) {
contourCnt++;
}
std::unique_ptr<VertexList[]> contours(new VertexList[contourCnt]);
path_to_contours(path, tolerance, clipBounds, contours.get(), alloc, isLinear);
- return contours_to_polys(contours.get(), contourCnt, path.getNewFillType(), path.getBounds(),
+ return contours_to_polys(contours.get(), contourCnt, path.getFillType(), path.getBounds(),
antialias, outerMesh, alloc);
}
@@ -2292,7 +2292,7 @@
return contourCnt;
}
-int64_t count_points(Poly* polys, SkPathFillType fillType) {
+int64_t count_points(Poly* polys, SkPath::FillType fillType) {
int64_t count = 0;
for (Poly* poly = polys; poly; poly = poly->fNext) {
if (apply_fill_type(fillType, poly) && poly->fCount >= 3) {
@@ -2343,7 +2343,7 @@
VertexList outerMesh;
Poly* polys = path_to_polys(path, tolerance, clipBounds, contourCnt, alloc, antialias,
isLinear, &outerMesh);
- SkPathFillType fillType = antialias ? SkPathFillType::kWinding : path.getNewFillType();
+ SkPath::FillType fillType = antialias ? SkPath::kWinding_FillType : path.getFillType();
int64_t count64 = count_points(polys, fillType);
if (antialias) {
count64 += count_outer_mesh_points(outerMesh);
@@ -2381,7 +2381,7 @@
bool isLinear;
Poly* polys = path_to_polys(path, tolerance, clipBounds, contourCnt, alloc, false, &isLinear,
nullptr);
- SkPathFillType fillType = path.getNewFillType();
+ SkPath::FillType fillType = path.getFillType();
int64_t count64 = count_points(polys, fillType);
if (0 == count64 || count64 > SK_MaxS32) {
*verts = nullptr;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 9428f18..cd3fbea 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -475,7 +475,7 @@
path.setIsVolatile(true);
path.addRRect(outer);
path.addRRect(inner);
- path.setFillType(SkPathFillType::kEvenOdd);
+ path.setFillType(SkPath::kEvenOdd_FillType);
// TODO: We are losing the possible mutability of the path here but this should probably be
// fixed by upgrading GrShape to handle DRRects.
diff --git a/src/gpu/ccpr/GrCCFiller.cpp b/src/gpu/ccpr/GrCCFiller.cpp
index a4a3cfd..f0a56bb 100644
--- a/src/gpu/ccpr/GrCCFiller.cpp
+++ b/src/gpu/ccpr/GrCCFiller.cpp
@@ -134,12 +134,12 @@
// We use "winding" fill type right now because we are producing a coverage count, and must
// fill in every region that has non-zero wind. The path processor will convert coverage
// count to the appropriate fill type later.
- fan.setFillType(SkPathFillType::kWinding);
+ fan.setFillType(SkPath::kWinding_FillType);
} else {
// When counting winding numbers in the stencil buffer, it works to use even/odd for the fan
// tessellation (where applicable). But we need to strip out inverse fill info because
// inverse-ness gets accounted for later on.
- fan.setFillType(SkPathFillType_ConvertToNonInverse(originalPath.getNewFillType()));
+ fan.setFillType(SkPath::ConvertToNonInverseFillType(originalPath.getFillType()));
}
SkASSERT(Verb::kBeginPath == verbs[verbsIdx]);
for (int i = verbsIdx + 1; i < verbs.count(); ++i) {
@@ -204,7 +204,7 @@
}
int weight = abs(tessWinding);
- if (SkPathFillType::kEvenOdd == fan.getNewFillType()) {
+ if (SkPath::kEvenOdd_FillType == fan.getFillType()) {
SkASSERT(Algorithm::kCoverageCount != algorithm); // Covg. count always uses winding.
if (weight != 1) {
// The tessellator doesn't wrap weights modulo 2 when we request even/odd fill type.
diff --git a/src/gpu/geometry/GrShape.cpp b/src/gpu/geometry/GrShape.cpp
index a510a19..bb4f92b 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++ = (uint32_t)path.getFillType();
+ *key++ = path.getFillType();
*key++ = verbCnt;
memcpy(key, SkPathPriv::VerbData(path), verbCnt * sizeof(uint8_t));
int verbKeySize = SkAlign4(verbCnt);
@@ -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++ = (uint32_t)this->path().getFillType();
+ *key++ = this->path().getFillType();
break;
}
}
diff --git a/src/gpu/geometry/GrShape.h b/src/gpu/geometry/GrShape.h
index ea87986..08146df 100644
--- a/src/gpu/geometry/GrShape.h
+++ b/src/gpu/geometry/GrShape.h
@@ -260,7 +260,7 @@
return false;
}
- if (SkPathFillType::kWinding == this->path().getNewFillType() && dirs[0] == dirs[1]) {
+ if (SkPath::kWinding_FillType == this->path().getFillType() && dirs[0] == dirs[1]) {
// The two rects need to be wound opposite to each other
return false;
}
@@ -550,8 +550,9 @@
const SkPath* originalPathForListeners() const;
// Defaults to use when there is no distinction between even/odd and winding fills.
- static constexpr SkPathFillType kDefaultPathFillType = SkPathFillType::kEvenOdd;
- static constexpr SkPathFillType kDefaultPathInverseFillType = SkPathFillType::kInverseEvenOdd;
+ static constexpr SkPath::FillType kDefaultPathFillType = SkPath::kEvenOdd_FillType;
+ static constexpr SkPath::FillType kDefaultPathInverseFillType =
+ SkPath::kInverseEvenOdd_FillType;
static constexpr SkPathDirection kDefaultRRectDir = SkPathDirection::kCW;
static constexpr unsigned kDefaultRRectStart = 0;
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index c588e28..e001bf9 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -193,15 +193,15 @@
/*
* For now paths only natively support winding and even odd fill types
*/
-static GrPathRendering::FillType convert_skpath_filltype(SkPathFillType fill) {
+static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill) {
switch (fill) {
default:
SK_ABORT("Incomplete Switch\n");
- case SkPathFillType::kWinding:
- case SkPathFillType::kInverseWinding:
+ case SkPath::kWinding_FillType:
+ case SkPath::kInverseWinding_FillType:
return GrPathRendering::kWinding_FillType;
- case SkPathFillType::kEvenOdd:
- case SkPathFillType::kInverseEvenOdd:
+ case SkPath::kEvenOdd_FillType:
+ case SkPath::kInverseEvenOdd_FillType:
return GrPathRendering::kEvenOdd_FillType;
}
}
@@ -317,7 +317,7 @@
fShouldFill = stroke.isFillStyle() ||
stroke.getStyle() == SkStrokeRec::kStrokeAndFill_Style;
- fFillType = convert_skpath_filltype(skPath->getNewFillType());
+ fFillType = convert_skpath_filltype(skPath->getFillType());
fBounds = skPath->getBounds();
SkScalar radius = stroke.getInflationRadius();
fBounds.outset(radius, radius);
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 6b8e502..4f8205f 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -540,11 +540,11 @@
}
lastPassIsBounds = false;
} else {
- switch (path.getNewFillType()) {
- case SkPathFillType::kInverseEvenOdd:
+ switch (path.getFillType()) {
+ case SkPath::kInverseEvenOdd_FillType:
reverse = true;
// fallthrough
- case SkPathFillType::kEvenOdd:
+ case SkPath::kEvenOdd_FillType:
passes[0] = &gEOStencilPass;
if (stencilOnly) {
passCount = 1;
@@ -560,10 +560,10 @@
}
break;
- case SkPathFillType::kInverseWinding:
+ case SkPath::kInverseWinding_FillType:
reverse = true;
// fallthrough
- case SkPathFillType::kWinding:
+ case SkPath::kWinding_FillType:
passes[0] = &gWindStencilPass;
passCount = 2;
if (stencilOnly) {
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;
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 7e88509..e58642f 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -506,7 +506,7 @@
maskDevice->makeFormXObjectFromDevice(dstMaskBounds, true), false,
SkPDFGraphicState::kLuminosity_SMaskMode, fDocument), content.stream());
SkPDFUtils::AppendRectangle(SkRect::Make(dstMaskBounds), content.stream());
- SkPDFUtils::PaintPath(SkPaint::kFill_Style, path.getNewFillType(), content.stream());
+ SkPDFUtils::PaintPath(SkPaint::kFill_Style, path.getFillType(), content.stream());
this->clearMaskOnGraphicState(content.stream());
}
@@ -593,7 +593,7 @@
paint->getStrokeCap() != SkPaint::kSquare_Cap);
SkPDFUtils::EmitPath(*pathPtr, paint->getStyle(), consumeDegeratePathSegments, content.stream(),
tolerance);
- SkPDFUtils::PaintPath(paint->getStyle(), pathPtr->getNewFillType(), content.stream());
+ SkPDFUtils::PaintPath(paint->getStyle(), pathPtr->getFillType(), content.stream());
}
////////////////////////////////////////////////////////////////////////////////
@@ -1561,7 +1561,7 @@
maskDevice->makeFormXObjectFromDevice(maskDeviceBounds, true), false,
SkPDFGraphicState::kLuminosity_SMaskMode, fDocument), content.stream());
SkPDFUtils::AppendRectangle(SkRect::Make(this->size()), content.stream());
- SkPDFUtils::PaintPath(SkPaint::kFill_Style, SkPathFillType::kWinding, content.stream());
+ SkPDFUtils::PaintPath(SkPaint::kFill_Style, SkPath::kWinding_FillType, content.stream());
this->clearMaskOnGraphicState(content.stream());
return;
}
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index f1c0142..426a9f9 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -596,7 +596,7 @@
if (path && !path->isEmpty()) {
setGlyphWidthAndBoundingBox(glyph->advanceX(), glyphBBox, &content);
SkPDFUtils::EmitPath(*path, SkPaint::kFill_Style, &content);
- SkPDFUtils::PaintPath(SkPaint::kFill_Style, path->getNewFillType(), &content);
+ SkPDFUtils::PaintPath(SkPaint::kFill_Style, path->getFillType(), &content);
} else {
auto pimg = to_image(gID, &smallGlyphs);
if (!pimg.fImage) {
diff --git a/src/pdf/SkPDFGradientShader.cpp b/src/pdf/SkPDFGradientShader.cpp
index ad2a65d..919c07a 100644
--- a/src/pdf/SkPDFGradientShader.cpp
+++ b/src/pdf/SkPDFGradientShader.cpp
@@ -780,7 +780,7 @@
}
SkPDFUtils::ApplyPattern(patternIndex, &content);
SkPDFUtils::AppendRectangle(bounds, &content);
- SkPDFUtils::PaintPath(SkPaint::kFill_Style, SkPathFillType::kEvenOdd, &content);
+ SkPDFUtils::PaintPath(SkPaint::kFill_Style, SkPath::kEvenOdd_FillType, &content);
return content.detachAsStream();
}
diff --git a/src/pdf/SkPDFGraphicStackState.cpp b/src/pdf/SkPDFGraphicStackState.cpp
index af2fa19..a27170b 100644
--- a/src/pdf/SkPDFGraphicStackState.cpp
+++ b/src/pdf/SkPDFGraphicStackState.cpp
@@ -104,10 +104,10 @@
static void append_clip_path(const SkPath& clipPath, SkWStream* wStream) {
SkPDFUtils::EmitPath(clipPath, SkPaint::kFill_Style, wStream);
- SkPathFillType clipFill = clipPath.getNewFillType();
- NOT_IMPLEMENTED(clipFill == SkPathFillType::kInverseEvenOdd, false);
- NOT_IMPLEMENTED(clipFill == SkPathFillType::kInverseWinding, false);
- if (clipFill == SkPathFillType::kEvenOdd) {
+ SkPath::FillType clipFill = clipPath.getFillType();
+ NOT_IMPLEMENTED(clipFill == SkPath::kInverseEvenOdd_FillType, false);
+ NOT_IMPLEMENTED(clipFill == SkPath::kInverseWinding_FillType, false);
+ if (clipFill == SkPath::kEvenOdd_FillType) {
wStream->writeText("W* n\n");
} else {
wStream->writeText("W n\n");
diff --git a/src/pdf/SkPDFUtils.cpp b/src/pdf/SkPDFUtils.cpp
index f00362e..0564b0f 100644
--- a/src/pdf/SkPDFUtils.cpp
+++ b/src/pdf/SkPDFUtils.cpp
@@ -132,7 +132,7 @@
if (path.isRect(&rect, &isClosed, &direction) &&
isClosed &&
(SkPathDirection::kCW == direction ||
- SkPathFillType::kEvenOdd == path.getNewFillType()))
+ SkPath::kEvenOdd_FillType == path.getFillType()))
{
SkPDFUtils::AppendRectangle(rect, content);
return;
@@ -213,7 +213,8 @@
content->writeText("h\n");
}
-void SkPDFUtils::PaintPath(SkPaint::Style style, SkPathFillType fill, SkWStream* content) {
+void SkPDFUtils::PaintPath(SkPaint::Style style, SkPath::FillType fill,
+ SkWStream* content) {
if (style == SkPaint::kFill_Style) {
content->writeText("f");
} else if (style == SkPaint::kStrokeAndFill_Style) {
@@ -223,9 +224,9 @@
}
if (style != SkPaint::kStroke_Style) {
- NOT_IMPLEMENTED(fill == SkPathFillType::kInverseEvenOdd, false);
- NOT_IMPLEMENTED(fill == SkPathFillType::kInverseWinding, false);
- if (fill == SkPathFillType::kEvenOdd) {
+ NOT_IMPLEMENTED(fill == SkPath::kInverseEvenOdd_FillType, false);
+ NOT_IMPLEMENTED(fill == SkPath::kInverseWinding_FillType, false);
+ if (fill == SkPath::kEvenOdd_FillType) {
content->writeText("*");
}
}
@@ -233,7 +234,8 @@
}
void SkPDFUtils::StrokePath(SkWStream* content) {
- SkPDFUtils::PaintPath(SkPaint::kStroke_Style, SkPathFillType::kWinding, content);
+ SkPDFUtils::PaintPath(
+ SkPaint::kStroke_Style, SkPath::kWinding_FillType, content);
}
void SkPDFUtils::ApplyGraphicState(int objectIndex, SkWStream* content) {
diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h
index d4c9845..90b1c57 100644
--- a/src/pdf/SkPDFUtils.h
+++ b/src/pdf/SkPDFUtils.h
@@ -58,7 +58,8 @@
SkPDFUtils::EmitPath(path, paintStyle, true, content, tolerance);
}
void ClosePath(SkWStream* content);
-void PaintPath(SkPaint::Style style, SkPathFillType fill, SkWStream* content);
+void PaintPath(SkPaint::Style style, SkPath::FillType fill,
+ SkWStream* content);
void StrokePath(SkWStream* content);
void ApplyGraphicState(int objectIndex, SkWStream* content);
void ApplyPattern(int objectIndex, SkWStream* content);
diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp
index cb84960..7ee26f7 100644
--- a/src/svg/SkSVGDevice.cpp
+++ b/src/svg/SkSVGDevice.cpp
@@ -728,7 +728,7 @@
const auto& p = e->getDeviceSpacePath();
AutoElement path("path", fWriter);
path.addPathAttributes(p);
- if (p.getNewFillType() == SkPathFillType::kEvenOdd) {
+ if (p.getFillType() == SkPath::kEvenOdd_FillType) {
path.addAttribute("clip-rule", "evenodd");
}
} break;
@@ -852,7 +852,7 @@
elem.addPathAttributes(path);
// TODO: inverse fill types?
- if (path.getNewFillType() == SkPathFillType::kEvenOdd) {
+ if (path.getFillType() == SkPath::kEvenOdd_FillType) {
elem.addAttribute("fill-rule", "evenodd");
}
}
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index c634d5b..2f1482e 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1248,22 +1248,22 @@
return 1;
}
-static const char* fill_type_to_str(SkPathFillType fill) {
+static const char* fill_type_to_str(SkPath::FillType fill) {
switch (fill) {
- case SkPathFillType::kEvenOdd:
+ case SkPath::kEvenOdd_FillType:
return "even-odd";
- case SkPathFillType::kWinding:
+ case SkPath::kWinding_FillType:
return "winding";
- case SkPathFillType::kInverseEvenOdd:
+ case SkPath::kInverseEvenOdd_FillType:
return "inverse-even-odd";
- case SkPathFillType::kInverseWinding:
+ case SkPath::kInverseWinding_FillType:
return "inverse-winding";
}
return "unknown";
}
static int lpath_getFillType(lua_State* L) {
- SkPathFillType fill = get_obj<SkPath>(L, 1)->getNewFillType();
+ SkPath::FillType fill = get_obj<SkPath>(L, 1)->getFillType();
SkLua(L).pushString(fill_type_to_str(fill));
return 1;
}
diff --git a/src/utils/win/SkDWriteGeometrySink.cpp b/src/utils/win/SkDWriteGeometrySink.cpp
index 3979a13..65da6ae 100644
--- a/src/utils/win/SkDWriteGeometrySink.cpp
+++ b/src/utils/win/SkDWriteGeometrySink.cpp
@@ -49,10 +49,10 @@
SK_STDMETHODIMP_(void) SkDWriteGeometrySink::SetFillMode(D2D1_FILL_MODE fillMode) {
switch (fillMode) {
case D2D1_FILL_MODE_ALTERNATE:
- fPath->setFillType(SkPathFillType::kEvenOdd);
+ fPath->setFillType(SkPath::kEvenOdd_FillType);
break;
case D2D1_FILL_MODE_WINDING:
- fPath->setFillType(SkPathFillType::kWinding);
+ fPath->setFillType(SkPath::kWinding_FillType);
break;
default:
SkDEBUGFAIL("Unknown D2D1_FILL_MODE.");
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index 87b5dfa..7a4ff99 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -1182,7 +1182,7 @@
if (rect_must_be_pathed(paint, this->localToDevice())) {
SkPath tmp;
tmp.addRect(r);
- tmp.setFillType(SkPathFillType::kWinding);
+ tmp.setFillType(SkPath::kWinding_FillType);
this->drawPath(tmp, paint, true);
return;
}
@@ -1608,13 +1608,13 @@
SkPath* xpsCompatiblePath = fillablePath;
XPS_FILL_RULE xpsFillRule;
switch (fillablePath->getFillType()) {
- case SkPathFillType::kWinding:
+ case SkPath::kWinding_FillType:
xpsFillRule = XPS_FILL_RULE_NONZERO;
break;
- case SkPathFillType::kEvenOdd:
+ case SkPath::kEvenOdd_FillType:
xpsFillRule = XPS_FILL_RULE_EVENODD;
break;
- case SkPathFillType::kInverseWinding: {
+ case SkPath::kInverseWinding_FillType: {
//[Fillable-path (inverse winding) -> XPS-path (inverse even odd)]
if (!pathIsMutable) {
xpsCompatiblePath = &modifiedPath;
@@ -1626,7 +1626,7 @@
}
}
// The xpsCompatiblePath is now inverse even odd, so fall through.
- case SkPathFillType::kInverseEvenOdd: {
+ case SkPath::kInverseEvenOdd_FillType: {
const SkRect universe = SkRect::MakeLTRB(
0, 0,
this->fCurrentCanvasSize.fWidth,