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

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

Issue 1182493015: pathops coincident fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: all tests (including extended) work Created 5 years, 5 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/SkOpCoincidence.cpp ('k') | src/pathops/SkOpSegment.h » ('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 16 matching lines...) Expand all
27 fNext->~SkOpContour(); 27 fNext->~SkOpContour();
28 } 28 }
29 } 29 }
30 30
31 bool operator<(const SkOpContour& rh) const { 31 bool operator<(const SkOpContour& rh) const {
32 return fBounds.fTop == rh.fBounds.fTop 32 return fBounds.fTop == rh.fBounds.fTop
33 ? fBounds.fLeft < rh.fBounds.fLeft 33 ? fBounds.fLeft < rh.fBounds.fLeft
34 : fBounds.fTop < rh.fBounds.fTop; 34 : fBounds.fTop < rh.fBounds.fTop;
35 } 35 }
36 36
37 void addAlignIntersections(SkOpContourHead* contourList, SkChunkAlloc* alloc ator) {
38 SkASSERT(fCount > 0);
39 SkOpSegment* segment = &fHead;
40 do {
41 segment->addAlignIntersections(contourList, allocator);
42 } while ((segment = segment->next()));
43 }
44
37 void addConic(SkPoint pts[3], SkScalar weight, SkChunkAlloc* allocator) { 45 void addConic(SkPoint pts[3], SkScalar weight, SkChunkAlloc* allocator) {
38 appendSegment(allocator).addConic(pts, weight, this); 46 appendSegment(allocator).addConic(pts, weight, this);
39 } 47 }
40 48
41 void addCubic(SkPoint pts[4], SkChunkAlloc* allocator) { 49 void addCubic(SkPoint pts[4], SkChunkAlloc* allocator) {
42 appendSegment(allocator).addCubic(pts, this); 50 appendSegment(allocator).addCubic(pts, this);
43 } 51 }
44 52
45 SkOpSegment* addCurve(SkPath::Verb verb, const SkPoint pts[4], SkChunkAlloc* allocator); 53 SkOpSegment* addCurve(SkPath::Verb verb, const SkPoint pts[4], SkChunkAlloc* allocator);
46 54
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return fXor; 223 return fXor;
216 } 224 }
217 225
218 void markDone() { 226 void markDone() {
219 SkOpSegment* segment = &fHead; 227 SkOpSegment* segment = &fHead;
220 do { 228 do {
221 segment->markAllDone(); 229 segment->markAllDone();
222 } while ((segment = segment->next())); 230 } while ((segment = segment->next()));
223 } 231 }
224 232
225 void missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocat or) { 233 bool missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocat or) {
226 SkASSERT(fCount > 0); 234 SkASSERT(fCount > 0);
227 SkOpSegment* segment = &fHead; 235 SkOpSegment* segment = &fHead;
236 bool result = false;
228 do { 237 do {
229 if (fState->angleCoincidence()) { 238 if (fState->angleCoincidence()) {
230 segment->checkAngleCoin(coincidences, allocator); 239 segment->checkAngleCoin(coincidences, allocator);
231 } else { 240 } else if (segment->missingCoincidence(coincidences, allocator)) {
232 segment->missingCoincidence(coincidences, allocator); 241 result = true;
242 // FIXME: trying again loops forever in issue3651_6
243 // The continue below is speculative -- once there's an actual case that req uires it,
244 // add the plumbing necessary to look for another missing coincidence in the same segment
245 // continue; // try again in case another missing coincidence is further along
233 } 246 }
234 } while ((segment = segment->next())); 247 segment = segment->next();
248 } while (segment);
249 return result;
235 } 250 }
236 251
237 bool moveMultiples() { 252 bool moveMultiples() {
238 SkASSERT(fCount > 0); 253 SkASSERT(fCount > 0);
239 SkOpSegment* segment = &fHead; 254 SkOpSegment* segment = &fHead;
240 do { 255 do {
241 segment->moveMultiples(); 256 segment->moveMultiples();
242 } while ((segment = segment->next())); 257 } while ((segment = segment->next()));
243 return true; 258 return true;
244 } 259 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 bool fXor; // set if original path had even-odd fill 413 bool fXor; // set if original path had even-odd fill
399 bool fOppXor; // set if opposite path had even-odd fill 414 bool fOppXor; // set if opposite path had even-odd fill
400 SkDEBUGCODE(int fID); 415 SkDEBUGCODE(int fID);
401 SkDEBUGCODE(mutable int fDebugIndent); 416 SkDEBUGCODE(mutable int fDebugIndent);
402 }; 417 };
403 418
404 class SkOpContourHead : public SkOpContour { 419 class SkOpContourHead : public SkOpContour {
405 }; 420 };
406 421
407 #endif 422 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698