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

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

Issue 1394503003: fix some pathops bugs found in 1M skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init to avoid warning Created 5 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 | « gyp/pathops_unittest.gypi ('k') | src/pathops/SkIntersections.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 "SkPathOpsBounds.h" 9 #include "SkPathOpsBounds.h"
10 10
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 debugShowCubicIntersection(pts, wt, wn, ts); 490 debugShowCubicIntersection(pts, wt, wn, ts);
491 break; 491 break;
492 } 492 }
493 default: 493 default:
494 SkASSERT(0); 494 SkASSERT(0);
495 } 495 }
496 break; 496 break;
497 default: 497 default:
498 SkASSERT(0); 498 SkASSERT(0);
499 } 499 }
500 #if DEBUG_T_SECT_LOOP_COUNT
501 test->globalState()->debugAddLoopCount(&ts, wt, wn);
502 #endif
500 int coinIndex = -1; 503 int coinIndex = -1;
501 SkOpPtT* coinPtT[2]; 504 SkOpPtT* coinPtT[2];
502 for (int pt = 0; pt < pts; ++pt) { 505 for (int pt = 0; pt < pts; ++pt) {
503 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); 506 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1);
504 SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1); 507 SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1);
505 wt.segment()->debugValidate(); 508 wt.segment()->debugValidate();
506 SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt], SkOpSegment: :kAllowAlias, 509 SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt], SkOpSegment: :kAllowAlias,
507 allocator); 510 allocator);
508 wn.segment()->debugValidate(); 511 wn.segment()->debugValidate();
509 SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt], SkOpSegment ::kAllowAlias, 512 SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt], SkOpSegment ::kAllowAlias,
(...skipping 30 matching lines...) Expand all
540 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt, alloc ator); 543 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt, alloc ator);
541 wt.segment()->debugValidate(); 544 wt.segment()->debugValidate();
542 wn.segment()->debugValidate(); 545 wn.segment()->debugValidate();
543 coinIndex = -1; 546 coinIndex = -1;
544 } 547 }
545 SkASSERT(coinIndex < 0); // expect coincidence to be paired 548 SkASSERT(coinIndex < 0); // expect coincidence to be paired
546 } while (wn.advance()); 549 } while (wn.advance());
547 } while (wt.advance()); 550 } while (wt.advance());
548 return true; 551 return true;
549 } 552 }
OLDNEW
« no previous file with comments | « gyp/pathops_unittest.gypi ('k') | src/pathops/SkIntersections.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698