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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return segment.pts()[SkPathOpsVerbToPoints(segment.verb())]; | 145 return segment.pts()[SkPathOpsVerbToPoints(segment.verb())]; |
146 } | 146 } |
147 | 147 |
148 void fixOtherTIndex() { | 148 void fixOtherTIndex() { |
149 int segmentCount = fSegments.count(); | 149 int segmentCount = fSegments.count(); |
150 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { | 150 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { |
151 fSegments[sIndex].fixOtherTIndex(); | 151 fSegments[sIndex].fixOtherTIndex(); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
| 155 void joinCoincidence() { |
| 156 joinCoincidence(fCoincidences, false); |
| 157 joinCoincidence(fPartialCoincidences, true); |
| 158 } |
| 159 |
155 SkOpSegment* nonVerticalSegment(int* start, int* end); | 160 SkOpSegment* nonVerticalSegment(int* start, int* end); |
156 | 161 |
157 bool operand() const { | 162 bool operand() const { |
158 return fOperand; | 163 return fOperand; |
159 } | 164 } |
160 | 165 |
161 void reset() { | 166 void reset() { |
162 fSegments.reset(); | 167 fSegments.reset(); |
163 fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMax, SK_ScalarMax); | 168 fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMax, SK_ScalarMax); |
164 fContainsCurves = fContainsCubics = fContainsIntercepts = fDone = false; | 169 fContainsCurves = fContainsCubics = fContainsIntercepts = fDone = false; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 237 } |
233 } | 238 } |
234 #endif | 239 #endif |
235 | 240 |
236 #if DEBUG_SHOW_WINDING | 241 #if DEBUG_SHOW_WINDING |
237 int debugShowWindingValues(int totalSegments, int ofInterest); | 242 int debugShowWindingValues(int totalSegments, int ofInterest); |
238 static void debugShowWindingValues(const SkTArray<SkOpContour*, true>& conto
urList); | 243 static void debugShowWindingValues(const SkTArray<SkOpContour*, true>& conto
urList); |
239 #endif | 244 #endif |
240 | 245 |
241 private: | 246 private: |
242 void calcCommonCoincidentWinding(const SkCoincidence& coincidence); | 247 void calcCommonCoincidentWinding(const SkCoincidence& ); |
| 248 void joinCoincidence(const SkTArray<SkCoincidence, true>& , bool partial); |
243 void setBounds(); | 249 void setBounds(); |
244 | 250 |
245 SkTArray<SkOpSegment> fSegments; | 251 SkTArray<SkOpSegment> fSegments; |
246 SkTArray<SkOpSegment*, true> fSortedSegments; | 252 SkTArray<SkOpSegment*, true> fSortedSegments; |
247 int fFirstSorted; | 253 int fFirstSorted; |
248 SkTArray<SkCoincidence, true> fCoincidences; | 254 SkTArray<SkCoincidence, true> fCoincidences; |
249 SkTArray<SkCoincidence, true> fPartialCoincidences; | 255 SkTArray<SkCoincidence, true> fPartialCoincidences; |
250 SkTArray<const SkOpContour*, true> fCrosses; | 256 SkTArray<const SkOpContour*, true> fCrosses; |
251 SkPathOpsBounds fBounds; | 257 SkPathOpsBounds fBounds; |
252 bool fContainsIntercepts; // FIXME: is this used by anybody? | 258 bool fContainsIntercepts; // FIXME: is this used by anybody? |
253 bool fContainsCubics; | 259 bool fContainsCubics; |
254 bool fContainsCurves; | 260 bool fContainsCurves; |
255 bool fDone; | 261 bool fDone; |
256 bool fOperand; // true for the second argument to a binary operator | 262 bool fOperand; // true for the second argument to a binary operator |
257 bool fXor; | 263 bool fXor; |
258 bool fOppXor; | 264 bool fOppXor; |
259 #ifdef SK_DEBUG | 265 #ifdef SK_DEBUG |
260 int fID; | 266 int fID; |
261 #endif | 267 #endif |
262 }; | 268 }; |
263 | 269 |
264 #endif | 270 #endif |
OLD | NEW |