Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f37439f69b1e4a9b08147f9c12ddad1bddb.
Reason for revert: legacy convexity code removed -- google3 should be ok
Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485cacb0c950a3c0ea0aab763a8d43176.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3027e8181311a61f7ca798be52a0250.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=reed@google.com
Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/gm/aaa.cpp b/gm/aaa.cpp
index d056b0b..4ebd25e 100644
--- a/gm/aaa.cpp
+++ b/gm/aaa.cpp
@@ -64,7 +64,7 @@
SkBits2Float(0x4344f079), SkBits2Float(0x4397e900), SkBits2Float(0x3f3504f3));
path.close();
// Manually setting convexity is required. Otherwise, this path will be considered concave.
- path.setConvexity(SkPath::kConvex_Convexity);
+ path.setConvexityType(SkPathConvexityType::kConvex);
canvas->drawPath(path, p);
// skbug.com/7573
diff --git a/gm/arcto.cpp b/gm/arcto.cpp
index f28d86c..03942fe 100644
--- a/gm/arcto.cpp
+++ b/gm/arcto.cpp
@@ -79,13 +79,13 @@
SkScalar ovalHeight = oval.height() / oHeight;
svgArc.moveTo(oval.fLeft, oval.fTop);
svgArc.arcTo(oval.width() / 2, ovalHeight, SkIntToScalar(angle), SkPath::kSmall_ArcSize,
- SkPath::kCW_Direction, oval.right(), oval.bottom());
+ SkPathDirection::kCW, oval.right(), oval.bottom());
canvas->drawPath(svgArc, paint);
svgArc.reset();
svgArc.moveTo(oval.fLeft + 100, oval.fTop + 100);
svgArc.arcTo(oval.width() / 2, ovalHeight, SkIntToScalar(angle), SkPath::kLarge_ArcSize,
- SkPath::kCCW_Direction, oval.right(), oval.bottom() + 100);
+ SkPathDirection::kCCW, oval.right(), oval.bottom() + 100);
canvas->drawPath(svgArc, paint);
oval.offset(50, 0);
svgArc.reset();
@@ -114,12 +114,12 @@
paint.setStrokeCap(SkPaint::kRound_Cap);
SkPath path;
path.moveTo(100, 100);
- path.arcTo(0, 0, 0, SkPath::kLarge_ArcSize, SkPath::kCW_Direction, 200, 200);
+ path.arcTo(0, 0, 0, SkPath::kLarge_ArcSize, SkPathDirection::kCW, 200, 200);
canvas->drawPath(path, paint);
path.reset();
path.moveTo(200, 100);
- path.arcTo(80, 80, 0, SkPath::kLarge_ArcSize, SkPath::kCW_Direction, 200, 100);
+ path.arcTo(80, 80, 0, SkPath::kLarge_ArcSize, SkPathDirection::kCW, 200, 100);
canvas->drawPath(path, paint);
}
diff --git a/gm/bigblurs.cpp b/gm/bigblurs.cpp
index ff12b6b..6436c85 100644
--- a/gm/bigblurs.cpp
+++ b/gm/bigblurs.cpp
@@ -52,7 +52,7 @@
SkPath rectori;
rectori.addRect(bigRect);
- rectori.addRect(insetRect, SkPath::kCCW_Direction);
+ rectori.addRect(insetRect, SkPathDirection::kCCW);
// The blur extends 3*kSigma out from the big rect.
// Offset the close-up windows so we get the entire blur
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index 3aef017..e6f6910 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -89,8 +89,8 @@
SkRect outer = SkRect::MakeXYWH(10.125f, 10.125f, 100.125f, 100);
SkRect inner = SkRect::MakeXYWH(20.25f, 20.125f, 80, 80);
SkPath path;
- path.addRect(outer, SkPath::kCW_Direction);
- path.addRect(inner, SkPath::kCCW_Direction);
+ path.addRect(outer, SkPathDirection::kCW);
+ path.addRect(inner, SkPathDirection::kCCW);
canvas->drawPath(path, paint);
// important to translate by a factional amount to exercise a different "phase"
@@ -107,8 +107,8 @@
SkRect outer = SkRect::MakeXYWH(10, 110, 100, 100);
SkRect inner = SkRect::MakeXYWH(50, 150, 10, 10);
SkPath path;
- path.addRect(outer, SkPath::kCW_Direction);
- path.addRect(inner, SkPath::kCW_Direction);
+ path.addRect(outer, SkPathDirection::kCW);
+ path.addRect(inner, SkPathDirection::kCW);
canvas->drawPath(path, paint);
SkScalar dx = SkScalarRoundToScalar(path.getBounds().width()) + 40 + 0.25f;
diff --git a/gm/circularclips.cpp b/gm/circularclips.cpp
index 025b693..b213838 100644
--- a/gm/circularclips.cpp
+++ b/gm/circularclips.cpp
@@ -28,8 +28,8 @@
fY = 50;
fR = 40;
- fCircle1.addCircle(fX1, fY, fR, SkPath::kCW_Direction);
- fCircle2.addCircle(fX2, fY, fR, SkPath::kCW_Direction);
+ fCircle1.addCircle(fX1, fY, fR, SkPathDirection::kCW);
+ fCircle2.addCircle(fX2, fY, fR, SkPathDirection::kCW);
}
diff --git a/gm/convex_all_line_paths.cpp b/gm/convex_all_line_paths.cpp
index 2fa2adf..1936dfc 100644
--- a/gm/convex_all_line_paths.cpp
+++ b/gm/convex_all_line_paths.cpp
@@ -183,7 +183,7 @@
SkISize onISize() override { return SkISize::Make(kGMWidth, kGMHeight); }
bool runAsBench() const override { return true; }
- static SkPath GetPath(int index, SkPath::Direction dir) {
+ static SkPath GetPath(int index, SkPathDirection dir) {
std::unique_ptr<SkPoint[]> data(nullptr);
const SkPoint* points;
int numPts;
@@ -238,7 +238,7 @@
SkPath path;
- if (SkPath::kCW_Direction == dir) {
+ if (SkPathDirection::kCW == dir) {
path.moveTo(points[0]);
for (int i = 1; i < numPts; ++i) {
path.lineTo(points[i]);
@@ -273,7 +273,7 @@
SkPoint center;
{
- SkPath path = GetPath(index, SkPath::kCW_Direction);
+ SkPath path = GetPath(index, SkPathDirection::kCW);
if (offset->fX+path.getBounds().width() > kGMWidth) {
offset->fX = 0;
offset->fY += kMaxPathHeight;
@@ -290,7 +290,7 @@
}
const SkColor colors[2] = { SK_ColorBLACK, SK_ColorWHITE };
- const SkPath::Direction dirs[2] = { SkPath::kCW_Direction, SkPath::kCCW_Direction };
+ const SkPathDirection dirs[2] = { SkPathDirection::kCW, SkPathDirection::kCCW };
const float scales[] = { 1.0f, 0.75f, 0.5f, 0.25f, 0.1f, 0.01f, 0.001f };
const SkPaint::Join joins[3] = { SkPaint::kRound_Join,
SkPaint::kBevel_Join,
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp
index a92508f..0fa0e34 100644
--- a/gm/convexpaths.cpp
+++ b/gm/convexpaths.cpp
@@ -66,36 +66,36 @@
fPaths.push_back().addRect(0, 0,
100 * SK_Scalar1, 100 * SK_Scalar1,
- SkPath::kCW_Direction);
+ SkPathDirection::kCW);
fPaths.push_back().addRect(0, 0,
100 * SK_Scalar1, 100 * SK_Scalar1,
- SkPath::kCCW_Direction);
+ SkPathDirection::kCCW);
fPaths.push_back().addCircle(50 * SK_Scalar1, 50 * SK_Scalar1,
- 50 * SK_Scalar1, SkPath::kCW_Direction);
+ 50 * SK_Scalar1, SkPathDirection::kCW);
fPaths.push_back().addOval(SkRect::MakeXYWH(0, 0,
50 * SK_Scalar1,
100 * SK_Scalar1),
- SkPath::kCW_Direction);
+ SkPathDirection::kCW);
fPaths.push_back().addOval(SkRect::MakeXYWH(0, 0,
100 * SK_Scalar1,
5 * SK_Scalar1),
- SkPath::kCCW_Direction);
+ SkPathDirection::kCCW);
fPaths.push_back().addOval(SkRect::MakeXYWH(0, 0,
SK_Scalar1,
100 * SK_Scalar1),
- SkPath::kCCW_Direction);
+ SkPathDirection::kCCW);
fPaths.push_back().addRoundRect(SkRect::MakeXYWH(0, 0,
SK_Scalar1 * 100,
SK_Scalar1 * 100),
40 * SK_Scalar1, 20 * SK_Scalar1,
- SkPath::kCW_Direction);
+ SkPathDirection::kCW);
// large number of points
enum {
diff --git a/gm/drawatlas.cpp b/gm/drawatlas.cpp
index 132fd5b..e349bbf 100644
--- a/gm/drawatlas.cpp
+++ b/gm/drawatlas.cpp
@@ -208,8 +208,8 @@
SkPath path;
const float baseline_offset = -5;
- const SkPath::Direction dirs[] = {
- SkPath::kCW_Direction, SkPath::kCCW_Direction,
+ const SkPathDirection dirs[] = {
+ SkPathDirection::kCW, SkPathDirection::kCCW,
};
for (auto d : dirs) {
path.reset();
diff --git a/gm/inversepaths.cpp b/gm/inversepaths.cpp
index 0726983..7ddf088 100644
--- a/gm/inversepaths.cpp
+++ b/gm/inversepaths.cpp
@@ -34,7 +34,7 @@
static SkPath generate_circle(SkScalar cx, SkScalar cy, SkScalar d) {
SkPath path;
- path.addCircle(cx, cy, d/2, SkPath::kCW_Direction);
+ path.addCircle(cx, cy, d/2, SkPathDirection::kCW);
return path;
}
diff --git a/gm/nested.cpp b/gm/nested.cpp
index 859077f..9c1370c 100644
--- a/gm/nested.cpp
+++ b/gm/nested.cpp
@@ -53,7 +53,7 @@
kShapeCount
};
- static void AddShape(SkPath* path, const SkRect& rect, Shapes shape, SkPath::Direction dir) {
+ static void AddShape(SkPath* path, const SkRect& rect, Shapes shape, SkPathDirection dir) {
switch (shape) {
case kRect_Shape:
path->addRect(rect, dir);
@@ -105,9 +105,9 @@
for (size_t innerRect = 0; innerRect < SK_ARRAY_COUNT(innerRects); ++innerRect) {
SkPath path;
- AddShape(&path, outerRect, (Shapes) outerShape, SkPath::kCW_Direction);
+ AddShape(&path, outerRect, (Shapes) outerShape, SkPathDirection::kCW);
AddShape(&path, innerRects[innerRect], (Shapes) innerShape,
- SkPath::kCCW_Direction);
+ SkPathDirection::kCCW);
canvas->save();
if (fFlipped) {
diff --git a/gm/pathcontourstart.cpp b/gm/pathcontourstart.cpp
index 430e59b..7d3ff48 100644
--- a/gm/pathcontourstart.cpp
+++ b/gm/pathcontourstart.cpp
@@ -55,19 +55,19 @@
void onDraw(SkCanvas* canvas) override {
- drawDirs(canvas, [](const SkRect& rect, SkPath::Direction dir, unsigned startIndex) {
+ drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
SkPath path;
path.addRect(rect, dir, startIndex);
return path;
});
- drawDirs(canvas, [](const SkRect& rect, SkPath::Direction dir, unsigned startIndex) {
+ drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
SkPath path;
path.addOval(rect, dir, startIndex);
return path;
});
- drawDirs(canvas, [](const SkRect& rect, SkPath::Direction dir, unsigned startIndex) {
+ drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
SkRRect rrect;
const SkVector radii[4] = { {15, 15}, {15, 15}, {15, 15}, {15, 15}};
rrect.setRectRadii(rect, radii);
@@ -77,7 +77,7 @@
return path;
});
- drawDirs(canvas, [](const SkRect& rect, SkPath::Direction dir, unsigned startIndex) {
+ drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
SkRRect rrect;
rrect.setRect(rect);
@@ -86,7 +86,7 @@
return path;
});
- drawDirs(canvas, [](const SkRect& rect, SkPath::Direction dir, unsigned startIndex) {
+ drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
SkRRect rrect;
rrect.setOval(rect);
@@ -105,15 +105,15 @@
SkRect fRect;
void drawDirs(SkCanvas* canvas,
- SkPath (*makePath)(const SkRect&, SkPath::Direction, unsigned)) const {
- drawOneColumn(canvas, SkPath::kCW_Direction, makePath);
+ SkPath (*makePath)(const SkRect&, SkPathDirection, unsigned)) const {
+ drawOneColumn(canvas, SkPathDirection::kCW, makePath);
canvas->translate(kImageWidth / 10, 0);
- drawOneColumn(canvas, SkPath::kCCW_Direction, makePath);
+ drawOneColumn(canvas, SkPathDirection::kCCW, makePath);
canvas->translate(kImageWidth / 10, 0);
}
- void drawOneColumn(SkCanvas* canvas, SkPath::Direction dir,
- SkPath (*makePath)(const SkRect&, SkPath::Direction, unsigned)) const {
+ void drawOneColumn(SkCanvas* canvas, SkPathDirection dir,
+ SkPath (*makePath)(const SkRect&, SkPathDirection, unsigned)) const {
SkAutoCanvasRestore acr(canvas, true);
for (unsigned i = 0; i < 8; ++i) {
diff --git a/gm/patheffects.cpp b/gm/patheffects.cpp
index 33a6841..37715f1 100644
--- a/gm/patheffects.cpp
+++ b/gm/patheffects.cpp
@@ -148,9 +148,9 @@
path.reset();
SkRect r = { 0, 0, 250, 120 };
- path.addOval(r, SkPath::kCW_Direction);
+ path.addOval(r, SkPathDirection::kCW);
r.inset(50, 50);
- path.addRect(r, SkPath::kCCW_Direction);
+ path.addRect(r, SkPathDirection::kCCW);
canvas->translate(320, 20);
for (size_t i = 0; i < SK_ARRAY_COUNT(gPE2); i++) {
diff --git a/gm/pathinterior.cpp b/gm/pathinterior.cpp
index b152f72..8480b22 100644
--- a/gm/pathinterior.cpp
+++ b/gm/pathinterior.cpp
@@ -76,8 +76,8 @@
for (int innerCW = 0; innerCW <= 1; ++innerCW) {
SkPath path;
path.setFillType(doEvenOdd ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType);
- SkPath::Direction outerDir = outerCW ? SkPath::kCW_Direction : SkPath::kCCW_Direction;
- SkPath::Direction innerDir = innerCW ? SkPath::kCW_Direction : SkPath::kCCW_Direction;
+ SkPathDirection outerDir = outerCW ? SkPathDirection::kCW : SkPathDirection::kCCW;
+ SkPathDirection innerDir = innerCW ? SkPathDirection::kCW : SkPathDirection::kCCW;
SkRect r = insetFirst ? inset(rect) : rect;
if (outerRR) {
diff --git a/gm/polygonoffset.cpp b/gm/polygonoffset.cpp
index 9cdd9ea..9f906ac 100644
--- a/gm/polygonoffset.cpp
+++ b/gm/polygonoffset.cpp
@@ -23,12 +23,12 @@
#include <functional>
#include <memory>
-static void create_ngon(int n, SkPoint* pts, SkScalar w, SkScalar h, SkPath::Direction dir) {
+static void create_ngon(int n, SkPoint* pts, SkScalar w, SkScalar h, SkPathDirection dir) {
float angleStep = 360.0f / n, angle = 0.0f;
if ((n % 2) == 1) {
angle = angleStep/2.0f;
}
- if (SkPath::kCCW_Direction == dir) {
+ if (SkPathDirection::kCCW == dir) {
angle = -angle;
angleStep = -angleStep;
}
@@ -438,13 +438,13 @@
SkISize onISize() override { return SkISize::Make(kGMWidth, kGMHeight); }
bool runAsBench() const override { return true; }
- static void GetConvexPolygon(int index, SkPath::Direction dir,
+ static void GetConvexPolygon(int index, SkPathDirection dir,
std::unique_ptr<SkPoint[]>* data, int* numPts) {
if (index < (int)SK_ARRAY_COUNT(PolygonOffsetData::gConvexPoints)) {
// manually specified
*numPts = (int)PolygonOffsetData::gConvexSizes[index];
data->reset(new SkPoint[*numPts]);
- if (SkPath::kCW_Direction == dir) {
+ if (SkPathDirection::kCW == dir) {
for (int i = 0; i < *numPts; ++i) {
(*data)[i] = PolygonOffsetData::gConvexPoints[index][i];
}
@@ -473,13 +473,13 @@
}
}
- static void GetSimplePolygon(int index, SkPath::Direction dir,
+ static void GetSimplePolygon(int index, SkPathDirection dir,
std::unique_ptr<SkPoint[]>* data, int* numPts) {
if (index < (int)SK_ARRAY_COUNT(PolygonOffsetData::gSimplePoints)) {
// manually specified
*numPts = (int)PolygonOffsetData::gSimpleSizes[index];
data->reset(new SkPoint[*numPts]);
- if (SkPath::kCW_Direction == dir) {
+ if (SkPathDirection::kCW == dir) {
for (int i = 0; i < *numPts; ++i) {
(*data)[i] = PolygonOffsetData::gSimplePoints[index][i];
}
@@ -515,9 +515,9 @@
std::unique_ptr<SkPoint[]> data(nullptr);
int numPts;
if (fConvexOnly) {
- GetConvexPolygon(index, SkPath::kCW_Direction, &data, &numPts);
+ GetConvexPolygon(index, SkPathDirection::kCW, &data, &numPts);
} else {
- GetSimplePolygon(index, SkPath::kCW_Direction, &data, &numPts);
+ GetSimplePolygon(index, SkPathDirection::kCW, &data, &numPts);
}
bounds.setBounds(data.get(), numPts);
if (!fConvexOnly) {
@@ -531,7 +531,7 @@
offset->fX += bounds.width();
}
- const SkPath::Direction dirs[2] = { SkPath::kCW_Direction, SkPath::kCCW_Direction };
+ const SkPathDirection dirs[2] = { SkPathDirection::kCW, SkPathDirection::kCCW };
const float insets[] = { 5, 10, 15, 20, 25, 30, 35, 40 };
const float offsets[] = { 2, 5, 9, 14, 20, 27, 35, 44, -2, -5, -9 };
const SkColor colors[] = { 0xFF901313, 0xFF8D6214, 0xFF698B14, 0xFF1C8914,
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index 9b0bb04..0533024 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -283,24 +283,24 @@
SkPath path;
path.setFillType(SkPath::kWinding_FillType);
- path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction);
- path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCCW_Direction);
+ path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(50), SkPathDirection::kCW);
+ path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(40), SkPathDirection::kCCW);
canvas->drawPath(path, paint);
SkPath path2;
path2.setFillType(SkPath::kWinding_FillType);
- path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction);
- path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCW_Direction);
+ path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(50), SkPathDirection::kCCW);
+ path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(40), SkPathDirection::kCW);
canvas->drawPath(path2, paint);
path2.reset();
- path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction);
+ path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToScalar(50), SkPathDirection::kCCW);
canvas->drawPath(path2, paint);
SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCCW_FirstDirection));
path2.reset();
SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path2, nullptr));
- path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction);
+ path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPathDirection::kCW);
SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCW_FirstDirection));
canvas->drawPath(path2, paint);
@@ -308,25 +308,25 @@
SkIntToScalar(100), SkIntToScalar(100));
SkPath path3;
path3.setFillType(SkPath::kWinding_FillType);
- path3.addRect(r, SkPath::kCW_Direction);
+ path3.addRect(r, SkPathDirection::kCW);
r.inset(SkIntToScalar(10), SkIntToScalar(10));
- path3.addRect(r, SkPath::kCCW_Direction);
+ path3.addRect(r, SkPathDirection::kCCW);
canvas->drawPath(path3, paint);
r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280),
SkIntToScalar(100), SkIntToScalar(100));
SkPath path4;
path4.setFillType(SkPath::kWinding_FillType);
- path4.addRect(r, SkPath::kCCW_Direction);
+ path4.addRect(r, SkPathDirection::kCCW);
r.inset(SkIntToScalar(10), SkIntToScalar(10));
- path4.addRect(r, SkPath::kCW_Direction);
+ path4.addRect(r, SkPathDirection::kCW);
canvas->drawPath(path4, paint);
r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280),
SkIntToScalar(100), SkIntToScalar(100));
path4.reset();
SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr));
- path4.addRect(r, SkPath::kCCW_Direction);
+ path4.addRect(r, SkPathDirection::kCCW);
SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCCW_FirstDirection));
path4.moveTo(0, 0); // test for crbug.com/247770
canvas->drawPath(path4, paint);
@@ -335,7 +335,7 @@
SkIntToScalar(100), SkIntToScalar(100));
path4.reset();
SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr));
- path4.addRect(r, SkPath::kCW_Direction);
+ path4.addRect(r, SkPathDirection::kCW);
SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCW_FirstDirection));
path4.moveTo(0, 0); // test for crbug.com/247770
canvas->drawPath(path4, paint);
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index a2e7bfd..9b3b1a4 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -344,42 +344,42 @@
class Strokes3GM : public skiagm::GM {
static void make0(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addRect(bounds, SkPath::kCW_Direction);
- path->addRect(inset(bounds), SkPath::kCW_Direction);
+ path->addRect(bounds, SkPathDirection::kCW);
+ path->addRect(inset(bounds), SkPathDirection::kCW);
title->set("CW CW");
}
static void make1(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addRect(bounds, SkPath::kCW_Direction);
- path->addRect(inset(bounds), SkPath::kCCW_Direction);
+ path->addRect(bounds, SkPathDirection::kCW);
+ path->addRect(inset(bounds), SkPathDirection::kCCW);
title->set("CW CCW");
}
static void make2(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addOval(bounds, SkPath::kCW_Direction);
- path->addOval(inset(bounds), SkPath::kCW_Direction);
+ path->addOval(bounds, SkPathDirection::kCW);
+ path->addOval(inset(bounds), SkPathDirection::kCW);
title->set("CW CW");
}
static void make3(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addOval(bounds, SkPath::kCW_Direction);
- path->addOval(inset(bounds), SkPath::kCCW_Direction);
+ path->addOval(bounds, SkPathDirection::kCW);
+ path->addOval(inset(bounds), SkPathDirection::kCCW);
title->set("CW CCW");
}
static void make4(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addRect(bounds, SkPath::kCW_Direction);
+ path->addRect(bounds, SkPathDirection::kCW);
SkRect r = bounds;
r.inset(bounds.width() / 10, -bounds.height() / 10);
- path->addOval(r, SkPath::kCW_Direction);
+ path->addOval(r, SkPathDirection::kCW);
title->set("CW CW");
}
static void make5(SkPath* path, const SkRect& bounds, SkString* title) {
- path->addRect(bounds, SkPath::kCW_Direction);
+ path->addRect(bounds, SkPathDirection::kCW);
SkRect r = bounds;
r.inset(bounds.width() / 10, -bounds.height() / 10);
- path->addOval(r, SkPath::kCCW_Direction);
+ path->addOval(r, SkPathDirection::kCCW);
title->set("CW CCW");
}