Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
flutter::DisplayList Class Reference

#include <display_list.h>

Inheritance diagram for flutter::DisplayList:
SkRefCnt SkRefCntBase

Public Member Functions

 DisplayList ()
 
 ~DisplayList ()
 
void Dispatch (DlOpReceiver &ctx) const
 
void Dispatch (DlOpReceiver &ctx, const SkRect &cull_rect) const
 
void Dispatch (DlOpReceiver &ctx, const SkIRect &cull_rect) const
 
size_t bytes (bool nested=true) const
 
uint32_t op_count (bool nested=false) const
 
uint32_t total_depth () const
 
uint32_t unique_id () const
 
const SkRectbounds () const
 
bool has_rtree () const
 
sk_sp< const DlRTreertree () const
 
bool Equals (const DisplayList *other) const
 
bool Equals (const DisplayList &other) const
 
bool Equals (const sk_sp< const DisplayList > &other) const
 
bool can_apply_group_opacity () const
 
bool isUIThreadSafe () const
 
bool modifies_transparent_black () const
 Indicates if there are any rendering operations in this DisplayList that will modify a surface of transparent black pixels.
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Friends

class DisplayListBuilder
 

Detailed Description

Definition at line 259 of file display_list.h.

Constructor & Destructor Documentation

◆ DisplayList()

flutter::DisplayList::DisplayList ( )

Definition at line 17 of file display_list.cc.

18 : byte_count_(0),
19 op_count_(0),
20 nested_byte_count_(0),
21 nested_op_count_(0),
22 total_depth_(0),
23 unique_id_(0),
24 bounds_({0, 0, 0, 0}),
25 can_apply_group_opacity_(true),
26 is_ui_thread_safe_(true),
27 modifies_transparent_black_(false) {}

◆ ~DisplayList()

flutter::DisplayList::~DisplayList ( )

Definition at line 53 of file display_list.cc.

53 {
54 uint8_t* ptr = storage_.get();
55 DisposeOps(ptr, ptr + byte_count_);
56}

Member Function Documentation

◆ bounds()

const SkRect & flutter::DisplayList::bounds ( ) const
inline

Definition at line 285 of file display_list.h.

285{ return bounds_; }

◆ bytes()

size_t flutter::DisplayList::bytes ( bool  nested = true) const
inline

Definition at line 272 of file display_list.h.

272 {
273 return sizeof(DisplayList) + byte_count_ +
274 (nested ? nested_byte_count_ : 0);
275 }

◆ can_apply_group_opacity()

bool flutter::DisplayList::can_apply_group_opacity ( ) const
inline

Definition at line 296 of file display_list.h.

296{ return can_apply_group_opacity_; }

◆ Dispatch() [1/3]

void flutter::DisplayList::Dispatch ( DlOpReceiver ctx) const

Definition at line 144 of file display_list.cc.

144 {
145 uint8_t* ptr = storage_.get();
146 Dispatch(receiver, ptr, ptr + byte_count_, NopCuller::instance);
147}
void Dispatch(DlOpReceiver &ctx) const
static NopCuller instance

◆ Dispatch() [2/3]

void flutter::DisplayList::Dispatch ( DlOpReceiver ctx,
const SkIRect cull_rect 
) const

Definition at line 149 of file display_list.cc.

150 {
151 Dispatch(receiver, SkRect::Make(cull_rect));
152}
static SkRect Make(const SkISize &size)
Definition SkRect.h:669

◆ Dispatch() [3/3]

void flutter::DisplayList::Dispatch ( DlOpReceiver ctx,
const SkRect cull_rect 
) const

Definition at line 154 of file display_list.cc.

155 {
156 if (cull_rect.isEmpty()) {
157 return;
158 }
159 if (!has_rtree() || cull_rect.contains(bounds())) {
160 Dispatch(receiver);
161 return;
162 }
163 const DlRTree* rtree = this->rtree().get();
164 FML_DCHECK(rtree != nullptr);
165 uint8_t* ptr = storage_.get();
166 std::vector<int> rect_indices;
167 rtree->search(cull_rect, &rect_indices);
168 VectorCuller culler(rtree, rect_indices);
169 Dispatch(receiver, ptr, ptr + byte_count_, culler);
170}
const SkRect & bounds() const
bool has_rtree() const
sk_sp< const DlRTree > rtree() const
#define FML_DCHECK(condition)
Definition logging.h:103
bool contains(SkScalar x, SkScalar y) const
Definition extension.cpp:19
bool isEmpty() const
Definition SkRect.h:693

◆ Equals() [1/3]

bool flutter::DisplayList::Equals ( const DisplayList other) const
inline

Definition at line 291 of file display_list.h.

291{ return Equals(&other); }
bool Equals(const DisplayList *other) const

◆ Equals() [2/3]

bool flutter::DisplayList::Equals ( const DisplayList other) const

Definition at line 306 of file display_list.cc.

306 {
307 if (this == other) {
308 return true;
309 }
310 if (byte_count_ != other->byte_count_ || op_count_ != other->op_count_) {
311 return false;
312 }
313 uint8_t* ptr = storage_.get();
314 uint8_t* o_ptr = other->storage_.get();
315 if (ptr == o_ptr) {
316 return true;
317 }
318 return CompareOps(ptr, ptr + byte_count_, o_ptr, o_ptr + other->byte_count_);
319}
static bool CompareOps(uint8_t *ptrA, uint8_t *endA, uint8_t *ptrB, uint8_t *endB)

◆ Equals() [3/3]

bool flutter::DisplayList::Equals ( const sk_sp< const DisplayList > &  other) const
inline

Definition at line 292 of file display_list.h.

292 {
293 return Equals(other.get());
294 }
T * get() const
Definition SkRefCnt.h:303

◆ has_rtree()

bool flutter::DisplayList::has_rtree ( ) const
inline

Definition at line 287 of file display_list.h.

287{ return rtree_ != nullptr; }

◆ isUIThreadSafe()

bool flutter::DisplayList::isUIThreadSafe ( ) const
inline

Definition at line 297 of file display_list.h.

297{ return is_ui_thread_safe_; }

◆ modifies_transparent_black()

bool flutter::DisplayList::modifies_transparent_black ( ) const
inline

Indicates if there are any rendering operations in this DisplayList that will modify a surface of transparent black pixels.

This condition can be used to determine whether to create a cleared surface, render a DisplayList into it, and then composite the result into a scene. It is not uncommon for code in the engine to come across such degenerate DisplayList objects when slicing up a frame between platform views.

Definition at line 308 of file display_list.h.

308 {
309 return modifies_transparent_black_;
310 }

◆ op_count()

uint32_t flutter::DisplayList::op_count ( bool  nested = false) const
inline

Definition at line 277 of file display_list.h.

277 {
278 return op_count_ + (nested ? nested_op_count_ : 0);
279 }

◆ rtree()

sk_sp< const DlRTree > flutter::DisplayList::rtree ( ) const
inline

Definition at line 288 of file display_list.h.

288{ return rtree_; }

◆ total_depth()

uint32_t flutter::DisplayList::total_depth ( ) const
inline

Definition at line 281 of file display_list.h.

281{ return total_depth_; }

◆ unique_id()

uint32_t flutter::DisplayList::unique_id ( ) const
inline

Definition at line 283 of file display_list.h.

283{ return unique_id_; }

Friends And Related Symbol Documentation

◆ DisplayListBuilder

friend class DisplayListBuilder
friend

Definition at line 352 of file display_list.h.


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