OLD | NEW |
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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 if (oeExisting && (oeExisting == os || oeExisting->contains(osExisting ? osE
xisting : os))) { | 687 if (oeExisting && (oeExisting == os || oeExisting->contains(osExisting ? osE
xisting : os))) { |
688 return false; | 688 return false; |
689 } | 689 } |
690 // extra line in debug code | 690 // extra line in debug code |
691 this->debugValidate(); | 691 this->debugValidate(); |
692 if (!cs || !os) { | 692 if (!cs || !os) { |
693 SkOpPtT* csWritable = cs ? const_cast<SkOpPtT*>(cs) | 693 SkOpPtT* csWritable = cs ? const_cast<SkOpPtT*>(cs) |
694 : coinSeg->addT(coinTs, SkOpSegment::kNoAliasMatch, nullptr); | 694 : coinSeg->addT(coinTs, SkOpSegment::kNoAliasMatch, nullptr); |
695 SkOpPtT* osWritable = os ? const_cast<SkOpPtT*>(os) | 695 SkOpPtT* osWritable = os ? const_cast<SkOpPtT*>(os) |
696 : oppSeg->addT(oppTs, SkOpSegment::kNoAliasMatch, nullptr); | 696 : oppSeg->addT(oppTs, SkOpSegment::kNoAliasMatch, nullptr); |
697 if (!osWritable) { | 697 if (!csWritable || !osWritable) { |
698 return false; | 698 return false; |
699 } | 699 } |
700 csWritable->span()->addOppAndMerge(osWritable->span()); | 700 csWritable->span()->addOppAndMerge(osWritable->span()); |
701 cs = csWritable; | 701 cs = csWritable; |
702 os = osWritable; | 702 os = osWritable; |
703 if ((ce && ce->deleted()) || (oe && oe->deleted())) { | 703 if ((ce && ce->deleted()) || (oe && oe->deleted())) { |
704 return false; | 704 return false; |
705 } | 705 } |
706 } | 706 } |
707 if (!ce || !oe) { | 707 if (!ce || !oe) { |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 this->release(fHead, coin); | 1472 this->release(fHead, coin); |
1473 } | 1473 } |
1474 } while ((coin = coin->next())); | 1474 } while ((coin = coin->next())); |
1475 } | 1475 } |
1476 | 1476 |
1477 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, | 1477 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, |
1478 const SkOpPtT* testE) const { | 1478 const SkOpPtT* testE) const { |
1479 return testS->segment()->testForCoincidence(testS, testE, testS->span(), | 1479 return testS->segment()->testForCoincidence(testS, testE, testS->span(), |
1480 testE->span(), outer->coinPtTStart()->segment()); | 1480 testE->span(), outer->coinPtTStart()->segment()); |
1481 } | 1481 } |
OLD | NEW |