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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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), nullptr); | 132 return SkDEBUGRELEASE(this->globalState()->debugAngle(id), nullptr); |
133 } | 133 } |
134 | 134 |
| 135 void debugCheckHealth(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
| 136 |
135 SkOpContour* debugContour(int id) { | 137 SkOpContour* debugContour(int id) { |
136 return SkDEBUGRELEASE(this->globalState()->debugContour(id), nullptr); | 138 return SkDEBUGRELEASE(this->globalState()->debugContour(id), nullptr); |
137 } | 139 } |
138 | 140 |
| 141 void debugMissingCoincidence(const char* id, SkPathOpsDebug::GlitchLog* log, |
| 142 const SkOpCoincidence* coincidence) const; |
| 143 |
139 const SkOpPtT* debugPtT(int id) const { | 144 const SkOpPtT* debugPtT(int id) const { |
140 return SkDEBUGRELEASE(this->globalState()->debugPtT(id), nullptr); | 145 return SkDEBUGRELEASE(this->globalState()->debugPtT(id), nullptr); |
141 } | 146 } |
142 | 147 |
143 const SkOpSegment* debugSegment(int id) const { | 148 const SkOpSegment* debugSegment(int id) const { |
144 return SkDEBUGRELEASE(this->globalState()->debugSegment(id), nullptr); | 149 return SkDEBUGRELEASE(this->globalState()->debugSegment(id), nullptr); |
145 } | 150 } |
146 | 151 |
147 const SkOpSpanBase* debugSpan(int id) const { | 152 const SkOpSpanBase* debugSpan(int id) const { |
148 return SkDEBUGRELEASE(this->globalState()->debugSpan(id), nullptr); | 153 return SkDEBUGRELEASE(this->globalState()->debugSpan(id), nullptr); |
(...skipping 25 matching lines...) Expand all Loading... |
174 void dumpAngles() const; | 179 void dumpAngles() const; |
175 void dumpContours() const; | 180 void dumpContours() const; |
176 void dumpContoursAll() const; | 181 void dumpContoursAll() const; |
177 void dumpContoursAngles() const; | 182 void dumpContoursAngles() const; |
178 void dumpContoursPts() const; | 183 void dumpContoursPts() const; |
179 void dumpContoursPt(int segmentID) const; | 184 void dumpContoursPt(int segmentID) const; |
180 void dumpContoursSegment(int segmentID) const; | 185 void dumpContoursSegment(int segmentID) const; |
181 void dumpContoursSpan(int segmentID) const; | 186 void dumpContoursSpan(int segmentID) const; |
182 void dumpContoursSpans() const; | 187 void dumpContoursSpans() const; |
183 void dumpPt(int ) const; | 188 void dumpPt(int ) const; |
184 void dumpPts() const; | 189 void dumpPts(const char* prefix = "seg") const; |
185 void dumpPtsX() const; | 190 void dumpPtsX(const char* prefix) const; |
186 void dumpSegment(int ) const; | 191 void dumpSegment(int ) const; |
187 void dumpSegments(SkPathOp op) const; | 192 void dumpSegments(const char* prefix = "seg", SkPathOp op = (SkPathOp) -1) c
onst; |
188 void dumpSpan(int ) const; | 193 void dumpSpan(int ) const; |
189 void dumpSpans() const; | 194 void dumpSpans() const; |
190 | 195 |
191 const SkPoint& end() const { | 196 const SkPoint& end() const { |
192 return fTail->pts()[SkPathOpsVerbToPoints(fTail->verb())]; | 197 return fTail->pts()[SkPathOpsVerbToPoints(fTail->verb())]; |
193 } | 198 } |
194 | 199 |
195 bool findCollapsed() { | 200 bool findCollapsed() { |
196 SkASSERT(fCount > 0); | 201 SkASSERT(fCount > 0); |
197 SkOpSegment* segment = &fHead; | 202 SkOpSegment* segment = &fHead; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 segment->markAllDone(); | 243 segment->markAllDone(); |
239 } while ((segment = segment->next())); | 244 } while ((segment = segment->next())); |
240 } | 245 } |
241 | 246 |
242 bool missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocat
or) { | 247 bool missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocat
or) { |
243 SkASSERT(fCount > 0); | 248 SkASSERT(fCount > 0); |
244 SkOpSegment* segment = &fHead; | 249 SkOpSegment* segment = &fHead; |
245 bool result = false; | 250 bool result = false; |
246 do { | 251 do { |
247 if (fState->angleCoincidence()) { | 252 if (fState->angleCoincidence()) { |
248 segment->checkAngleCoin(coincidences, allocator); | 253 #if DEBUG_ANGLE |
| 254 segment->debugCheckAngleCoin(); |
| 255 #endif |
249 } else if (segment->missingCoincidence(coincidences, allocator)) { | 256 } else if (segment->missingCoincidence(coincidences, allocator)) { |
250 result = true; | 257 result = true; |
251 // FIXME: trying again loops forever in issue3651_6 | 258 // FIXME: trying again loops forever in issue3651_6 |
252 // The continue below is speculative -- once there's an actual case that req
uires it, | 259 // The continue below is speculative -- once there's an actual case that req
uires it, |
253 // add the plumbing necessary to look for another missing coincidence in the
same segment | 260 // add the plumbing necessary to look for another missing coincidence in the
same segment |
254 // continue; // try again in case another missing coincidence is
further along | 261 // continue; // try again in case another missing coincidence is
further along |
255 } | 262 } |
256 segment = segment->next(); | 263 segment = segment->next(); |
257 } while (segment); | 264 } while (segment); |
258 return result; | 265 return result; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 bool fXor; // set if original path had even-odd fill | 427 bool fXor; // set if original path had even-odd fill |
421 bool fOppXor; // set if opposite path had even-odd fill | 428 bool fOppXor; // set if opposite path had even-odd fill |
422 SkDEBUGCODE(int fID); | 429 SkDEBUGCODE(int fID); |
423 SkDEBUGCODE(mutable int fDebugIndent); | 430 SkDEBUGCODE(mutable int fDebugIndent); |
424 }; | 431 }; |
425 | 432 |
426 class SkOpContourHead : public SkOpContour { | 433 class SkOpContourHead : public SkOpContour { |
427 }; | 434 }; |
428 | 435 |
429 #endif | 436 #endif |
OLD | NEW |