275 {
278 return false;
279 }
280
282 return true;
283 }
284 }
287 do {
290 test->debugValidate();
291 next->debugValidate();
293 continue;
294 }
295 do {
297 continue;
298 }
299 int pts = 0;
312 pts = ts.lineHorizontal(wn.
pts(), wt.
left(),
315 break;
317 pts = ts.quadHorizontal(wn.
pts(), wt.
left(),
320 break;
325 break;
327 pts = ts.cubicHorizontal(wn.
pts(), wt.
left(),
330 break;
331 default:
333 }
334 break;
341 pts = ts.lineVertical(wn.
pts(), wt.
top(),
344 break;
345 }
347 pts = ts.quadVertical(wn.
pts(), wt.
top(),
350 break;
351 }
356 break;
357 }
359 pts = ts.cubicVertical(wn.
pts(), wt.
top(),
362 break;
363 }
364 default:
366 }
367 break;
371 pts = ts.lineHorizontal(wt.
pts(), wn.
left(),
374 break;
376 pts = ts.lineVertical(wt.
pts(), wn.
top(),
379 break;
381 pts = ts.lineLine(wt.
pts(), wn.
pts());
383 break;
386 pts = ts.quadLine(wn.
pts(), wt.
pts());
388 break;
393 break;
396 pts = ts.cubicLine(wn.
pts(), wt.
pts());
398 break;
399 default:
401 }
402 break;
406 pts = ts.quadHorizontal(wt.
pts(), wn.
left(),
409 break;
411 pts = ts.quadVertical(wt.
pts(), wn.
top(),
414 break;
416 pts = ts.quadLine(wt.
pts(), wn.
pts());
418 break;
420 pts = ts.intersect(quad1.
set(wt.
pts()), quad2.
set(wn.
pts()));
422 break;
423 }
429 break;
430 }
433 pts = ts.intersect(cubic2.
set(wn.
pts()), quad1.
set(wt.
pts()));
435 break;
436 }
437 default:
439 }
440 break;
447 break;
452 break;
456 break;
461 break;
462 }
467 break;
468 }
471 pts = ts.intersect(cubic2.
set(wn.
pts()
476 break;
477 }
478 }
479 break;
483 pts = ts.cubicHorizontal(wt.
pts(), wn.
left(),
486 break;
488 pts = ts.cubicVertical(wt.
pts(), wn.
top(),
491 break;
493 pts = ts.cubicLine(wt.
pts(), wn.
pts());
495 break;
497 pts = ts.intersect(cubic1.
set(wt.
pts()), quad2.
set(wn.
pts()));
499 break;
500 }
502 pts = ts.intersect(cubic1.
set(wt.
pts()
507 break;
508 }
510 pts = ts.intersect(cubic1.
set(wt.
pts()), cubic2.
set(wn.
pts()));
512 break;
513 }
514 default:
516 }
517 break;
518 default:
520 }
521#if DEBUG_T_SECT_LOOP_COUNT
522 test->globalState()->debugAddLoopCount(&ts, wt, wn);
523#endif
524 int coinIndex = -1;
526 for (int pt = 0; pt < pts; ++pt) {
527 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1);
528 SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1);
530
531
532
533
534 SkPoint iPt = ts.pt(pt).asSkPoint();
543 if (oppPrev) {
545 testTAt->
addOpp(nextTAt, oppPrev);
546 }
547 if (testTAt->
fPt != nextTAt->
fPt) {
550 }
553 }
554 if (!ts.isCoincident(pt)) {
555 continue;
556 }
557 if (coinIndex < 0) {
558 coinPtT[0] = testTAt;
559 coinPtT[1] = nextTAt;
560 coinIndex = pt;
561 continue;
562 }
563 if (coinPtT[0]->span() == testTAt->
span()) {
564 coinIndex = -1;
565 continue;
566 }
567 if (coinPtT[1]->span() == nextTAt->
span()) {
568 coinIndex = -1;
569 continue;
570 }
573 swap(coinPtT[0], coinPtT[1]);
574 swap(testTAt, nextTAt);
575 }
577 || coinPtT[0]->span()->t() < testTAt->
span()->
t());
578 if (coinPtT[0]->span()->deleted()) {
579 coinIndex = -1;
580 continue;
581 }
583 coinIndex = -1;
584 continue;
585 }
586 coincidence->
add(coinPtT[0], testTAt, coinPtT[1], nextTAt);
589 coinIndex = -1;
590 }
594 return true;
595}
static float next(float f)
static void debugShowConicQuadIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowQuadIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowQuadLineIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowCubicIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowCubicConicIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowLineIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowConicLineIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowConicIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowCubicLineIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
static void debugShowCubicQuadIntersection(int, const SkIntersectionHelper &, const SkIntersectionHelper &, const SkIntersections &)
#define SkDEBUGPARAMS(...)
bool AlmostLessUlps(float a, float b)
#define SkOPOBJASSERT(obj, cond)
void swap(sk_sp< T > &a, sk_sp< T > &b)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
const SkPathOpsBounds & bounds() const
bool startAfter(const SkIntersectionHelper &after)
SkOpSegment * segment() const
void init(SkOpContour *contour)
@ kHorizontalLine_Segment
SegmentType segmentType() const
const SkPoint * pts() const
void add(SkOpPtT *coinPtTStart, SkOpPtT *coinPtTEnd, SkOpPtT *oppPtTStart, SkOpPtT *oppPtTEnd)
SkOpGlobalState * globalState()
const SkOpSpanBase * span() const
SkOpPtT * oppPrev(const SkOpPtT *opp) const
void addOpp(SkOpPtT *opp, SkOpPtT *oppPrev)
bool contains(const SkOpPtT *) const
void debugValidate() const
bool mergeMatches(SkOpSpanBase *opp)
SIN Vec< N, float > floor(const Vec< N, float > &x)
const SkDConic & set(const SkPoint pts[kPointCount], SkScalar weight SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))
const SkDCubic & set(const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))
const SkDQuad & set(const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))
static bool Intersects(const SkPathOpsBounds &a, const SkPathOpsBounds &b)