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 #ifndef SkOpSpan_DEFINED | 7 #ifndef SkOpSpan_DEFINED |
8 #define SkOpSpan_DEFINED | 8 #define SkOpSpan_DEFINED |
9 | 9 |
10 #include "SkPathOpsDebug.h" | 10 #include "SkPathOpsDebug.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 void unaligned() { | 362 void unaligned() { |
363 fAligned = false; | 363 fAligned = false; |
364 } | 364 } |
365 | 365 |
366 SkOpSpan* upCast() { | 366 SkOpSpan* upCast() { |
367 SkASSERT(!final()); | 367 SkASSERT(!final()); |
368 return (SkOpSpan*) this; | 368 return (SkOpSpan*) this; |
369 } | 369 } |
370 | 370 |
371 const SkOpSpan* upCast() const { | 371 const SkOpSpan* upCast() const { |
372 SkASSERT(!final()); | 372 SkOPASSERT(!final()); |
373 return (const SkOpSpan*) this; | 373 return (const SkOpSpan*) this; |
374 } | 374 } |
375 | 375 |
376 SkOpSpan* upCastable() { | 376 SkOpSpan* upCastable() { |
377 return final() ? nullptr : upCast(); | 377 return final() ? nullptr : upCast(); |
378 } | 378 } |
379 | 379 |
380 const SkOpSpan* upCastable() const { | 380 const SkOpSpan* upCastable() const { |
381 return final() ? nullptr : upCast(); | 381 return final() ? nullptr : upCast(); |
382 } | 382 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 SkASSERT(!final()); | 513 SkASSERT(!final()); |
514 fToAngle = angle; | 514 fToAngle = angle; |
515 } | 515 } |
516 | 516 |
517 void setWindSum(int windSum); | 517 void setWindSum(int windSum); |
518 | 518 |
519 void setWindValue(int windValue) { | 519 void setWindValue(int windValue) { |
520 SkASSERT(!final()); | 520 SkASSERT(!final()); |
521 SkASSERT(windValue >= 0); | 521 SkASSERT(windValue >= 0); |
522 SkASSERT(fWindSum == SK_MinS32); | 522 SkASSERT(fWindSum == SK_MinS32); |
523 SkASSERT(!windValue || !fDone); | 523 SkOPASSERT(!windValue || !fDone); |
524 fWindValue = windValue; | 524 fWindValue = windValue; |
525 } | 525 } |
526 | 526 |
527 bool sortableTop(SkOpContour* ); | 527 bool sortableTop(SkOpContour* ); |
528 | 528 |
529 SkOpAngle* toAngle() const { | 529 SkOpAngle* toAngle() const { |
530 SkASSERT(!final()); | 530 SkASSERT(!final()); |
531 return fToAngle; | 531 return fToAngle; |
532 } | 532 } |
533 | 533 |
534 int windSum() const { | 534 int windSum() const { |
535 SkASSERT(!final()); | 535 SkASSERT(!final()); |
536 return fWindSum; | 536 return fWindSum; |
537 } | 537 } |
538 | 538 |
539 int windValue() const { | 539 int windValue() const { |
540 SkASSERT(!final()); | 540 SkOPASSERT(!final()); |
541 return fWindValue; | 541 return fWindValue; |
542 } | 542 } |
543 | 543 |
544 private: // no direct access to internals to avoid treating a span base as a sp
an | 544 private: // no direct access to internals to avoid treating a span base as a sp
an |
545 SkOpSpan* fCoincident; // linked list of spans coincident with this one (ma
y point to itself) | 545 SkOpSpan* fCoincident; // linked list of spans coincident with this one (ma
y point to itself) |
546 SkOpAngle* fToAngle; // points to next angle from span start to end | 546 SkOpAngle* fToAngle; // points to next angle from span start to end |
547 SkOpSpanBase* fNext; // next intersection point | 547 SkOpSpanBase* fNext; // next intersection point |
548 int fWindSum; // accumulated from contours surrounding this one. | 548 int fWindSum; // accumulated from contours surrounding this one. |
549 int fOppSum; // for binary operators: the opposite winding sum | 549 int fOppSum; // for binary operators: the opposite winding sum |
550 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident | 550 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
551 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here | 551 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here |
552 int fTopTTry; // specifies direction and t value to try next | 552 int fTopTTry; // specifies direction and t value to try next |
553 bool fDone; // if set, this span to next higher T has been processed | 553 bool fDone; // if set, this span to next higher T has been processed |
554 mutable bool fAlreadyAdded; | 554 mutable bool fAlreadyAdded; |
555 }; | 555 }; |
556 | 556 |
557 #endif | 557 #endif |
OLD | NEW |