Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
spanRec Struct Reference

Public Member Functions

void init (const SkRegionPriv::RunType a_runs[], const SkRegionPriv::RunType b_runs[])
 
bool done () const
 
void next ()
 

Public Attributes

const SkRegionPriv::RunTypefA_runs
 
const SkRegionPriv::RunTypefB_runs
 
int fA_left
 
int fA_rite
 
int fB_left
 
int fB_rite
 
int fLeft
 
int fRite
 
int fInside
 

Detailed Description

Definition at line 685 of file SkRegion.cpp.

Member Function Documentation

◆ done()

bool spanRec::done ( ) const
inline

Definition at line 702 of file SkRegion.cpp.

702 {
707 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr int SkRegion_kRunTypeSentinel
Definition: SkRegionPriv.h:35
int fB_left
Definition: SkRegion.cpp:688
int fA_left
Definition: SkRegion.cpp:688

◆ init()

void spanRec::init ( const SkRegionPriv::RunType  a_runs[],
const SkRegionPriv::RunType  b_runs[] 
)
inline

Definition at line 691 of file SkRegion.cpp.

692 {
693 fA_left = *a_runs++;
694 fA_rite = *a_runs++;
695 fB_left = *b_runs++;
696 fB_rite = *b_runs++;
697
698 fA_runs = a_runs;
699 fB_runs = b_runs;
700 }
const SkRegionPriv::RunType * fB_runs
Definition: SkRegion.cpp:687
int fA_rite
Definition: SkRegion.cpp:688
const SkRegionPriv::RunType * fA_runs
Definition: SkRegion.cpp:686
int fB_rite
Definition: SkRegion.cpp:688

◆ next()

void spanRec::next ( )
inline

Definition at line 709 of file SkRegion.cpp.

709 {
712
713 int inside, left, rite SK_INIT_TO_AVOID_WARNING;
714 bool a_flush = false;
715 bool b_flush = false;
716
717 int a_left = fA_left;
718 int a_rite = fA_rite;
719 int b_left = fB_left;
720 int b_rite = fB_rite;
721
722 if (a_left < b_left) {
723 inside = 1;
724 left = a_left;
725 if (a_rite <= b_left) { // [...] <...>
726 rite = a_rite;
727 a_flush = true;
728 } else { // [...<..]...> or [...<...>...]
729 rite = a_left = b_left;
730 }
731 } else if (b_left < a_left) {
732 inside = 2;
733 left = b_left;
734 if (b_rite <= a_left) { // [...] <...>
735 rite = b_rite;
736 b_flush = true;
737 } else { // [...<..]...> or [...<...>...]
738 rite = b_left = a_left;
739 }
740 } else { // a_left == b_left
741 inside = 3;
742 left = a_left; // or b_left
743 if (a_rite <= b_rite) {
744 rite = b_left = a_rite;
745 a_flush = true;
746 }
747 if (b_rite <= a_rite) {
748 rite = a_left = b_rite;
749 b_flush = true;
750 }
751 }
752
753 if (a_flush) {
754 a_left = *fA_runs++;
755 a_rite = *fA_runs++;
756 }
757 if (b_flush) {
758 b_left = *fB_runs++;
759 b_rite = *fB_runs++;
760 }
761
762 SkASSERT(left <= rite);
763
764 // now update our state
765 fA_left = a_left;
766 fA_rite = a_rite;
767 fB_left = b_left;
768 fB_rite = b_rite;
769
770 fLeft = left;
771 fRite = rite;
772 fInside = inside;
773 }
#define SK_INIT_TO_AVOID_WARNING
Definition: SkMacros.h:58
static bool left(const SkPoint &p0, const SkPoint &p1)
#define assert_valid_pair(left, rite)
Definition: SkRegion.cpp:682
int fRite
Definition: SkRegion.cpp:689
int fInside
Definition: SkRegion.cpp:689
int fLeft
Definition: SkRegion.cpp:689

Member Data Documentation

◆ fA_left

int spanRec::fA_left

Definition at line 688 of file SkRegion.cpp.

◆ fA_rite

int spanRec::fA_rite

Definition at line 688 of file SkRegion.cpp.

◆ fA_runs

const SkRegionPriv::RunType* spanRec::fA_runs

Definition at line 686 of file SkRegion.cpp.

◆ fB_left

int spanRec::fB_left

Definition at line 688 of file SkRegion.cpp.

◆ fB_rite

int spanRec::fB_rite

Definition at line 688 of file SkRegion.cpp.

◆ fB_runs

const SkRegionPriv::RunType* spanRec::fB_runs

Definition at line 687 of file SkRegion.cpp.

◆ fInside

int spanRec::fInside

Definition at line 689 of file SkRegion.cpp.

◆ fLeft

int spanRec::fLeft

Definition at line 689 of file SkRegion.cpp.

◆ fRite

int spanRec::fRite

Definition at line 689 of file SkRegion.cpp.


The documentation for this struct was generated from the following file: