Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::VectorCuller Class Referencefinal
Inheritance diagram for flutter::VectorCuller:
flutter::Culler

Public Member Functions

 VectorCuller (const DlRTree *rtree, const std::vector< int > &rect_indices)
 
 ~VectorCuller ()=default
 
bool init (DispatchContext &context) override
 
void update (DispatchContext &context) override
 
- Public Member Functions inherited from flutter::Culler
virtual ~Culler ()=default
 

Detailed Description

Definition at line 91 of file display_list.cc.

Constructor & Destructor Documentation

◆ VectorCuller()

flutter::VectorCuller::VectorCuller ( const DlRTree rtree,
const std::vector< int > &  rect_indices 
)
inline

Definition at line 93 of file display_list.cc.

94 : rtree_(rtree), cur_(rect_indices.begin()), end_(rect_indices.end()) {}

◆ ~VectorCuller()

flutter::VectorCuller::~VectorCuller ( )
default

Member Function Documentation

◆ init()

bool flutter::VectorCuller::init ( DispatchContext context)
inlineoverridevirtual

Implements flutter::Culler.

Definition at line 98 of file display_list.cc.

98 {
99 if (cur_ < end_) {
100 context.next_render_index = rtree_->id(*cur_++);
101 return true;
102 } else {
103 // Setting next_render_index to MAX_INT means that
104 // all rendering ops will be "before" that index and
105 // they will skip themselves and all clip and transform
106 // ops will see that the next render index is not
107 // before the next restore index (even if both are MAX_INT)
108 // and so they will also not execute.
109 // None of this really matters because returning false
110 // here should cause the Dispatch operation to abort,
111 // but this value is conceptually correct if that short
112 // circuit optimization isn't used.
113 context.next_render_index = std::numeric_limits<int>::max();
114 return false;
115 }
116 }
int id(int result_index) const
Definition dl_rtree.h:85

◆ update()

void flutter::VectorCuller::update ( DispatchContext context)
inlineoverridevirtual

Implements flutter::Culler.

Definition at line 117 of file display_list.cc.

117 {
118 if (++context.cur_index > context.next_render_index) {
119 while (cur_ < end_) {
120 context.next_render_index = rtree_->id(*cur_++);
121 if (context.next_render_index >= context.cur_index) {
122 // It should be rare that we have duplicate indices
123 // but if we do, then having a while loop is a cheap
124 // insurance for those cases.
125 // The main cause of duplicate indices is when a
126 // DrawDisplayListOp was added to this DisplayList and
127 // both are computing an R-Tree, in which case the
128 // builder method will forward all of the child
129 // DisplayList's rects to this R-Tree with the same
130 // op_index.
131 return;
132 }
133 }
134 context.next_render_index = std::numeric_limits<int>::max();
135 }
136 }

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