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

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

Issue 2357373002: fix next kevin fuzz (Closed)
Patch Set: Created 4 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/SkOpCoincidence.h ('k') | src/pathops/SkOpSpan.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 2015 Google Inc. 2 * Copyright 2015 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 "SkOpCoincidence.h" 7 #include "SkOpCoincidence.h"
8 #include "SkOpSegment.h" 8 #include "SkOpSegment.h"
9 #include "SkPathOpsTSect.h" 9 #include "SkPathOpsTSect.h"
10 10
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 double oPriorT = oStartPtT->fT; 454 double oPriorT = oStartPtT->fT;
455 FAIL_IF(!startPtT->contains(oStartPtT)); 455 FAIL_IF(!startPtT->contains(oStartPtT));
456 SkOPASSERT(coin->coinPtTEnd()->contains(coin->oppPtTEnd())); 456 SkOPASSERT(coin->coinPtTEnd()->contains(coin->oppPtTEnd()));
457 const SkOpSpanBase* start = startPtT->span(); 457 const SkOpSpanBase* start = startPtT->span();
458 const SkOpSpanBase* oStart = oStartPtT->span(); 458 const SkOpSpanBase* oStart = oStartPtT->span();
459 const SkOpSpanBase* end = coin->coinPtTEnd()->span(); 459 const SkOpSpanBase* end = coin->coinPtTEnd()->span();
460 const SkOpSpanBase* oEnd = coin->oppPtTEnd()->span(); 460 const SkOpSpanBase* oEnd = coin->oppPtTEnd()->span();
461 FAIL_IF(oEnd->deleted()); 461 FAIL_IF(oEnd->deleted());
462 FAIL_IF(!start->upCastable()); 462 FAIL_IF(!start->upCastable());
463 const SkOpSpanBase* test = start->upCast()->next(); 463 const SkOpSpanBase* test = start->upCast()->next();
464 FAIL_IF(!coin->flipped() && !oStart->upCastable());
464 const SkOpSpanBase* oTest = coin->flipped() ? oStart->prev() : oStart->u pCast()->next(); 465 const SkOpSpanBase* oTest = coin->flipped() ? oStart->prev() : oStart->u pCast()->next();
465 FAIL_IF(!oTest); 466 FAIL_IF(!oTest);
466 SkOpSegment* seg = start->segment(); 467 SkOpSegment* seg = start->segment();
467 SkOpSegment* oSeg = oStart->segment(); 468 SkOpSegment* oSeg = oStart->segment();
468 while (test != end || oTest != oEnd) { 469 while (test != end || oTest != oEnd) {
469 const SkOpPtT* containedOpp = test->ptT()->contains(oSeg); 470 const SkOpPtT* containedOpp = test->ptT()->contains(oSeg);
470 const SkOpPtT* containedThis = oTest->ptT()->contains(seg); 471 const SkOpPtT* containedThis = oTest->ptT()->contains(seg);
471 if (!containedOpp || !containedThis) { 472 if (!containedOpp || !containedThis) {
472 // choose the ends, or the first common pt-t list shared by both 473 // choose the ends, or the first common pt-t list shared by both
473 double nextT, oNextT; 474 double nextT, oNextT;
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 this->release(fHead, coin); 1604 this->release(fHead, coin);
1604 } 1605 }
1605 } while ((coin = coin->next())); 1606 } while ((coin = coin->next()));
1606 } 1607 }
1607 1608
1608 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S kOpPtT* testS, 1609 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S kOpPtT* testS,
1609 const SkOpPtT* testE) const { 1610 const SkOpPtT* testE) const {
1610 return testS->segment()->testForCoincidence(testS, testE, testS->span(), 1611 return testS->segment()->testForCoincidence(testS, testE, testS->span(),
1611 testE->span(), outer->coinPtTStart()->segment()); 1612 testE->span(), outer->coinPtTStart()->segment());
1612 } 1613 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.h ('k') | src/pathops/SkOpSpan.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698