OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkAddIntersections.h" | 7 #include "SkAddIntersections.h" |
8 #include "SkOpCoincidence.h" | 8 #include "SkOpCoincidence.h" |
9 #include "SkPathOpsBounds.h" | 9 #include "SkPathOpsBounds.h" |
10 | 10 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 498 } |
499 #if DEBUG_T_SECT_LOOP_COUNT | 499 #if DEBUG_T_SECT_LOOP_COUNT |
500 test->globalState()->debugAddLoopCount(&ts, wt, wn); | 500 test->globalState()->debugAddLoopCount(&ts, wt, wn); |
501 #endif | 501 #endif |
502 int coinIndex = -1; | 502 int coinIndex = -1; |
503 SkOpPtT* coinPtT[2]; | 503 SkOpPtT* coinPtT[2]; |
504 for (int pt = 0; pt < pts; ++pt) { | 504 for (int pt = 0; pt < pts; ++pt) { |
505 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); | 505 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); |
506 SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1); | 506 SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1); |
507 wt.segment()->debugValidate(); | 507 wt.segment()->debugValidate(); |
508 SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt], nullptr); | 508 SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt]); |
509 wn.segment()->debugValidate(); | 509 wn.segment()->debugValidate(); |
510 SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt], nullptr); | 510 SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt]); |
511 if (testTAt->addOpp(nextTAt)) { | 511 SkOpPtT* oppPrev = testTAt->oppPrev(nextTAt); |
512 testTAt->span()->checkForCollapsedCoincidence(); | 512 if (oppPrev) { |
| 513 testTAt->addOpp(nextTAt, oppPrev); |
513 } | 514 } |
514 if (testTAt->fPt != nextTAt->fPt) { | 515 if (testTAt->fPt != nextTAt->fPt) { |
515 testTAt->span()->unaligned(); | 516 testTAt->span()->unaligned(); |
516 nextTAt->span()->unaligned(); | 517 nextTAt->span()->unaligned(); |
517 } | 518 } |
518 wt.segment()->debugValidate(); | 519 wt.segment()->debugValidate(); |
519 wn.segment()->debugValidate(); | 520 wn.segment()->debugValidate(); |
520 if (!ts.isCoincident(pt)) { | 521 if (!ts.isCoincident(pt)) { |
521 continue; | 522 continue; |
522 } | 523 } |
(...skipping 19 matching lines...) Expand all Loading... |
542 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt); | 543 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt); |
543 wt.segment()->debugValidate(); | 544 wt.segment()->debugValidate(); |
544 wn.segment()->debugValidate(); | 545 wn.segment()->debugValidate(); |
545 coinIndex = -1; | 546 coinIndex = -1; |
546 } | 547 } |
547 SkASSERT(coinIndex < 0); // expect coincidence to be paired | 548 SkASSERT(coinIndex < 0); // expect coincidence to be paired |
548 } while (wn.advance()); | 549 } while (wn.advance()); |
549 } while (wt.advance()); | 550 } while (wt.advance()); |
550 return true; | 551 return true; |
551 } | 552 } |
OLD | NEW |