| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef SkPathOpsTSect_DEFINED | 7 #ifndef SkPathOpsTSect_DEFINED |
| 8 #define SkPathOpsTSect_DEFINED | 8 #define SkPathOpsTSect_DEFINED |
| 9 | 9 |
| 10 #include "SkChunkAlloc.h" | 10 #include "SkChunkAlloc.h" |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 double tStep = tEnd - tStart; | 1524 double tStep = tEnd - tStart; |
| 1525 SkDPoint workPt; | 1525 SkDPoint workPt; |
| 1526 do { | 1526 do { |
| 1527 tStep *= 0.5; | 1527 tStep *= 0.5; |
| 1528 if (precisely_zero(tStep)) { | 1528 if (precisely_zero(tStep)) { |
| 1529 return 0; | 1529 return 0; |
| 1530 } | 1530 } |
| 1531 workT += tStep; | 1531 workT += tStep; |
| 1532 workPt = fCurve.ptAtT(workT); | 1532 workPt = fCurve.ptAtT(workT); |
| 1533 coinW.setPerp(fCurve, workT, workPt, opp->fCurve); | 1533 coinW.setPerp(fCurve, workT, workPt, opp->fCurve); |
| 1534 if (coinW.perpT() < 0) { | 1534 double perpT = coinW.perpT(); |
| 1535 if (coinW.isCoincident() ? !between(oppSpan->fStartT, perpT, oppSpan->fE
ndT) : perpT < 0) { |
| 1535 continue; | 1536 continue; |
| 1536 } | 1537 } |
| 1537 SkDVector perpW = workPt - coinW.perpPt(); | 1538 SkDVector perpW = workPt - coinW.perpPt(); |
| 1538 if ((perpS.dot(perpW) >= 0) == (tStep < 0)) { | 1539 if ((perpS.dot(perpW) >= 0) == (tStep < 0)) { |
| 1539 tStep = -tStep; | 1540 tStep = -tStep; |
| 1540 } | 1541 } |
| 1541 if (workPt.approximatelyEqual(coinW.perpPt())) { | 1542 if (workPt.approximatelyEqual(coinW.perpPt())) { |
| 1542 break; | 1543 break; |
| 1543 } | 1544 } |
| 1544 } while (true); | 1545 } while (true); |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 --last; | 2317 --last; |
| 2317 } else { | 2318 } else { |
| 2318 intersections->setCoincident(index++); | 2319 intersections->setCoincident(index++); |
| 2319 } | 2320 } |
| 2320 intersections->setCoincident(index); | 2321 intersections->setCoincident(index); |
| 2321 } | 2322 } |
| 2322 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); | 2323 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); |
| 2323 } | 2324 } |
| 2324 | 2325 |
| 2325 #endif | 2326 #endif |
| OLD | NEW |