Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: src/pathops/SkOpBuilder.cpp

Issue 1176953002: move SkPath direction-as-computed into SkPathPriv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/pathops/SkOpBuilder.cpp
diff --git a/src/pathops/SkOpBuilder.cpp b/src/pathops/SkOpBuilder.cpp
index 5cc3fbd2ef285e33734b504da7b15ebb0fe7465b..a434fbcf2bb002120e4c619b494b9b0ec2f75c91 100644
--- a/src/pathops/SkOpBuilder.cpp
+++ b/src/pathops/SkOpBuilder.cpp
@@ -7,7 +7,7 @@
#include "SkMatrix.h"
#include "SkOpEdgeBuilder.h"
-#include "SkPath.h"
+#include "SkPathPriv.h"
#include "SkPathOps.h"
#include "SkPathOpsCommon.h"
@@ -32,9 +32,9 @@ void FixWinding(SkPath* path) {
} else if (fillType == SkPath::kEvenOdd_FillType) {
fillType = SkPath::kWinding_FillType;
}
- SkPath::Direction dir;
- if (one_contour(*path) && path->cheapComputeDirection(&dir)) {
- if (dir != SkPath::kCCW_Direction) {
+ SkPathPriv::FirstDirection dir;
+ if (one_contour(*path) && SkPathPriv::CheapComputeFirstDirection(*path, &dir)) {
+ if (dir != SkPathPriv::kCCW_FirstDirection) {
SkPath temp;
temp.reverseAddPath(*path);
*path = temp;
@@ -106,7 +106,7 @@ bool SkOpBuilder::resolve(SkPath* result) {
SkPath original = *result;
int count = fOps.count();
bool allUnion = true;
- SkPath::Direction firstDir;
+ SkPathPriv::FirstDirection firstDir;
for (int index = 0; index < count; ++index) {
SkPath* test = &fPathRefs[index];
if (kUnion_SkPathOp != fOps[index] || test->isInverseFillType()) {
@@ -115,8 +115,8 @@ bool SkOpBuilder::resolve(SkPath* result) {
}
// If all paths are convex, track direction, reversing as needed.
if (test->isConvex()) {
- SkPath::Direction dir;
- if (!test->cheapComputeDirection(&dir)) {
+ SkPathPriv::FirstDirection dir;
+ if (!SkPathPriv::CheapComputeFirstDirection(*test, &dir)) {
allUnion = false;
break;
}

Powered by Google App Engine
This is Rietveld 408576698