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/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;