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 "SkPathOpsBounds.h" | 8 #include "SkPathOpsBounds.h" |
9 | 9 |
10 #if DEBUG_ADD_INTERSECTING_TS | 10 #if DEBUG_ADD_INTERSECTING_TS |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 continue; | 376 continue; |
377 } | 377 } |
378 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1) | 378 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1) |
379 pts = 1; | 379 pts = 1; |
380 } | 380 } |
381 } | 381 } |
382 if (pts >= 2) { | 382 if (pts >= 2) { |
383 for (int pt = 0; pt < pts - 1; ++pt) { | 383 for (int pt = 0; pt < pts - 1; ++pt) { |
384 const SkDPoint& point = ts.pt(pt); | 384 const SkDPoint& point = ts.pt(pt); |
385 const SkDPoint& next = ts.pt(pt + 1); | 385 const SkDPoint& next = ts.pt(pt + 1); |
386 if (wt.isNear(ts[swap][pt], ts[swap][pt + 1], point, next) | 386 if (wt.isPartial(ts[swap][pt], ts[swap][pt + 1], point, next
) |
387 && wn.isNear(ts[!swap][pt], ts[!swap][pt + 1], point
, next)) { | 387 && wn.isPartial(ts[!swap][pt], ts[!swap][pt + 1], po
int, next)) { |
388 if (!wt.addPartialCoincident(wn, ts, pt, swap)) { | 388 if (!wt.addPartialCoincident(wn, ts, pt, swap)) { |
389 // remove extra point if two map to same float value
s | 389 // remove extra point if two map to same float value
s |
390 ts.cleanUpCoincidence(); // prefer (t == 0 or t ==
1) | 390 ts.cleanUpCoincidence(); // prefer (t == 0 or t ==
1) |
391 pts = 1; | 391 pts = 1; |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
395 } | 395 } |
396 for (int pt = 0; pt < pts; ++pt) { | 396 for (int pt = 0; pt < pts; ++pt) { |
397 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); | 397 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { | 442 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { |
443 SkOpContour* contour = (*contourList)[cIndex]; | 443 SkOpContour* contour = (*contourList)[cIndex]; |
444 contour->calcCoincidentWinding(); | 444 contour->calcCoincidentWinding(); |
445 } | 445 } |
446 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { | 446 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { |
447 SkOpContour* contour = (*contourList)[cIndex]; | 447 SkOpContour* contour = (*contourList)[cIndex]; |
448 contour->calcPartialCoincidentWinding(); | 448 contour->calcPartialCoincidentWinding(); |
449 } | 449 } |
450 } | 450 } |
OLD | NEW |