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

Side by Side Diff: src/pathops/SkOpContour.h

Issue 16195004: add asserts to point<-->verb helpers (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 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 #ifndef SkOpContour_DEFINED 7 #ifndef SkOpContour_DEFINED
8 #define SkOpContour_DEFINED 8 #define SkOpContour_DEFINED
9 9
10 #include "SkOpSegment.h" 10 #include "SkOpSegment.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 return false; 108 return false;
109 } 109 }
110 110
111 bool done() const { 111 bool done() const {
112 return fDone; 112 return fDone;
113 } 113 }
114 114
115 const SkPoint& end() const { 115 const SkPoint& end() const {
116 const SkOpSegment& segment = fSegments.back(); 116 const SkOpSegment& segment = fSegments.back();
117 return segment.pts()[segment.verb()]; 117 return segment.pts()[SkPathOpsVerbToPoints(segment.verb())];
118 } 118 }
119 119
120 void findTooCloseToCall() { 120 void findTooCloseToCall() {
121 int segmentCount = fSegments.count(); 121 int segmentCount = fSegments.count();
122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { 122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
123 fSegments[sIndex].findTooCloseToCall(); 123 fSegments[sIndex].findTooCloseToCall();
124 } 124 }
125 } 125 }
126 126
127 void fixOtherTIndex() { 127 void fixOtherTIndex() {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 fSegments[test].addCurveTo(0, 1, path, true); 188 fSegments[test].addCurveTo(0, 1, path, true);
189 } 189 }
190 } 190 }
191 191
192 void topSortableSegment(const SkPoint& topLeft, SkPoint* bestXY, SkOpSegment ** topStart); 192 void topSortableSegment(const SkPoint& topLeft, SkPoint* bestXY, SkOpSegment ** topStart);
193 SkOpSegment* undoneSegment(int* start, int* end); 193 SkOpSegment* undoneSegment(int* start, int* end);
194 194
195 int updateSegment(int index, const SkPoint* pts) { 195 int updateSegment(int index, const SkPoint* pts) {
196 SkOpSegment& segment = fSegments[index]; 196 SkOpSegment& segment = fSegments[index];
197 segment.updatePts(pts); 197 segment.updatePts(pts);
198 return segment.verb() + 1; 198 return SkPathOpsVerbToPoints(segment.verb()) + 1;
199 } 199 }
200 200
201 #if DEBUG_TEST 201 #if DEBUG_TEST
202 SkTArray<SkOpSegment>& debugSegments() { 202 SkTArray<SkOpSegment>& debugSegments() {
203 return fSegments; 203 return fSegments;
204 } 204 }
205 #endif 205 #endif
206 206
207 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY 207 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY
208 void debugShowActiveSpans() { 208 void debugShowActiveSpans() {
(...skipping 23 matching lines...) Expand all
232 bool fDone; 232 bool fDone;
233 bool fOperand; // true for the second argument to a binary operator 233 bool fOperand; // true for the second argument to a binary operator
234 bool fXor; 234 bool fXor;
235 bool fOppXor; 235 bool fOppXor;
236 #if DEBUG_DUMP 236 #if DEBUG_DUMP
237 int fID; 237 int fID;
238 #endif 238 #endif
239 }; 239 };
240 240
241 #endif 241 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698