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

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

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm 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/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsConic.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 "SkOpCoincidence.h" 8 #include "SkOpCoincidence.h"
9 #include "SkOpEdgeBuilder.h" 9 #include "SkOpEdgeBuilder.h"
10 #include "SkPathOpsCommon.h" 10 #include "SkPathOpsCommon.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } else { 311 } else {
312 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); 312 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS());
313 } 313 }
314 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); 314 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS());
315 315
316 SkOpCoincidence overlaps(globalState); 316 SkOpCoincidence overlaps(globalState);
317 safetyHatch = SAFETY_COUNT; 317 safetyHatch = SAFETY_COUNT;
318 do { 318 do {
319 SkOpCoincidence* pairs = overlaps.isEmpty() ? coincidence : &overlaps; 319 SkOpCoincidence* pairs = overlaps.isEmpty() ? coincidence : &overlaps;
320 // adjust the winding value to account for coincident edges 320 // adjust the winding value to account for coincident edges
321 pairs->apply(DEBUG_ITER_ONLY_PARAMS(SAFETY_COUNT - safetyHatch)); 321 if (!pairs->apply(DEBUG_ITER_ONLY_PARAMS(SAFETY_COUNT - safetyHatch))) {
322 return false;
323 }
322 // For each coincident pair that overlaps another, when the receivers (t he 1st of the pair) 324 // For each coincident pair that overlaps another, when the receivers (t he 1st of the pair)
323 // are different, construct a new pair to resolve their mutual span 325 // are different, construct a new pair to resolve their mutual span
324 if (!pairs->findOverlaps(&overlaps DEBUG_ITER_PARAMS(SAFETY_COUNT - saf etyHatch))) { 326 if (!pairs->findOverlaps(&overlaps DEBUG_ITER_PARAMS(SAFETY_COUNT - saf etyHatch))) {
325 return false; 327 return false;
326 } 328 }
327 if (!--safetyHatch) { 329 if (!--safetyHatch) {
328 SkASSERT(globalState->debugSkipAssert()); 330 SkASSERT(globalState->debugSkipAssert());
329 return false; 331 return false;
330 } 332 }
331 } while (!overlaps.isEmpty()); 333 } while (!overlaps.isEmpty());
332 calc_angles(contourList DEBUG_COIN_PARAMS()); 334 calc_angles(contourList DEBUG_COIN_PARAMS());
333 if (!sort_angles(contourList)) { 335 if (!sort_angles(contourList)) {
334 return false; 336 return false;
335 } 337 }
336 #if DEBUG_COINCIDENCE_VERBOSE 338 #if DEBUG_COINCIDENCE_VERBOSE
337 coincidence->debugShowCoincidence(); 339 coincidence->debugShowCoincidence();
338 #endif 340 #endif
339 #if DEBUG_COINCIDENCE 341 #if DEBUG_COINCIDENCE
340 coincidence->debugValidate(); 342 coincidence->debugValidate();
341 #endif 343 #endif
342 SkPathOpsDebug::ShowActiveSpans(contourList); 344 SkPathOpsDebug::ShowActiveSpans(contourList);
343 return true; 345 return true;
344 } 346 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsConic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698