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

Unified Diff: src/pathops/SkOpBuilder.cpp

Issue 2478763003: Revert of use reversePathTo in place of addPathReverse (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « src/core/SkPath.cpp ('k') | src/pathops/SkPathWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpBuilder.cpp
diff --git a/src/pathops/SkOpBuilder.cpp b/src/pathops/SkOpBuilder.cpp
index 075520d2c1a42b195a4689ee7d614abb8bdc7d88..011d6a6aba0fb0f344e14d9e5b2e3539a8c0dbc2 100644
--- a/src/pathops/SkOpBuilder.cpp
+++ b/src/pathops/SkOpBuilder.cpp
@@ -25,17 +25,7 @@
return true;
}
-void SkOpBuilder::ReversePath(SkPath* path) {
- SkPath temp;
- SkPoint lastPt;
- SkAssertResult(path->getLastPt(&lastPt));
- temp.moveTo(lastPt);
- temp.reversePathTo(*path);
- temp.close();
- *path = temp;
-}
-
-bool SkOpBuilder::FixWinding(SkPath* path) {
+bool FixWinding(SkPath* path) {
SkPath::FillType fillType = path->getFillType();
if (fillType == SkPath::kInverseEvenOdd_FillType) {
fillType = SkPath::kInverseWinding_FillType;
@@ -45,7 +35,9 @@
SkPathPriv::FirstDirection dir;
if (one_contour(*path) && SkPathPriv::CheapComputeFirstDirection(*path, &dir)) {
if (dir != SkPathPriv::kCCW_FirstDirection) {
- ReversePath(path);
+ SkPath temp;
+ temp.reverseAddPath(*path);
+ *path = temp;
}
path->setFillType(fillType);
return true;
@@ -141,7 +133,9 @@
if (firstDir == SkPathPriv::kUnknown_FirstDirection) {
firstDir = dir;
} else if (firstDir != dir) {
- ReversePath(test);
+ SkPath temp;
+ temp.reverseAddPath(*test);
+ *test = temp;
}
continue;
}
« no previous file with comments | « src/core/SkPath.cpp ('k') | src/pathops/SkPathWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698