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

Unified Diff: src/pathops/SkPathOpsCommon.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsDebug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCommon.cpp
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index b4049bc5d9bd30f2502319e345a997fe49fdf12c..a1cd7bbd63089219f3f79447a3c6bc98e97d7ad9 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -235,11 +235,14 @@ static void move_nearby(SkOpContourHead* contourList DEBUG_COIN_DECLARE_PARAMS(
} while ((contour = contour->next()));
}
-static void sort_angles(SkOpContourHead* contourList) {
+static bool sort_angles(SkOpContourHead* contourList) {
SkOpContour* contour = contourList;
do {
- contour->sortAngles();
+ if (!contour->sortAngles()) {
+ return false;
+ }
} while ((contour = contour->next()));
+ return true;
}
bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidence) {
@@ -327,7 +330,9 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc
}
} while (!overlaps.isEmpty());
calc_angles(contourList DEBUG_COIN_PARAMS());
- sort_angles(contourList);
+ if (!sort_angles(contourList)) {
+ return false;
+ }
#if DEBUG_COINCIDENCE_VERBOSE
coincidence->debugShowCoincidence();
#endif
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsDebug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698