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

Unified Diff: src/pathops/SkOpContour.cpp

Issue 2321973005: Rewriting path writer (Closed)
Patch Set: revert unneeded test changes Created 4 years, 3 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
« no previous file with comments | « src/pathops/SkOpContour.h ('k') | src/pathops/SkOpEdgeBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpContour.cpp
diff --git a/src/pathops/SkOpContour.cpp b/src/pathops/SkOpContour.cpp
index ed533887e5456dceb933113169fe44ba9aeecfb4..3b2318c306c5b88e55403907182a39dfb7dcc11d 100644
--- a/src/pathops/SkOpContour.cpp
+++ b/src/pathops/SkOpContour.cpp
@@ -38,23 +38,21 @@ SkOpSegment* SkOpContour::addCurve(SkPath::Verb verb, const SkPoint pts[4]) {
}
void SkOpContour::toPath(SkPathWriter* path) const {
- const SkPoint& pt = fHead.pts()[0];
- path->deferredMove(pt);
const SkOpSegment* segment = &fHead;
do {
SkAssertResult(segment->addCurveTo(segment->head(), segment->tail(), path));
} while ((segment = segment->next()));
- path->close();
+ path->finishContour();
+ path->assemble();
}
void SkOpContour::toReversePath(SkPathWriter* path) const {
- const SkPoint& pt = fTail->pts()[0];
- path->deferredMove(pt);
const SkOpSegment* segment = fTail;
do {
SkAssertResult(segment->addCurveTo(segment->tail(), segment->head(), path));
} while ((segment = segment->prev()));
- path->close();
+ path->finishContour();
+ path->assemble();
}
SkOpSegment* SkOpContour::undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase** endPtr) {
« no previous file with comments | « src/pathops/SkOpContour.h ('k') | src/pathops/SkOpEdgeBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698