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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 } | 334 } |
335 | 335 |
336 void setReverse() { | 336 void setReverse() { |
337 fReverse = true; | 337 fReverse = true; |
338 } | 338 } |
339 | 339 |
340 void setXor(bool isXor) { | 340 void setXor(bool isXor) { |
341 fXor = isXor; | 341 fXor = isXor; |
342 } | 342 } |
343 | 343 |
344 void sortAngles() { | 344 bool sortAngles() { |
345 SkASSERT(fCount > 0); | 345 SkASSERT(fCount > 0); |
346 SkOpSegment* segment = &fHead; | 346 SkOpSegment* segment = &fHead; |
347 do { | 347 do { |
348 segment->sortAngles(); | 348 FAIL_IF(!segment->sortAngles()); |
349 } while ((segment = segment->next())); | 349 } while ((segment = segment->next())); |
| 350 return true; |
350 } | 351 } |
351 | 352 |
352 const SkPoint& start() const { | 353 const SkPoint& start() const { |
353 return fHead.pts()[0]; | 354 return fHead.pts()[0]; |
354 } | 355 } |
355 | 356 |
356 void toPartialBackward(SkPathWriter* path) const { | 357 void toPartialBackward(SkPathWriter* path) const { |
357 const SkOpSegment* segment = fTail; | 358 const SkOpSegment* segment = fTail; |
358 do { | 359 do { |
359 SkAssertResult(segment->addCurveTo(segment->tail(), segment->head(),
path)); | 360 SkAssertResult(segment->addCurveTo(segment->tail(), segment->head(),
path)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 SkASSERT(next); | 423 SkASSERT(next); |
423 prev = next; | 424 prev = next; |
424 } | 425 } |
425 SkASSERT(prev); | 426 SkASSERT(prev); |
426 prev->setNext(nullptr); | 427 prev->setNext(nullptr); |
427 } | 428 } |
428 | 429 |
429 }; | 430 }; |
430 | 431 |
431 #endif | 432 #endif |
OLD | NEW |