| 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 SkASSERT(ptsInCommon); | 505 SkASSERT(ptsInCommon); |
| 506 return 2; | 506 return 2; |
| 507 } | 507 } |
| 508 bool linear; | 508 bool linear; |
| 509 if (fPart.hullIntersects(opp->fPart, &linear)) { | 509 if (fPart.hullIntersects(opp->fPart, &linear)) { |
| 510 if (!linear) { // check set true if linear | 510 if (!linear) { // check set true if linear |
| 511 return 1; | 511 return 1; |
| 512 } | 512 } |
| 513 fIsLinear = true; | 513 fIsLinear = true; |
| 514 fIsLine = fPart.controlsInside(); | 514 fIsLine = fPart.controlsInside(); |
| 515 return ptsInCommon ? 2 : -1; | 515 return ptsInCommon ? 1 : -1; |
| 516 } else { // hull is not linear; check set true if intersected at the end po
ints | 516 } else { // hull is not linear; check set true if intersected at the end po
ints |
| 517 return ((int) ptsInCommon) << 1; // 0 or 2 | 517 return ((int) ptsInCommon) << 1; // 0 or 2 |
| 518 } | 518 } |
| 519 return 0; | 519 return 0; |
| 520 } | 520 } |
| 521 | 521 |
| 522 // OPTIMIZE ? If at_most_end_pts_in_common detects that one quad is near linear, | 522 // OPTIMIZE ? If at_most_end_pts_in_common detects that one quad is near linear, |
| 523 // use line intersection to guess a better split than 0.5 | 523 // use line intersection to guess a better split than 0.5 |
| 524 // OPTIMIZE Once at_most_end_pts_in_common detects linear, mark span so all futu
re splits are linear | 524 // OPTIMIZE Once at_most_end_pts_in_common detects linear, mark span so all futu
re splits are linear |
| 525 template<typename TCurve, typename OppCurve> | 525 template<typename TCurve, typename OppCurve> |
| (...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2238 --last; | 2238 --last; |
| 2239 } else { | 2239 } else { |
| 2240 intersections->setCoincident(index++); | 2240 intersections->setCoincident(index++); |
| 2241 } | 2241 } |
| 2242 intersections->setCoincident(index); | 2242 intersections->setCoincident(index); |
| 2243 } | 2243 } |
| 2244 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); | 2244 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); |
| 2245 } | 2245 } |
| 2246 | 2246 |
| 2247 #endif | 2247 #endif |
| OLD | NEW |