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

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

Issue 633393002: harden pathops for pathological test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: exclude new test that asserts in debug Created 6 years, 1 month 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/SkOpContour.cpp » ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void checkDuplicates() { 120 void checkDuplicates() {
121 int segmentCount = fSegments.count(); 121 int segmentCount = fSegments.count();
122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { 122 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
123 SkOpSegment& segment = fSegments[sIndex]; 123 SkOpSegment& segment = fSegments[sIndex];
124 if (segment.count() > 2) { 124 if (segment.count() > 2) {
125 segment.checkDuplicates(); 125 segment.checkDuplicates();
126 } 126 }
127 } 127 }
128 } 128 }
129 129
130 void checkEnds() { 130 bool checkEnds() {
131 if (!fContainsCurves) { 131 if (!fContainsCurves) {
132 return; 132 return true;
133 } 133 }
134 int segmentCount = fSegments.count(); 134 int segmentCount = fSegments.count();
135 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { 135 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
136 SkOpSegment* segment = &fSegments[sIndex]; 136 SkOpSegment* segment = &fSegments[sIndex];
137 if (segment->verb() == SkPath::kLine_Verb) { 137 if (segment->verb() == SkPath::kLine_Verb) {
138 continue; 138 continue;
139 } 139 }
140 if (segment->done()) { 140 if (segment->done()) {
141 continue; // likely coincident, nothing to do 141 continue; // likely coincident, nothing to do
142 } 142 }
143 segment->checkEnds(); 143 if (!segment->checkEnds()) {
144 return false;
145 }
144 } 146 }
147 return true;
145 } 148 }
146 149
147 void checkMultiples() { 150 void checkMultiples() {
148 int segmentCount = fSegments.count(); 151 int segmentCount = fSegments.count();
149 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { 152 for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
150 SkOpSegment& segment = fSegments[sIndex]; 153 SkOpSegment& segment = fSegments[sIndex];
151 if (segment.count() > 2) { 154 if (segment.count() > 2) {
152 segment.checkMultiples(); 155 segment.checkMultiples();
153 fMultiples |= segment.hasMultiples(); 156 fMultiples |= segment.hasMultiples();
154 } 157 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 bool fOppXor; 351 bool fOppXor;
349 #if defined(SK_DEBUG) || !FORCE_RELEASE 352 #if defined(SK_DEBUG) || !FORCE_RELEASE
350 int debugID() const { return fID; } 353 int debugID() const { return fID; }
351 int fID; 354 int fID;
352 #else 355 #else
353 int debugID() const { return -1; } 356 int debugID() const { return -1; }
354 #endif 357 #endif
355 }; 358 };
356 359
357 #endif 360 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698