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

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

Issue 2426753002: break ambiguous angle sorting loop (Closed)
Patch Set: fix linux warning Created 4 years, 2 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/SkOpAngle.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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698