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

Side by Side Diff: src/pathops/SkOpBuilder.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 unified diff | Download patch
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpContour.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "SkOpEdgeBuilder.h" 9 #include "SkOpEdgeBuilder.h"
10 #include "SkPathPriv.h" 10 #include "SkPathPriv.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 SkOpGlobalState globalState(&contourHead, &allocator SkDEBUGPARAMS(false) 47 SkOpGlobalState globalState(&contourHead, &allocator SkDEBUGPARAMS(false)
48 SkDEBUGPARAMS(nullptr)); 48 SkDEBUGPARAMS(nullptr));
49 SkOpEdgeBuilder builder(*path, &contourHead, &globalState); 49 SkOpEdgeBuilder builder(*path, &contourHead, &globalState);
50 if (builder.unparseable() || !builder.finish()) { 50 if (builder.unparseable() || !builder.finish()) {
51 return false; 51 return false;
52 } 52 }
53 if (!contourHead.count()) { 53 if (!contourHead.count()) {
54 return true; 54 return true;
55 } 55 }
56 SkASSERT(contourHead.next()); 56 SkASSERT(contourHead.next());
57 contourHead.joinAllSegments();
57 contourHead.resetReverse(); 58 contourHead.resetReverse();
58 bool writePath = false; 59 bool writePath = false;
59 SkOpSpan* topSpan; 60 SkOpSpan* topSpan;
60 globalState.setPhase(SkOpGlobalState::kFixWinding); 61 globalState.setPhase(SkOpGlobalState::kFixWinding);
61 while ((topSpan = FindSortableTop(&contourHead))) { 62 while ((topSpan = FindSortableTop(&contourHead))) {
62 SkOpSegment* topSegment = topSpan->segment(); 63 SkOpSegment* topSegment = topSpan->segment();
63 SkOpContour* topContour = topSegment->contour(); 64 SkOpContour* topContour = topSegment->contour();
64 SkASSERT(topContour->isCcw() >= 0); 65 SkASSERT(topContour->isCcw() >= 0);
65 #if DEBUG_WINDING 66 #if DEBUG_WINDING
66 SkDebugf("%s id=%d nested=%d ccw=%d\n", __FUNCTION__, 67 SkDebugf("%s id=%d nested=%d ccw=%d\n", __FUNCTION__,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 sum.addPath(fPathRefs[index]); 175 sum.addPath(fPathRefs[index]);
175 } 176 }
176 } 177 }
177 reset(); 178 reset();
178 bool success = Simplify(sum, result); 179 bool success = Simplify(sum, result);
179 if (!success) { 180 if (!success) {
180 *result = original; 181 *result = original;
181 } 182 }
182 return success; 183 return success;
183 } 184 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpContour.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698