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 "SkIntersections.h" | 7 #include "SkIntersections.h" |
8 #include "SkOpContour.h" | 8 #include "SkOpContour.h" |
9 #include "SkOpSegment.h" | 9 #include "SkOpSegment.h" |
10 #include "SkPathWriter.h" | 10 #include "SkPathWriter.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 582 } |
583 } | 583 } |
584 SkOpSpan* span; | 584 SkOpSpan* span; |
585 if (insertedAt >= 0) { | 585 if (insertedAt >= 0) { |
586 span = fTs.insert(insertedAt); | 586 span = fTs.insert(insertedAt); |
587 } else { | 587 } else { |
588 insertedAt = tCount; | 588 insertedAt = tCount; |
589 span = fTs.append(); | 589 span = fTs.append(); |
590 } | 590 } |
591 span->fT = newT; | 591 span->fT = newT; |
592 #if SK_DEBUG | |
593 span->fOtherT = -1; | 592 span->fOtherT = -1; |
594 #endif | |
595 span->fOther = other; | 593 span->fOther = other; |
596 span->fPt = pt; | 594 span->fPt = pt; |
597 #if 0 | 595 #if 0 |
598 // cubics, for instance, may not be exact enough to satisfy this check (e.g.
, cubicOp69d) | 596 // cubics, for instance, may not be exact enough to satisfy this check (e.g.
, cubicOp69d) |
599 SkASSERT(approximately_equal(xyAtT(newT).fX, pt.fX) | 597 SkASSERT(approximately_equal(xyAtT(newT).fX, pt.fX) |
600 && approximately_equal(xyAtT(newT).fY, pt.fY)); | 598 && approximately_equal(xyAtT(newT).fY, pt.fY)); |
601 #endif | 599 #endif |
602 span->fFromAngle = NULL; | 600 span->fFromAngle = NULL; |
603 span->fToAngle = NULL; | 601 span->fToAngle = NULL; |
604 span->fWindSum = SK_MinS32; | 602 span->fWindSum = SK_MinS32; |
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3431 } | 3429 } |
3432 | 3430 |
3433 SkOpSpan* SkOpSegment::markAndChaseWinding(int index, int endIndex, int winding,
int oppWinding) { | 3431 SkOpSpan* SkOpSegment::markAndChaseWinding(int index, int endIndex, int winding,
int oppWinding) { |
3434 int min = SkMin32(index, endIndex); | 3432 int min = SkMin32(index, endIndex); |
3435 int step = SkSign32(endIndex - index); | 3433 int step = SkSign32(endIndex - index); |
3436 markWinding(min, winding, oppWinding); | 3434 markWinding(min, winding, oppWinding); |
3437 SkOpSpan* last = NULL; | 3435 SkOpSpan* last = NULL; |
3438 SkOpSegment* other = this; | 3436 SkOpSegment* other = this; |
3439 while ((other = other->nextChase(&index, &step, &min, &last))) { | 3437 while ((other = other->nextChase(&index, &step, &min, &last))) { |
3440 if (other->fTs[min].fWindSum != SK_MinS32) { | 3438 if (other->fTs[min].fWindSum != SK_MinS32) { |
3441 #if SK_DEBUG | 3439 #ifdef SK_DEBUG |
3442 if (!other->fTs[min].fLoop) { | 3440 if (!other->fTs[min].fLoop) { |
3443 if (fOperand == other->fOperand) { | 3441 if (fOperand == other->fOperand) { |
3444 // FIXME: this is probably a bug -- rects4 asserts here | 3442 // FIXME: this is probably a bug -- rects4 asserts here |
3445 // SkASSERT(other->fTs[min].fWindSum == winding); | 3443 // SkASSERT(other->fTs[min].fWindSum == winding); |
3446 // FIXME: this is probably a bug -- rects3 asserts here | 3444 // FIXME: this is probably a bug -- rects3 asserts here |
3447 // SkASSERT(other->fTs[min].fOppSum == oppWinding); | 3445 // SkASSERT(other->fTs[min].fOppSum == oppWinding); |
3448 } else { | 3446 } else { |
3449 SkASSERT(other->fTs[min].fWindSum == oppWinding); | 3447 SkASSERT(other->fTs[min].fWindSum == oppWinding); |
3450 // FIXME: this is probably a bug -- skpwww_joomla_org_23 asserts here | 3448 // FIXME: this is probably a bug -- skpwww_joomla_org_23 asserts here |
3451 // SkASSERT(other->fTs[min].fOppSum == winding); | 3449 // SkASSERT(other->fTs[min].fOppSum == winding); |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4295 SkASSERT(span->fWindValue > 0 || span->fOppValue != 0); | 4293 SkASSERT(span->fWindValue > 0 || span->fOppValue != 0); |
4296 span->fWindValue = 0; | 4294 span->fWindValue = 0; |
4297 span->fOppValue = 0; | 4295 span->fOppValue = 0; |
4298 if (span->fTiny || span->fSmall) { | 4296 if (span->fTiny || span->fSmall) { |
4299 return; | 4297 return; |
4300 } | 4298 } |
4301 SkASSERT(!span->fDone); | 4299 SkASSERT(!span->fDone); |
4302 span->fDone = true; | 4300 span->fDone = true; |
4303 ++fDoneSpans; | 4301 ++fDoneSpans; |
4304 } | 4302 } |
OLD | NEW |