| Index: src/pathops/SkOpContour.cpp
|
| ===================================================================
|
| --- src/pathops/SkOpContour.cpp (revision 9040)
|
| +++ src/pathops/SkOpContour.cpp (working copy)
|
| @@ -64,38 +64,36 @@
|
| #endif
|
| double startT = coincidence.fTs[0][0];
|
| double endT = coincidence.fTs[0][1];
|
| - bool cancelers;
|
| - if ((cancelers = startT > endT)) {
|
| + bool startSwapped, oStartSwapped, cancelers;
|
| + if ((cancelers = startSwapped = startT > endT)) {
|
| SkTSwap(startT, endT);
|
| - SkTSwap(coincidence.fPts[0], coincidence.fPts[1]);
|
| }
|
| SkASSERT(!approximately_negative(endT - startT));
|
| double oStartT = coincidence.fTs[1][0];
|
| double oEndT = coincidence.fTs[1][1];
|
| - if (oStartT > oEndT) {
|
| - SkTSwap<double>(oStartT, oEndT);
|
| + if ((oStartSwapped = oStartT > oEndT)) {
|
| + SkTSwap(oStartT, oEndT);
|
| cancelers ^= true;
|
| }
|
| SkASSERT(!approximately_negative(oEndT - oStartT));
|
| - bool opp = fOperand ^ otherContour->fOperand;
|
| - if (cancelers && !opp) {
|
| + if (cancelers) {
|
| // make sure startT and endT have t entries
|
| if (startT > 0 || oEndT < 1
|
| || thisOne.isMissing(startT) || other.isMissing(oEndT)) {
|
| - thisOne.addTPair(startT, &other, oEndT, true, coincidence.fPts[0]);
|
| + thisOne.addTPair(startT, &other, oEndT, true, coincidence.fPts[startSwapped]);
|
| }
|
| if (oStartT > 0 || endT < 1
|
| || thisOne.isMissing(endT) || other.isMissing(oStartT)) {
|
| - other.addTPair(oStartT, &thisOne, endT, true, coincidence.fPts[1]);
|
| + other.addTPair(oStartT, &thisOne, endT, true, coincidence.fPts[oStartSwapped]);
|
| }
|
| } else {
|
| if (startT > 0 || oStartT > 0
|
| || thisOne.isMissing(startT) || other.isMissing(oStartT)) {
|
| - thisOne.addTPair(startT, &other, oStartT, true, coincidence.fPts[0]);
|
| + thisOne.addTPair(startT, &other, oStartT, true, coincidence.fPts[startSwapped]);
|
| }
|
| if (endT < 1 || oEndT < 1
|
| || thisOne.isMissing(endT) || other.isMissing(oEndT)) {
|
| - other.addTPair(oEndT, &thisOne, endT, true, coincidence.fPts[1]);
|
| + other.addTPair(oEndT, &thisOne, endT, true, coincidence.fPts[!oStartSwapped]);
|
| }
|
| }
|
| #if DEBUG_CONCIDENT
|
| @@ -135,8 +133,7 @@
|
| cancelers ^= true;
|
| }
|
| SkASSERT(!approximately_negative(oEndT - oStartT));
|
| - bool opp = fOperand ^ otherContour->fOperand;
|
| - if (cancelers && !opp) {
|
| + if (cancelers) {
|
| // make sure startT and endT have t entries
|
| if (!thisOne.done() && !other.done()) {
|
| thisOne.addTCancel(startT, endT, &other, oStartT, oEndT);
|
|
|