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

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

Issue 16951017: convert pathops to use SkSTArray where possible. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: pathops use SkTArray 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.h ('k') | src/pathops/SkOpContour.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 28 matching lines...) Expand all
39 void addCoincident(int index, SkOpContour* other, int otherIndex, 39 void addCoincident(int index, SkOpContour* other, int otherIndex,
40 const SkIntersections& ts, bool swap); 40 const SkIntersections& ts, bool swap);
41 void addCoincidentPoints(); 41 void addCoincidentPoints();
42 42
43 void addCross(const SkOpContour* crosser) { 43 void addCross(const SkOpContour* crosser) {
44 #ifdef DEBUG_CROSS 44 #ifdef DEBUG_CROSS
45 for (int index = 0; index < fCrosses.count(); ++index) { 45 for (int index = 0; index < fCrosses.count(); ++index) {
46 SkASSERT(fCrosses[index] != crosser); 46 SkASSERT(fCrosses[index] != crosser);
47 } 47 }
48 #endif 48 #endif
49 *fCrosses.append() = crosser; 49 fCrosses.push_back(crosser);
50 } 50 }
51 51
52 void addCubic(const SkPoint pts[4]) { 52 void addCubic(const SkPoint pts[4]) {
53 fSegments.push_back().addCubic(pts, fOperand, fXor); 53 fSegments.push_back().addCubic(pts, fOperand, fXor);
54 fContainsCurves = fContainsCubics = true; 54 fContainsCurves = fContainsCubics = true;
55 } 55 }
56 56
57 int addLine(const SkPoint pts[2]) { 57 int addLine(const SkPoint pts[2]) {
58 fSegments.push_back().addLine(pts, fOperand, fXor); 58 fSegments.push_back().addLine(pts, fOperand, fXor);
59 return fSegments.count(); 59 return fSegments.count();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() {
209 for (int index = 0; index < fSegments.count(); ++index) { 209 for (int index = 0; index < fSegments.count(); ++index) {
210 fSegments[index].debugShowActiveSpans(); 210 fSegments[index].debugShowActiveSpans();
211 } 211 }
212 } 212 }
213 #endif 213 #endif
214 214
215 #if DEBUG_SHOW_WINDING 215 #if DEBUG_SHOW_WINDING
216 int debugShowWindingValues(int totalSegments, int ofInterest); 216 int debugShowWindingValues(int totalSegments, int ofInterest);
217 static void debugShowWindingValues(const SkTDArray<SkOpContour*>& contourLis t); 217 static void debugShowWindingValues(const SkTArray<SkOpContour*, true>& conto urList);
218 #endif 218 #endif
219 219
220 private: 220 private:
221 void setBounds(); 221 void setBounds();
222 222
223 SkTArray<SkOpSegment> fSegments; 223 SkTArray<SkOpSegment> fSegments;
224 SkTDArray<SkOpSegment*> fSortedSegments; 224 SkTArray<SkOpSegment*, true> fSortedSegments;
225 int fFirstSorted; 225 int fFirstSorted;
226 SkTDArray<SkCoincidence> fCoincidences; 226 SkTArray<SkCoincidence, true> fCoincidences;
227 SkTDArray<const SkOpContour*> fCrosses; 227 SkTArray<const SkOpContour*, true> fCrosses;
228 SkPathOpsBounds fBounds; 228 SkPathOpsBounds fBounds;
229 bool fContainsIntercepts; // FIXME: is this used by anybody? 229 bool fContainsIntercepts; // FIXME: is this used by anybody?
230 bool fContainsCubics; 230 bool fContainsCubics;
231 bool fContainsCurves; 231 bool fContainsCurves;
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.h ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698