Revert "add guard to switch to SkPathTypes"
This reverts commit e1af44498b6e40c448811e6efc4412272cc10ca7.
Reason for revert: breaking google3?
Original change's description:
> add guard to switch to SkPathTypes
>
> Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=robertphillips@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com
Change-Id: If1fffb6310921ee6f213af000da793afcf62ab0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/modules/pathkit/pathkit_wasm_bindings.cpp b/modules/pathkit/pathkit_wasm_bindings.cpp
index 7e2f285..c47af69 100644
--- a/modules/pathkit/pathkit_wasm_bindings.cpp
+++ b/modules/pathkit/pathkit_wasm_bindings.cpp
@@ -318,7 +318,7 @@
// Path2D API things
// ======================================================================================
void ApplyAddRect(SkPath& path, SkScalar x, SkScalar y, SkScalar width, SkScalar height) {
- path.addRect({x, y, x+width, y+height});
+ path.addRect(x, y, x+width, y+height);
}
void ApplyAddArc(SkPath& path, SkScalar x, SkScalar y, SkScalar radius,
@@ -356,9 +356,9 @@
}
JSString GetFillTypeString(const SkPath& path) {
- if ((SkPathFillType)path.getFillType() == SkPathFillType::kWinding) {
+ if (path.getFillType() == SkPath::FillType::kWinding_FillType) {
return emscripten::val("nonzero");
- } else if ((SkPathFillType)path.getFillType() == SkPathFillType::kEvenOdd) {
+ } else if (path.getFillType() == SkPath::FillType::kEvenOdd_FillType) {
return emscripten::val("evenodd");
} else {
SkDebugf("warning: can't translate inverted filltype to HTML Canvas\n");
@@ -503,7 +503,7 @@
.function("_rect", &ApplyAddRect)
// Extra features
- .function("setFillType", select_overload<void(SkPathFillType)>(&SkPath::setFillType))
+ .function("setFillType", &SkPath::setFillType)
.function("getFillType", &SkPath::getFillType)
.function("getFillTypeString", &GetFillTypeString)
.function("getBounds", &SkPath::getBounds)
@@ -564,11 +564,11 @@
.value("XOR", SkPathOp::kXOR_SkPathOp)
.value("REVERSE_DIFFERENCE", SkPathOp::kReverseDifference_SkPathOp);
- enum_<SkPathFillType>("FillType")
- .value("WINDING", SkPathFillType::kWinding)
- .value("EVENODD", SkPathFillType::kEvenOdd)
- .value("INVERSE_WINDING", SkPathFillType::kInverseWinding)
- .value("INVERSE_EVENODD", SkPathFillType::kInverseEvenOdd);
+ enum_<SkPath::FillType>("FillType")
+ .value("WINDING", SkPath::FillType::kWinding_FillType)
+ .value("EVENODD", SkPath::FillType::kEvenOdd_FillType)
+ .value("INVERSE_WINDING", SkPath::FillType::kInverseWinding_FillType)
+ .value("INVERSE_EVENODD", SkPath::FillType::kInverseEvenOdd_FillType);
constant("MOVE_VERB", MOVE);
constant("LINE_VERB", LINE);
diff --git a/modules/skottie/src/layers/ShapeLayer.cpp b/modules/skottie/src/layers/ShapeLayer.cpp
index d2baab2..3b7f98c 100644
--- a/modules/skottie/src/layers/ShapeLayer.cpp
+++ b/modules/skottie/src/layers/ShapeLayer.cpp
@@ -41,8 +41,8 @@
sk_sp<sksg::GeometryNode> AttachRRectGeometry(const skjson::ObjectValue& jrect,
const AnimationBuilder* abuilder) {
auto rect_node = sksg::RRect::Make();
- rect_node->setDirection(ParseDefault(jrect["d"], -1) == 3 ? SkPathDirection::kCCW
- : SkPathDirection::kCW);
+ rect_node->setDirection(ParseDefault(jrect["d"], -1) == 3 ? SkPath::kCCW_Direction
+ : SkPath::kCW_Direction);
rect_node->setInitialPointIndex(2); // starting point: (Right, Top - radius.y)
auto adapter = sk_make_sp<RRectAdapter>(rect_node);
@@ -70,8 +70,8 @@
sk_sp<sksg::GeometryNode> AttachEllipseGeometry(const skjson::ObjectValue& jellipse,
const AnimationBuilder* abuilder) {
auto rect_node = sksg::RRect::Make();
- rect_node->setDirection(ParseDefault(jellipse["d"], -1) == 3 ? SkPathDirection::kCCW
- : SkPathDirection::kCW);
+ rect_node->setDirection(ParseDefault(jellipse["d"], -1) == 3 ? SkPath::kCCW_Direction
+ : SkPath::kCW_Direction);
rect_node->setInitialPointIndex(1); // starting point: (Center, Top)
auto adapter = sk_make_sp<RRectAdapter>(rect_node);
diff --git a/modules/sksg/include/SkSGRect.h b/modules/sksg/include/SkSGRect.h
index c7966f4..29456a0 100644
--- a/modules/sksg/include/SkSGRect.h
+++ b/modules/sksg/include/SkSGRect.h
@@ -32,8 +32,8 @@
SG_ATTRIBUTE(R, SkScalar, fRect.fRight )
SG_ATTRIBUTE(B, SkScalar, fRect.fBottom)
- SG_MAPPED_ATTRIBUTE(Direction , SkPathDirection, fAttrContaier)
- SG_MAPPED_ATTRIBUTE(InitialPointIndex, uint8_t , fAttrContaier)
+ SG_MAPPED_ATTRIBUTE(Direction , SkPath::Direction, fAttrContaier)
+ SG_MAPPED_ATTRIBUTE(InitialPointIndex, uint8_t , fAttrContaier)
protected:
void onClip(SkCanvas*, bool antiAlias) const override;
@@ -52,15 +52,15 @@
uint8_t fDirection : 1;
uint8_t fInitialPointIndex : 2;
- SkPathDirection getDirection() const {
- return static_cast<SkPathDirection>(fDirection);
+ SkPath::Direction getDirection() const {
+ return static_cast<SkPath::Direction>(fDirection);
}
- void setDirection(SkPathDirection dir) { fDirection = SkTo<uint8_t>(dir); }
+ void setDirection(SkPath::Direction dir) { fDirection = SkTo<uint8_t>(dir); }
uint8_t getInitialPointIndex() const { return fInitialPointIndex; }
void setInitialPointIndex(uint8_t idx) { fInitialPointIndex = idx; }
};
- AttrContainer fAttrContaier = { (uint8_t)SkPathDirection::kCW, 0 };
+ AttrContainer fAttrContaier = { SkPath::kCW_Direction, 0 };
using INHERITED = GeometryNode;
};
@@ -75,8 +75,8 @@
SG_ATTRIBUTE(RRect, SkRRect, fRRect)
- SG_MAPPED_ATTRIBUTE(Direction , SkPathDirection, fAttrContaier)
- SG_MAPPED_ATTRIBUTE(InitialPointIndex, uint8_t , fAttrContaier)
+ SG_MAPPED_ATTRIBUTE(Direction , SkPath::Direction, fAttrContaier)
+ SG_MAPPED_ATTRIBUTE(InitialPointIndex, uint8_t , fAttrContaier)
protected:
void onClip(SkCanvas*, bool antiAlias) const override;
@@ -95,15 +95,15 @@
uint8_t fDirection : 1;
uint8_t fInitialPointIndex : 2;
- SkPathDirection getDirection() const {
- return static_cast<SkPathDirection>(fDirection);
+ SkPath::Direction getDirection() const {
+ return static_cast<SkPath::Direction>(fDirection);
}
- void setDirection(SkPathDirection dir) { fDirection = SkTo<uint8_t>(dir); }
+ void setDirection(SkPath::Direction dir) { fDirection = SkTo<uint8_t>(dir); }
uint8_t getInitialPointIndex() const { return fInitialPointIndex; }
void setInitialPointIndex(uint8_t idx) { fInitialPointIndex = idx; }
};
- AttrContainer fAttrContaier = { (uint8_t)SkPathDirection::kCW, 0 };
+ AttrContainer fAttrContaier = { SkPath::kCW_Direction, 0 };
using INHERITED = GeometryNode;
};