OLD | NEW |
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 result->setPrev(fTail); | 74 result->setPrev(fTail); |
75 if (fTail) { | 75 if (fTail) { |
76 fTail->setNext(result); | 76 fTail->setNext(result); |
77 } | 77 } |
78 fTail = result; | 78 fTail = result; |
79 return *result; | 79 return *result; |
80 } | 80 } |
81 | 81 |
82 SkOpContour* appendContour(SkChunkAlloc* allocator) { | 82 SkOpContour* appendContour(SkChunkAlloc* allocator) { |
83 SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator); | 83 SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator); |
84 contour->setNext(NULL); | 84 contour->setNext(nullptr); |
85 SkOpContour* prev = this; | 85 SkOpContour* prev = this; |
86 SkOpContour* next; | 86 SkOpContour* next; |
87 while ((next = prev->next())) { | 87 while ((next = prev->next())) { |
88 prev = next; | 88 prev = next; |
89 } | 89 } |
90 prev->setNext(contour); | 90 prev->setNext(contour); |
91 return contour; | 91 return contour; |
92 } | 92 } |
93 | 93 |
94 const SkPathOpsBounds& bounds() const { | 94 const SkPathOpsBounds& bounds() const { |
(...skipping 27 matching lines...) Expand all Loading... |
122 #if DEBUG_ACTIVE_SPANS | 122 #if DEBUG_ACTIVE_SPANS |
123 void debugShowActiveSpans() { | 123 void debugShowActiveSpans() { |
124 SkOpSegment* segment = &fHead; | 124 SkOpSegment* segment = &fHead; |
125 do { | 125 do { |
126 segment->debugShowActiveSpans(); | 126 segment->debugShowActiveSpans(); |
127 } while ((segment = segment->next())); | 127 } while ((segment = segment->next())); |
128 } | 128 } |
129 #endif | 129 #endif |
130 | 130 |
131 const SkOpAngle* debugAngle(int id) const { | 131 const SkOpAngle* debugAngle(int id) const { |
132 return SkDEBUGRELEASE(this->globalState()->debugAngle(id), NULL); | 132 return SkDEBUGRELEASE(this->globalState()->debugAngle(id), nullptr); |
133 } | 133 } |
134 | 134 |
135 SkOpContour* debugContour(int id) { | 135 SkOpContour* debugContour(int id) { |
136 return SkDEBUGRELEASE(this->globalState()->debugContour(id), NULL); | 136 return SkDEBUGRELEASE(this->globalState()->debugContour(id), nullptr); |
137 } | 137 } |
138 | 138 |
139 const SkOpPtT* debugPtT(int id) const { | 139 const SkOpPtT* debugPtT(int id) const { |
140 return SkDEBUGRELEASE(this->globalState()->debugPtT(id), NULL); | 140 return SkDEBUGRELEASE(this->globalState()->debugPtT(id), nullptr); |
141 } | 141 } |
142 | 142 |
143 const SkOpSegment* debugSegment(int id) const { | 143 const SkOpSegment* debugSegment(int id) const { |
144 return SkDEBUGRELEASE(this->globalState()->debugSegment(id), NULL); | 144 return SkDEBUGRELEASE(this->globalState()->debugSegment(id), nullptr); |
145 } | 145 } |
146 | 146 |
147 const SkOpSpanBase* debugSpan(int id) const { | 147 const SkOpSpanBase* debugSpan(int id) const { |
148 return SkDEBUGRELEASE(this->globalState()->debugSpan(id), NULL); | 148 return SkDEBUGRELEASE(this->globalState()->debugSpan(id), nullptr); |
149 } | 149 } |
150 | 150 |
151 SkOpGlobalState* globalState() const { | 151 SkOpGlobalState* globalState() const { |
152 return fState; | 152 return fState; |
153 } | 153 } |
154 | 154 |
155 void debugValidate() const { | 155 void debugValidate() const { |
156 #if DEBUG_VALIDATE | 156 #if DEBUG_VALIDATE |
157 const SkOpSegment* segment = &fHead; | 157 const SkOpSegment* segment = &fHead; |
158 const SkOpSegment* prior = NULL; | 158 const SkOpSegment* prior = nullptr; |
159 do { | 159 do { |
160 segment->debugValidate(); | 160 segment->debugValidate(); |
161 SkASSERT(segment->prev() == prior); | 161 SkASSERT(segment->prev() == prior); |
162 prior = segment; | 162 prior = segment; |
163 } while ((segment = segment->next())); | 163 } while ((segment = segment->next())); |
164 SkASSERT(prior == fTail); | 164 SkASSERT(prior == fTail); |
165 #endif | 165 #endif |
166 } | 166 } |
167 | 167 |
168 bool done() const { | 168 bool done() const { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 SkDEBUGCODE(fDebugIndent -= 2); | 295 SkDEBUGCODE(fDebugIndent -= 2); |
296 } | 296 } |
297 | 297 |
298 void rayCheck(const SkOpRayHit& base, SkOpRayDir dir, SkOpRayHit** hits, SkC
hunkAlloc* ); | 298 void rayCheck(const SkOpRayHit& base, SkOpRayDir dir, SkOpRayHit** hits, SkC
hunkAlloc* ); |
299 | 299 |
300 void remove(SkOpContour* contour) { | 300 void remove(SkOpContour* contour) { |
301 if (contour == this) { | 301 if (contour == this) { |
302 SkASSERT(fCount == 0); | 302 SkASSERT(fCount == 0); |
303 return; | 303 return; |
304 } | 304 } |
305 SkASSERT(contour->fNext == NULL); | 305 SkASSERT(contour->fNext == nullptr); |
306 SkOpContour* prev = this; | 306 SkOpContour* prev = this; |
307 SkOpContour* next; | 307 SkOpContour* next; |
308 while ((next = prev->next()) != contour) { | 308 while ((next = prev->next()) != contour) { |
309 SkASSERT(next); | 309 SkASSERT(next); |
310 prev = next; | 310 prev = next; |
311 } | 311 } |
312 SkASSERT(prev); | 312 SkASSERT(prev); |
313 prev->setNext(NULL); | 313 prev->setNext(nullptr); |
314 } | 314 } |
315 | 315 |
316 void reset() { | 316 void reset() { |
317 fTail = NULL; | 317 fTail = nullptr; |
318 fNext = NULL; | 318 fNext = nullptr; |
319 fCount = 0; | 319 fCount = 0; |
320 fDone = false; | 320 fDone = false; |
321 fTopsFound = false; | 321 fTopsFound = false; |
322 SkDEBUGCODE(fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_Sca
larMin)); | 322 SkDEBUGCODE(fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_Sca
larMin)); |
323 SkDEBUGCODE(fFirstSorted = -1); | 323 SkDEBUGCODE(fFirstSorted = -1); |
324 SkDEBUGCODE(fDebugIndent = 0); | 324 SkDEBUGCODE(fDebugIndent = 0); |
325 } | 325 } |
326 | 326 |
327 void resetReverse() { | 327 void resetReverse() { |
328 SkOpContour* next = this; | 328 SkOpContour* next = this; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 bool fXor; // set if original path had even-odd fill | 422 bool fXor; // set if original path had even-odd fill |
423 bool fOppXor; // set if opposite path had even-odd fill | 423 bool fOppXor; // set if opposite path had even-odd fill |
424 SkDEBUGCODE(int fID); | 424 SkDEBUGCODE(int fID); |
425 SkDEBUGCODE(mutable int fDebugIndent); | 425 SkDEBUGCODE(mutable int fDebugIndent); |
426 }; | 426 }; |
427 | 427 |
428 class SkOpContourHead : public SkOpContour { | 428 class SkOpContourHead : public SkOpContour { |
429 }; | 429 }; |
430 | 430 |
431 #endif | 431 #endif |
OLD | NEW |