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

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

Issue 585913002: fail early if coincidence can't be resolved (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « src/pathops/SkAddIntersections.cpp ('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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 void alignTPt(int segmentIndex, const SkOpContour* other, int otherIndex, 109 void alignTPt(int segmentIndex, const SkOpContour* other, int otherIndex,
110 bool swap, int tIndex, SkIntersections* ts, SkPoint* point) co nst; 110 bool swap, int tIndex, SkIntersections* ts, SkPoint* point) co nst;
111 111
112 const SkPathOpsBounds& bounds() const { 112 const SkPathOpsBounds& bounds() const {
113 return fBounds; 113 return fBounds;
114 } 114 }
115 115
116 bool calcAngles(); 116 bool calcAngles();
117 void calcCoincidentWinding(); 117 bool calcCoincidentWinding();
118 void calcPartialCoincidentWinding(); 118 void calcPartialCoincidentWinding();
119 119
120 void checkDuplicates() { 120 void checkDuplicates() {
121 int segmentCount = fSegments.count(); 121 int segmentCount = fSegments.count();
122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { 122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
123 SkOpSegment& segment = fSegments[sIndex]; 123 SkOpSegment& segment = fSegments[sIndex];
124 if (segment.count() > 2) { 124 if (segment.count() > 2) {
125 segment.checkDuplicates(); 125 segment.checkDuplicates();
126 } 126 }
127 } 127 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 void dumpCoincidence(const SkCoincidence& ) const; 318 void dumpCoincidence(const SkCoincidence& ) const;
319 void dumpCoincidences() const; 319 void dumpCoincidences() const;
320 void dumpPt(int ) const; 320 void dumpPt(int ) const;
321 void dumpPts() const; 321 void dumpPts() const;
322 void dumpSpan(int ) const; 322 void dumpSpan(int ) const;
323 void dumpSpans() const; 323 void dumpSpans() const;
324 324
325 private: 325 private:
326 void alignPt(int index, SkPoint* point, int zeroPt) const; 326 void alignPt(int index, SkPoint* point, int zeroPt) const;
327 int alignT(bool swap, int tIndex, SkIntersections* ts) const; 327 int alignT(bool swap, int tIndex, SkIntersections* ts) const;
328 void calcCommonCoincidentWinding(const SkCoincidence& ); 328 bool calcCommonCoincidentWinding(const SkCoincidence& );
329 void checkCoincidentPair(const SkCoincidence& oneCoin, int oneIdx, 329 void checkCoincidentPair(const SkCoincidence& oneCoin, int oneIdx,
330 const SkCoincidence& twoCoin, int twoIdx, bool part ial); 330 const SkCoincidence& twoCoin, int twoIdx, bool part ial);
331 void joinCoincidence(const SkTArray<SkCoincidence, true>& , bool partial); 331 void joinCoincidence(const SkTArray<SkCoincidence, true>& , bool partial);
332 void setBounds(); 332 void setBounds();
333 333
334 SkTArray<SkOpSegment> fSegments; 334 SkTArray<SkOpSegment> fSegments;
335 SkTArray<SkOpSegment*, true> fSortedSegments; 335 SkTArray<SkOpSegment*, true> fSortedSegments;
336 int fFirstSorted; 336 int fFirstSorted;
337 SkTArray<SkCoincidence, true> fCoincidences; 337 SkTArray<SkCoincidence, true> fCoincidences;
338 SkTArray<SkCoincidence, true> fPartialCoincidences; 338 SkTArray<SkCoincidence, true> fPartialCoincidences;
339 SkTArray<const SkOpContour*, true> fCrosses; 339 SkTArray<const SkOpContour*, true> fCrosses;
340 SkPathOpsBounds fBounds; 340 SkPathOpsBounds fBounds;
341 bool fContainsIntercepts; // FIXME: is this used by anybody? 341 bool fContainsIntercepts; // FIXME: is this used by anybody?
342 bool fContainsCubics; 342 bool fContainsCubics;
343 bool fContainsCurves; 343 bool fContainsCurves;
344 bool fDone; 344 bool fDone;
345 bool fMultiples; // set if some segment has multiple identical intersection s with other curves 345 bool fMultiples; // set if some segment has multiple identical intersection s with other curves
346 bool fOperand; // true for the second argument to a binary operator 346 bool fOperand; // true for the second argument to a binary operator
347 bool fXor; 347 bool fXor;
348 bool fOppXor; 348 bool fOppXor;
349 #if defined(SK_DEBUG) || !FORCE_RELEASE 349 #if defined(SK_DEBUG) || !FORCE_RELEASE
350 int debugID() const { return fID; } 350 int debugID() const { return fID; }
351 int fID; 351 int fID;
352 #else 352 #else
353 int debugID() const { return -1; } 353 int debugID() const { return -1; }
354 #endif 354 #endif
355 }; 355 };
356 356
357 #endif 357 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkAddIntersections.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698