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

Side by Side Diff: src/pathops/SkAddIntersections.cpp

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.h ('k') | src/pathops/SkOpContour.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkAddIntersections.h" 7 #include "SkAddIntersections.h"
8 #include "SkPathOpsBounds.h" 8 #include "SkPathOpsBounds.h"
9 9
10 #if DEBUG_ADD_INTERSECTING_TS 10 #if DEBUG_ADD_INTERSECTING_TS
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 SkPoint point = ts.pt(0).asSkPoint(); 427 SkPoint point = ts.pt(0).asSkPoint();
428 int testTAt = wt.addSelfT(point, ts[0][0]); 428 int testTAt = wt.addSelfT(point, ts[0][0]);
429 int nextTAt = wt.addSelfT(point, ts[1][0]); 429 int nextTAt = wt.addSelfT(point, ts[1][0]);
430 wt.addOtherT(testTAt, ts[1][0], nextTAt); 430 wt.addOtherT(testTAt, ts[1][0], nextTAt);
431 wt.addOtherT(nextTAt, ts[0][0], testTAt); 431 wt.addOtherT(nextTAt, ts[0][0], testTAt);
432 } while (wt.advance()); 432 } while (wt.advance());
433 } 433 }
434 434
435 // resolve any coincident pairs found while intersecting, and 435 // resolve any coincident pairs found while intersecting, and
436 // see if coincidence is formed by clipping non-concident segments 436 // see if coincidence is formed by clipping non-concident segments
437 void CoincidenceCheck(SkTArray<SkOpContour*, true>* contourList, int total) { 437 bool CoincidenceCheck(SkTArray<SkOpContour*, true>* contourList, int total) {
438 int contourCount = (*contourList).count(); 438 int contourCount = (*contourList).count();
439 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 439 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
440 SkOpContour* contour = (*contourList)[cIndex]; 440 SkOpContour* contour = (*contourList)[cIndex];
441 contour->resolveNearCoincidence(); 441 contour->resolveNearCoincidence();
442 } 442 }
443 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 443 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
444 SkOpContour* contour = (*contourList)[cIndex]; 444 SkOpContour* contour = (*contourList)[cIndex];
445 contour->addCoincidentPoints(); 445 contour->addCoincidentPoints();
446 } 446 }
447 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 447 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
448 SkOpContour* contour = (*contourList)[cIndex]; 448 SkOpContour* contour = (*contourList)[cIndex];
449 contour->calcCoincidentWinding(); 449 if (!contour->calcCoincidentWinding()) {
450 return false;
451 }
450 } 452 }
451 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 453 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
452 SkOpContour* contour = (*contourList)[cIndex]; 454 SkOpContour* contour = (*contourList)[cIndex];
453 contour->calcPartialCoincidentWinding(); 455 contour->calcPartialCoincidentWinding();
454 } 456 }
457 return true;
455 } 458 }
OLDNEW
« no previous file with comments | « src/pathops/SkAddIntersections.h ('k') | src/pathops/SkOpContour.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698