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

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

Issue 2404483002: fix fuzz busters (Closed)
Patch Set: 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 | « no previous file | src/pathops/SkPathOpsTSect.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 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 } 763 }
764 const SkOpSegment* outerOpp = oos->segment(); 764 const SkOpSegment* outerOpp = oos->segment();
765 SkASSERT(!outerOpp->done()); 765 SkASSERT(!outerOpp->done());
766 SkOpSegment* outerCoinWritable = const_cast<SkOpSegment*>(outerCoin); 766 SkOpSegment* outerCoinWritable = const_cast<SkOpSegment*>(outerCoin);
767 SkOpSegment* outerOppWritable = const_cast<SkOpSegment*>(outerOpp); 767 SkOpSegment* outerOppWritable = const_cast<SkOpSegment*>(outerOpp);
768 SkCoincidentSpans* inner = outer; 768 SkCoincidentSpans* inner = outer;
769 while ((inner = inner->next())) { 769 while ((inner = inner->next())) {
770 this->debugValidate(); 770 this->debugValidate();
771 double overS, overE; 771 double overS, overE;
772 const SkOpPtT* ics = inner->coinPtTStart(); 772 const SkOpPtT* ics = inner->coinPtTStart();
773 SkASSERT(!ics->deleted()); 773 FAIL_IF(ics->deleted());
774 const SkOpSegment* innerCoin = ics->segment(); 774 const SkOpSegment* innerCoin = ics->segment();
775 SkASSERT(!innerCoin->done()); 775 SkASSERT(!innerCoin->done());
776 const SkOpPtT* ios = inner->oppPtTStart(); 776 const SkOpPtT* ios = inner->oppPtTStart();
777 SkASSERT(!ios->deleted()); 777 SkASSERT(!ios->deleted());
778 const SkOpSegment* innerOpp = ios->segment(); 778 const SkOpSegment* innerOpp = ios->segment();
779 SkASSERT(!innerOpp->done()); 779 SkASSERT(!innerOpp->done());
780 SkOpSegment* innerCoinWritable = const_cast<SkOpSegment*>(innerCoin) ; 780 SkOpSegment* innerCoinWritable = const_cast<SkOpSegment*>(innerCoin) ;
781 SkOpSegment* innerOppWritable = const_cast<SkOpSegment*>(innerOpp); 781 SkOpSegment* innerOppWritable = const_cast<SkOpSegment*>(innerOpp);
782 if (outerCoin == innerCoin) { 782 if (outerCoin == innerCoin) {
783 const SkOpPtT* oce = outer->coinPtTEnd(); 783 const SkOpPtT* oce = outer->coinPtTEnd();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 839
840 bool SkOpCoincidence::addOverlap(const SkOpSegment* seg1, const SkOpSegment* seg 1o, 840 bool SkOpCoincidence::addOverlap(const SkOpSegment* seg1, const SkOpSegment* seg 1o,
841 const SkOpSegment* seg2, const SkOpSegment* seg2o, 841 const SkOpSegment* seg2, const SkOpSegment* seg2o,
842 const SkOpPtT* overS, const SkOpPtT* overE) { 842 const SkOpPtT* overS, const SkOpPtT* overE) {
843 const SkOpPtT* s1 = overS->find(seg1); 843 const SkOpPtT* s1 = overS->find(seg1);
844 const SkOpPtT* e1 = overE->find(seg1); 844 const SkOpPtT* e1 = overE->find(seg1);
845 FAIL_IF(!e1); 845 FAIL_IF(!e1);
846 if (!s1->starter(e1)->span()->upCast()->windValue()) { 846 if (!s1->starter(e1)->span()->upCast()->windValue()) {
847 s1 = overS->find(seg1o); 847 s1 = overS->find(seg1o);
848 e1 = overE->find(seg1o); 848 e1 = overE->find(seg1o);
849 FAIL_IF(!s1);
849 FAIL_IF(!e1); 850 FAIL_IF(!e1);
850 if (!s1->starter(e1)->span()->upCast()->windValue()) { 851 if (!s1->starter(e1)->span()->upCast()->windValue()) {
851 return true; 852 return true;
852 } 853 }
853 } 854 }
854 const SkOpPtT* s2 = overS->find(seg2); 855 const SkOpPtT* s2 = overS->find(seg2);
855 const SkOpPtT* e2 = overE->find(seg2); 856 const SkOpPtT* e2 = overE->find(seg2);
856 if (!s2->starter(e2)->span()->upCast()->windValue()) { 857 if (!s2->starter(e2)->span()->upCast()->windValue()) {
857 s2 = overS->find(seg2o); 858 s2 = overS->find(seg2o);
858 e2 = overE->find(seg2o); 859 e2 = overE->find(seg2o);
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 } 1360 }
1360 do { 1361 do {
1361 if (coin->coinPtTStart()->segment() == deleted 1362 if (coin->coinPtTStart()->segment() == deleted
1362 || coin->coinPtTEnd()->segment() == deleted 1363 || coin->coinPtTEnd()->segment() == deleted
1363 || coin->oppPtTStart()->segment() == deleted 1364 || coin->oppPtTStart()->segment() == deleted
1364 || coin->oppPtTEnd()->segment() == deleted) { 1365 || coin->oppPtTEnd()->segment() == deleted) {
1365 this->release(fHead, coin); 1366 this->release(fHead, coin);
1366 } 1367 }
1367 } while ((coin = coin->next())); 1368 } while ((coin = coin->next()));
1368 } 1369 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkPathOpsTSect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698