Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224eecf8393f3cdc08c4c9800b2321c20.
Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
diff --git a/docs/examples/Canvas_clipPath.cpp b/docs/examples/Canvas_clipPath.cpp
index 3b6d43d8..c87ccc1 100644
--- a/docs/examples/Canvas_clipPath.cpp
+++ b/docs/examples/Canvas_clipPath.cpp
@@ -8,13 +8,13 @@
paint.setAntiAlias(true);
SkPath path;
path.addRect({20, 30, 100, 110});
- path.setFillType(SkPath::kInverseWinding_FillType);
+ path.setFillType(SkPathFillType::kInverseWinding);
canvas->save();
canvas->clipPath(path, SkClipOp::kDifference, false);
canvas->drawCircle(70, 100, 60, paint);
canvas->restore();
canvas->translate(100, 100);
- path.setFillType(SkPath::kWinding_FillType);
+ path.setFillType(SkPathFillType::kWinding);
canvas->clipPath(path, SkClipOp::kIntersect, false);
canvas->drawCircle(70, 100, 60, paint);
}
diff --git a/docs/examples/Canvas_clipPath_2.cpp b/docs/examples/Canvas_clipPath_2.cpp
index 963c8d7..1bea1e0 100644
--- a/docs/examples/Canvas_clipPath_2.cpp
+++ b/docs/examples/Canvas_clipPath_2.cpp
@@ -9,13 +9,13 @@
SkPath path;
path.addRect({20, 15, 100, 95});
path.addRect({50, 65, 130, 135});
- path.setFillType(SkPath::kWinding_FillType);
+ path.setFillType(SkPathFillType::kWinding);
canvas->save();
canvas->clipPath(path, SkClipOp::kIntersect);
canvas->drawCircle(70, 85, 60, paint);
canvas->restore();
canvas->translate(100, 100);
- path.setFillType(SkPath::kEvenOdd_FillType);
+ path.setFillType(SkPathFillType::kEvenOdd);
canvas->clipPath(path, SkClipOp::kIntersect);
canvas->drawCircle(70, 85, 60, paint);
}
diff --git a/docs/examples/Canvas_clipPath_3.cpp b/docs/examples/Canvas_clipPath_3.cpp
index 9988a80..3a1c516 100644
--- a/docs/examples/Canvas_clipPath_3.cpp
+++ b/docs/examples/Canvas_clipPath_3.cpp
@@ -10,13 +10,13 @@
SkPoint poly[] = {{20, 20}, { 80, 20}, { 80, 80}, {40, 80},
{40, 40}, {100, 40}, {100, 100}, {20, 100}};
path.addPoly(poly, SK_ARRAY_COUNT(poly), true);
- path.setFillType(SkPath::kWinding_FillType);
+ path.setFillType(SkPathFillType::kWinding);
canvas->save();
canvas->clipPath(path, SkClipOp::kIntersect);
canvas->drawCircle(50, 50, 45, paint);
canvas->restore();
canvas->translate(100, 100);
- path.setFillType(SkPath::kEvenOdd_FillType);
+ path.setFillType(SkPathFillType::kEvenOdd);
canvas->clipPath(path, SkClipOp::kIntersect);
canvas->drawCircle(50, 50, 45, paint);
}
diff --git a/docs/examples/Canvas_drawPath.cpp b/docs/examples/Canvas_drawPath.cpp
index d62374d..2a5460b 100644
--- a/docs/examples/Canvas_drawPath.cpp
+++ b/docs/examples/Canvas_drawPath.cpp
@@ -24,9 +24,9 @@
canvas->translate(-240, 60);
}
paint.setStyle(SkPaint::kFill_Style);
- for (auto fill : { SkPath::kWinding_FillType,
- SkPath::kEvenOdd_FillType,
- SkPath::kInverseWinding_FillType } ) {
+ for (auto fill : { SkPathFillType::kWinding,
+ SkPathFillType::kEvenOdd,
+ SkPathFillType::kInverseWinding } ) {
path.setFillType(fill);
canvas->save();
canvas->clipRect({0, 10, 80, 70});
diff --git a/docs/examples/Path_ConvertToNonInverseFillType.cpp b/docs/examples/Path_ConvertToNonInverseFillType.cpp
index 12e2d1f..d60857f 100644
--- a/docs/examples/Path_ConvertToNonInverseFillType.cpp
+++ b/docs/examples/Path_ConvertToNonInverseFillType.cpp
@@ -3,25 +3,25 @@
#include "tools/fiddle/examples.h"
// HASH=319f6b124458dcc0f9ce4d7bbde65810
REG_FIDDLE(Path_ConvertToNonInverseFillType, 256, 256, true, 0) {
-#define nameValue(fill) { SkPath::fill, #fill }
+#define nameValue(fill) { SkPathFillType::fill, #fill }
void draw(SkCanvas* canvas) {
struct {
- SkPath::FillType fill;
+ SkPathFillType fill;
const char* name;
} fills[] = {
- nameValue(kWinding_FillType),
- nameValue(kEvenOdd_FillType),
- nameValue(kInverseWinding_FillType),
- nameValue(kInverseEvenOdd_FillType),
+ nameValue(kWinding),
+ nameValue(kEvenOdd),
+ nameValue(kInverseWinding),
+ nameValue(kInverseEvenOdd),
};
for (unsigned i = 0; i < SK_ARRAY_COUNT(fills); ++i) {
- if (fills[i].fill != (SkPath::FillType) i) {
+ if (fills[i].fill != (SkPathFillType) i) {
SkDebugf("fills array order does not match FillType enum order");
break;
}
SkDebugf("ConvertToNonInverseFillType(%s) == %s\n", fills[i].name,
- fills[(int) SkPath::ConvertToNonInverseFillType(fills[i].fill)].name);
+ fills[(int) SkPathFillType_ConvertToNonInverse(fills[i].fill)].name);
}
}
} // END FIDDLE
diff --git a/docs/examples/Path_FillType_a.cpp b/docs/examples/Path_FillType_a.cpp
index caed39a..d19c2c3 100644
--- a/docs/examples/Path_FillType_a.cpp
+++ b/docs/examples/Path_FillType_a.cpp
@@ -14,8 +14,8 @@
SkRect clipRect = {0, 0, 51, 100};
canvas->drawPath(path, strokePaint);
SkPaint fillPaint;
- for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
- SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {
+ for (auto fillType : { SkPathFillType::kWinding, SkPathFillType::kEvenOdd,
+ SkPathFillType::kInverseWinding, SkPathFillType::kInverseEvenOdd } ) {
canvas->translate(51, 0);
canvas->save();
canvas->clipRect(clipRect);
diff --git a/docs/examples/Path_FillType_b.cpp b/docs/examples/Path_FillType_b.cpp
index 110117e..4c1b83c 100644
--- a/docs/examples/Path_FillType_b.cpp
+++ b/docs/examples/Path_FillType_b.cpp
@@ -22,8 +22,8 @@
canvas->scale(.5f, .5f);
canvas->drawString("inverse", 384, 150, textPaint);
SkPaint fillPaint;
- for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
- SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {
+ for (auto fillType : { SkPathFillType::kWinding, SkPathFillType::kEvenOdd,
+ SkPathFillType::kInverseWinding, SkPathFillType::kInverseEvenOdd } ) {
canvas->save();
canvas->clipRect(clipRect);
path.setFillType(fillType);
diff --git a/docs/examples/Path_IsInverseFillType.cpp b/docs/examples/Path_IsInverseFillType.cpp
index 1b2cb10..3d2e5f0 100644
--- a/docs/examples/Path_IsInverseFillType.cpp
+++ b/docs/examples/Path_IsInverseFillType.cpp
@@ -3,20 +3,20 @@
#include "tools/fiddle/examples.h"
// HASH=1453856a9d0c73e8192bf298c4143563
REG_FIDDLE(Path_IsInverseFillType, 256, 256, true, 0) {
-#define nameValue(fill) { SkPath::fill, #fill }
+#define nameValue(fill) { SkPathFillType::fill, #fill }
void draw(SkCanvas* canvas) {
struct {
- SkPath::FillType fill;
+ SkPathFillType fill;
const char* name;
} fills[] = {
- nameValue(kWinding_FillType),
- nameValue(kEvenOdd_FillType),
- nameValue(kInverseWinding_FillType),
- nameValue(kInverseEvenOdd_FillType),
+ nameValue(kWinding),
+ nameValue(kEvenOdd),
+ nameValue(kInverseWinding),
+ nameValue(kInverseEvenOdd),
};
for (auto fill: fills ) {
- SkDebugf("IsInverseFillType(%s) == %s\n", fill.name, SkPath::IsInverseFillType(fill.fill) ?
+ SkDebugf("IsInverseFillType(%s) == %s\n", fill.name, SkPathFillType_IsInverse(fill.fill) ?
"true" : "false");
}
}
diff --git a/docs/examples/Path_dumpHex.cpp b/docs/examples/Path_dumpHex.cpp
index 2578ab5..25af4cd 100644
--- a/docs/examples/Path_dumpHex.cpp
+++ b/docs/examples/Path_dumpHex.cpp
@@ -7,7 +7,7 @@
SkPath path, copy;
path.lineTo(6.f / 7, 2.f / 3);
path.dumpHex();
- copy.setFillType(SkPath::kWinding_FillType);
+ copy.setFillType(SkPathFillType::kWinding);
copy.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
copy.lineTo(SkBits2Float(0x3f5b6db7), SkBits2Float(0x3f2aaaab)); // 0.857143f, 0.666667f
SkDebugf("path is " "%s" "equal to copy\n", path == copy ? "" : "not ");
diff --git a/docs/examples/Path_dump_2.cpp b/docs/examples/Path_dump_2.cpp
index 37defe2..7220d0c 100644
--- a/docs/examples/Path_dump_2.cpp
+++ b/docs/examples/Path_dump_2.cpp
@@ -7,7 +7,7 @@
SkPath path, copy;
path.lineTo(6.f / 7, 2.f / 3);
path.dump();
- copy.setFillType(SkPath::kWinding_FillType);
+ copy.setFillType(SkPathFillType::kWinding);
copy.moveTo(0, 0);
copy.lineTo(0.857143f, 0.666667f);
SkDebugf("path is " "%s" "equal to copy\n", path == copy ? "" : "not ");
diff --git a/docs/examples/Path_getFillType.cpp b/docs/examples/Path_getFillType.cpp
index 6ac58d1..f4e1cc7 100644
--- a/docs/examples/Path_getFillType.cpp
+++ b/docs/examples/Path_getFillType.cpp
@@ -6,9 +6,9 @@
void draw(SkCanvas* canvas) {
SkPath path;
SkDebugf("default path fill type is %s\n",
- path.getFillType() == SkPath::kWinding_FillType ? "kWinding_FillType" :
- path.getFillType() == SkPath::kEvenOdd_FillType ? "kEvenOdd_FillType" :
- path.getFillType() == SkPath::kInverseWinding_FillType ? "kInverseWinding_FillType" :
- "kInverseEvenOdd_FillType");
+ path.getNewFillType() == SkPathFillType::kWinding ? "kWinding" :
+ path.getNewFillType() == SkPathFillType::kEvenOdd ? "kEvenOdd" :
+ path.getNewFillType() == SkPathFillType::kInverseWinding ? "kInverseWinding" :
+ "kInverseEvenOdd");
}
} // END FIDDLE
diff --git a/docs/examples/Path_reset.cpp b/docs/examples/Path_reset.cpp
index 8448db1..b720d33 100644
--- a/docs/examples/Path_reset.cpp
+++ b/docs/examples/Path_reset.cpp
@@ -5,7 +5,7 @@
REG_FIDDLE(Path_reset, 256, 256, true, 0) {
void draw(SkCanvas* canvas) {
SkPath path1, path2;
- path1.setFillType(SkPath::kInverseWinding_FillType);
+ path1.setFillType(SkPathFillType::kInverseWinding);
path1.addRect({10, 20, 30, 40});
SkDebugf("path1 %c= path2\n", path1 == path2 ? '=' : '!');
path1.reset();
diff --git a/docs/examples/Path_rewind.cpp b/docs/examples/Path_rewind.cpp
index 6776191..74a2683 100644
--- a/docs/examples/Path_rewind.cpp
+++ b/docs/examples/Path_rewind.cpp
@@ -5,7 +5,7 @@
REG_FIDDLE(Path_rewind, 256, 256, true, 0) {
void draw(SkCanvas* canvas) {
SkPath path1, path2;
- path1.setFillType(SkPath::kInverseWinding_FillType);
+ path1.setFillType(SkPathFillType::kInverseWinding);
path1.addRect({10, 20, 30, 40});
SkDebugf("path1 %c= path2\n", path1 == path2 ? '=' : '!');
path1.rewind();
diff --git a/docs/examples/Path_setFillType.cpp b/docs/examples/Path_setFillType.cpp
index 0bed8a8..937fb69 100644
--- a/docs/examples/Path_setFillType.cpp
+++ b/docs/examples/Path_setFillType.cpp
@@ -5,7 +5,7 @@
REG_FIDDLE(Path_setFillType, 256, 64, false, 0) {
void draw(SkCanvas* canvas) {
SkPath path;
- path.setFillType(SkPath::kInverseWinding_FillType);
+ path.setFillType(SkPathFillType::kInverseWinding);
SkPaint paint;
paint.setColor(SK_ColorBLUE);
canvas->drawPath(path, paint);
diff --git a/docs/examples/Region_op_6.cpp b/docs/examples/Region_op_6.cpp
index 13c9205..9fbf850 100644
--- a/docs/examples/Region_op_6.cpp
+++ b/docs/examples/Region_op_6.cpp
@@ -9,9 +9,9 @@
paint.setTextSize(128);
SkPath xPath, opPath;
paint.getTextPath("X", 1, 20, 110, &xPath);
- xPath.setFillType(SkPath::kInverseWinding_FillType);
+ xPath.setFillType(SkPathFillType::kInverseWinding);
opPath.addCircle(64, 64, frame * 64);
- opPath.setFillType(SkPath::kInverseWinding_FillType);
+ opPath.setFillType(SkPathFillType::kInverseWinding);
SkRegion xRegion, opRegion, rectRegion;
SkIRect drawBounds = {0, 0, 128, 128};
opRegion.setPath(opPath, SkRegion(drawBounds));