OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkOpSpan_DEFINED | 7 #ifndef SkOpSpan_DEFINED |
8 #define SkOpSpan_DEFINED | 8 #define SkOpSpan_DEFINED |
9 | 9 |
10 #include "SkPathOpsDebug.h" | 10 #include "SkPathOpsDebug.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 SkASSERT(this != opp); | 43 SkASSERT(this != opp); |
44 this->fNext = opp; | 44 this->fNext = opp; |
45 SkASSERT(oppPrev != oldNext); | 45 SkASSERT(oppPrev != oldNext); |
46 oppPrev->fNext = oldNext; | 46 oppPrev->fNext = oldNext; |
47 } | 47 } |
48 | 48 |
49 bool alias() const; | 49 bool alias() const; |
50 SkOpContour* contour() const; | 50 SkOpContour* contour() const; |
51 | 51 |
52 int debugID() const { | 52 int debugID() const { |
53 return PATH_OPS_DEBUG_RELEASE(fID, -1); | 53 return SkDEBUGRELEASE(fID, -1); |
54 } | 54 } |
55 | 55 |
56 const SkOpAngle* debugAngle(int id) const; | 56 const SkOpAngle* debugAngle(int id) const; |
57 SkOpContour* debugContour(int id); | 57 SkOpContour* debugContour(int id); |
58 int debugLoopLimit(bool report) const; | 58 int debugLoopLimit(bool report) const; |
59 bool debugMatchID(int id) const; | 59 bool debugMatchID(int id) const; |
60 const SkOpPtT* debugPtT(int id) const; | 60 const SkOpPtT* debugPtT(int id) const; |
61 const SkOpSegment* debugSegment(int id) const; | 61 const SkOpSegment* debugSegment(int id) const; |
62 const SkOpSpanBase* debugSpan(int id) const; | 62 const SkOpSpanBase* debugSpan(int id) const; |
63 SkOpGlobalState* globalState() const; | 63 SkOpGlobalState* globalState() const; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return fSpan; | 112 return fSpan; |
113 } | 113 } |
114 | 114 |
115 double fT; | 115 double fT; |
116 SkPoint fPt; // cache of point value at this t | 116 SkPoint fPt; // cache of point value at this t |
117 protected: | 117 protected: |
118 SkOpSpanBase* fSpan; // contains winding data | 118 SkOpSpanBase* fSpan; // contains winding data |
119 SkOpPtT* fNext; // intersection on opposite curve or alias on this curve | 119 SkOpPtT* fNext; // intersection on opposite curve or alias on this curve |
120 bool fDeleted; // set if removed from span list | 120 bool fDeleted; // set if removed from span list |
121 bool fDuplicatePt; // set if identical pt is somewhere in the next loop | 121 bool fDuplicatePt; // set if identical pt is somewhere in the next loop |
122 PATH_OPS_DEBUG_CODE(int fID); | 122 SkDEBUGCODE(int fID); |
123 }; | 123 }; |
124 | 124 |
125 class SkOpSpanBase { | 125 class SkOpSpanBase { |
126 public: | 126 public: |
127 void addSimpleAngle(bool checkFrom , SkChunkAlloc* ); | 127 bool addSimpleAngle(bool checkFrom , SkChunkAlloc* ); |
128 void align(); | 128 void align(); |
129 | 129 |
130 bool aligned() const { | 130 bool aligned() const { |
131 return fAligned; | 131 return fAligned; |
132 } | 132 } |
133 | 133 |
134 void alignEnd(double t, const SkPoint& pt); | 134 void alignEnd(double t, const SkPoint& pt); |
135 | 135 |
136 bool chased() const { | 136 bool chased() const { |
137 return fChased; | 137 return fChased; |
(...skipping 19 matching lines...) Expand all Loading... |
157 return true; | 157 return true; |
158 } | 158 } |
159 } | 159 } |
160 return false; | 160 return false; |
161 } | 161 } |
162 | 162 |
163 bool containsCoinEnd(const SkOpSegment* ) const; | 163 bool containsCoinEnd(const SkOpSegment* ) const; |
164 SkOpContour* contour() const; | 164 SkOpContour* contour() const; |
165 | 165 |
166 int debugBumpCount() { | 166 int debugBumpCount() { |
167 return PATH_OPS_DEBUG_RELEASE(++fCount, -1); | 167 return SkDEBUGRELEASE(++fCount, -1); |
168 } | 168 } |
169 | 169 |
170 int debugID() const { | 170 int debugID() const { |
171 return PATH_OPS_DEBUG_RELEASE(fID, -1); | 171 return SkDEBUGRELEASE(fID, -1); |
172 } | 172 } |
173 | 173 |
174 const SkOpAngle* debugAngle(int id) const; | 174 const SkOpAngle* debugAngle(int id) const; |
175 bool debugCoinEndLoopCheck() const; | 175 bool debugCoinEndLoopCheck() const; |
176 SkOpContour* debugContour(int id); | 176 SkOpContour* debugContour(int id); |
177 const SkOpPtT* debugPtT(int id) const; | 177 const SkOpPtT* debugPtT(int id) const; |
178 const SkOpSegment* debugSegment(int id) const; | 178 const SkOpSegment* debugSegment(int id) const; |
179 const SkOpSpanBase* debugSpan(int id) const; | 179 const SkOpSpanBase* debugSpan(int id) const; |
180 SkOpGlobalState* globalState() const; | 180 SkOpGlobalState* globalState() const; |
181 void debugValidate() const; | 181 void debugValidate() const; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 void alignInner(); | 311 void alignInner(); |
312 | 312 |
313 protected: // no direct access to internals to avoid treating a span base as a
span | 313 protected: // no direct access to internals to avoid treating a span base as a
span |
314 SkOpPtT fPtT; // list of points and t values associated with the start of t
his span | 314 SkOpPtT fPtT; // list of points and t values associated with the start of t
his span |
315 SkOpSegment* fSegment; // segment that contains this span | 315 SkOpSegment* fSegment; // segment that contains this span |
316 SkOpSpanBase* fCoinEnd; // linked list of coincident spans that end here (m
ay point to itself) | 316 SkOpSpanBase* fCoinEnd; // linked list of coincident spans that end here (m
ay point to itself) |
317 SkOpAngle* fFromAngle; // points to next angle from span start to end | 317 SkOpAngle* fFromAngle; // points to next angle from span start to end |
318 SkOpSpan* fPrev; // previous intersection point | 318 SkOpSpan* fPrev; // previous intersection point |
319 bool fAligned; | 319 bool fAligned; |
320 bool fChased; // set after span has been added to chase array | 320 bool fChased; // set after span has been added to chase array |
321 PATH_OPS_DEBUG_CODE(int fCount); // number of pt/t pairs added | 321 SkDEBUGCODE(int fCount); // number of pt/t pairs added |
322 PATH_OPS_DEBUG_CODE(int fID); | 322 SkDEBUGCODE(int fID); |
323 }; | 323 }; |
324 | 324 |
325 class SkOpSpan : public SkOpSpanBase { | 325 class SkOpSpan : public SkOpSpanBase { |
326 public: | 326 public: |
327 void applyCoincidence(SkOpSpan* opp); | 327 void applyCoincidence(SkOpSpan* opp); |
328 | 328 |
329 bool clearCoincident() { | 329 bool clearCoincident() { |
330 SkASSERT(!final()); | 330 SkASSERT(!final()); |
331 if (fCoincident == this) { | 331 if (fCoincident == this) { |
332 return false; | 332 return false; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 SkOpAngle* fToAngle; // points to next angle from span start to end | 457 SkOpAngle* fToAngle; // points to next angle from span start to end |
458 SkOpSpanBase* fNext; // next intersection point | 458 SkOpSpanBase* fNext; // next intersection point |
459 int fWindSum; // accumulated from contours surrounding this one. | 459 int fWindSum; // accumulated from contours surrounding this one. |
460 int fOppSum; // for binary operators: the opposite winding sum | 460 int fOppSum; // for binary operators: the opposite winding sum |
461 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident | 461 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
462 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here | 462 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here |
463 bool fDone; // if set, this span to next higher T has been processed | 463 bool fDone; // if set, this span to next higher T has been processed |
464 }; | 464 }; |
465 | 465 |
466 #endif | 466 #endif |
OLD | NEW |