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

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

Issue 1524803002: path ops: check for deleted ends (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | tests/PathOpsBuilderTest.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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 SkOpSpan* oStart = (flipped ? coin->fOppPtTEnd : coin->fOppPtTStart)->sp an()->upCast(); 383 SkOpSpan* oStart = (flipped ? coin->fOppPtTEnd : coin->fOppPtTStart)->sp an()->upCast();
384 if (oStart->deleted()) { 384 if (oStart->deleted()) {
385 continue; 385 continue;
386 } 386 }
387 SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)-> span(); 387 SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)-> span();
388 SkASSERT(oStart == oStart->starter(oEnd)); 388 SkASSERT(oStart == oStart->starter(oEnd));
389 SkOpSegment* segment = start->segment(); 389 SkOpSegment* segment = start->segment();
390 SkOpSegment* oSegment = oStart->segment(); 390 SkOpSegment* oSegment = oStart->segment();
391 bool operandSwap = segment->operand() != oSegment->operand(); 391 bool operandSwap = segment->operand() != oSegment->operand();
392 if (flipped) { 392 if (flipped) {
393 if (oEnd->deleted()) {
394 continue;
395 }
393 do { 396 do {
394 SkOpSpanBase* oNext = oStart->next(); 397 SkOpSpanBase* oNext = oStart->next();
395 if (oNext == oEnd) { 398 if (oNext == oEnd) {
396 break; 399 break;
397 } 400 }
398 oStart = oNext->upCast(); 401 oStart = oNext->upCast();
399 } while (true); 402 } while (true);
400 } 403 }
401 do { 404 do {
402 int windValue = start->windValue(); 405 int windValue = start->windValue();
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f T)); 676 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f T));
674 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f T)); 677 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f T));
675 return *overS < *overE; 678 return *overS < *overE;
676 } 679 }
677 680
678 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S kOpPtT* testS, 681 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S kOpPtT* testS,
679 const SkOpPtT* testE) const { 682 const SkOpPtT* testE) const {
680 return testS->segment()->testForCoincidence(testS, testE, testS->span(), 683 return testS->segment()->testForCoincidence(testS, testE, testS->span(),
681 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME: replace with tuned 684 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME: replace with tuned
682 } 685 }
OLDNEW
« no previous file with comments | « no previous file | tests/PathOpsBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698