| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 double t = i[0][index]; | 327 double t = i[0][index]; |
| 328 if (!between(0, t, 1)) { | 328 if (!between(0, t, 1)) { |
| 329 continue; | 329 continue; |
| 330 } | 330 } |
| 331 SkDPoint oppPt = i.pt(index); | 331 SkDPoint oppPt = i.pt(index); |
| 332 if (!oppPt.approximatelyEqual(pt)) { | 332 if (!oppPt.approximatelyEqual(pt)) { |
| 333 continue; | 333 continue; |
| 334 } | 334 } |
| 335 SkOpSegment* writableSeg = const_cast<SkOpSegment*>(testSeg); | 335 SkOpSegment* writableSeg = const_cast<SkOpSegment*>(testSeg); |
| 336 SkOpPtT* oppStart = writableSeg->addT(t); | 336 SkOpPtT* oppStart = writableSeg->addT(t); |
| 337 if (oppStart == testPtT) { |
| 338 continue; |
| 339 } |
| 337 SkOpSpan* writableBase = const_cast<SkOpSpan*>(base); | 340 SkOpSpan* writableBase = const_cast<SkOpSpan*>(base); |
| 338 oppStart->span()->addOpp(writableBase); | 341 oppStart->span()->addOpp(writableBase); |
| 339 if (oppStart->deleted()) { | 342 if (oppStart->deleted()) { |
| 340 continue; | 343 continue; |
| 341 } | 344 } |
| 342 SkOpSegment* coinSeg = base->segment(); | 345 SkOpSegment* coinSeg = base->segment(); |
| 343 SkOpSegment* oppSeg = oppStart->segment(); | 346 SkOpSegment* oppSeg = oppStart->segment(); |
| 344 double coinTs, coinTe, oppTs, oppTe; | 347 double coinTs, coinTe, oppTs, oppTe; |
| 345 if (Ordered(coinSeg, oppSeg)) { | 348 if (Ordered(coinSeg, oppSeg)) { |
| 346 coinTs = base->t(); | 349 coinTs = base->t(); |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 this->release(fHead, coin); | 1606 this->release(fHead, coin); |
| 1604 } | 1607 } |
| 1605 } while ((coin = coin->next())); | 1608 } while ((coin = coin->next())); |
| 1606 } | 1609 } |
| 1607 | 1610 |
| 1608 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, | 1611 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, |
| 1609 const SkOpPtT* testE) const { | 1612 const SkOpPtT* testE) const { |
| 1610 return testS->segment()->testForCoincidence(testS, testE, testS->span(), | 1613 return testS->segment()->testForCoincidence(testS, testE, testS->span(), |
| 1611 testE->span(), outer->coinPtTStart()->segment()); | 1614 testE->span(), outer->coinPtTStart()->segment()); |
| 1612 } | 1615 } |
| OLD | NEW |