Flutter Engine
The Flutter Engine
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. More...
 
const DisplayListStorageGetStorage () const
 
bool root_has_backdrop_filter () const
 Indicates if there are any saveLayer operations at the root surface level of the DisplayList that use a backdrop filter. More...
 
DlBlendMode max_root_blend_mode () const
 Indicates the maximum DlBlendMode used on any rendering op in the root surface of the DisplayList. More...
 
- 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 268 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),
28 root_has_backdrop_filter_(false),
29 max_root_blend_mode_(DlBlendMode::kClear) {}

◆ ~DisplayList()

flutter::DisplayList::~DisplayList ( )

Definition at line 59 of file display_list.cc.

59 {
60 const uint8_t* ptr = storage_.get();
61 DisposeOps(ptr, ptr + byte_count_);
62}

Member Function Documentation

◆ bounds()

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

Definition at line 294 of file display_list.h.

294{ return bounds_; }

◆ bytes()

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

Definition at line 281 of file display_list.h.

281 {
282 return sizeof(DisplayList) + byte_count_ +
283 (nested ? nested_byte_count_ : 0);
284 }

◆ can_apply_group_opacity()

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

Definition at line 305 of file display_list.h.

305{ return can_apply_group_opacity_; }

◆ Dispatch() [1/3]

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

Definition at line 150 of file display_list.cc.

150 {
151 const uint8_t* ptr = storage_.get();
152 Dispatch(receiver, ptr, ptr + byte_count_, NopCuller::instance);
153}
void Dispatch(DlOpReceiver &ctx) const
static NopCuller instance
Definition: display_list.cc:81

◆ Dispatch() [2/3]

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

Definition at line 155 of file display_list.cc.

156 {
157 Dispatch(receiver, SkRect::Make(cull_rect));
158}
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 160 of file display_list.cc.

161 {
162 if (cull_rect.isEmpty()) {
163 return;
164 }
165 if (!has_rtree() || cull_rect.contains(bounds())) {
166 Dispatch(receiver);
167 return;
168 }
169 const DlRTree* rtree = this->rtree().get();
170 FML_DCHECK(rtree != nullptr);
171 const uint8_t* ptr = storage_.get();
172 std::vector<int> rect_indices;
173 rtree->search(cull_rect, &rect_indices);
174 VectorCuller culler(rtree, rect_indices);
175 Dispatch(receiver, ptr, ptr + byte_count_, culler);
176}
const SkRect & bounds() const
Definition: display_list.h:294
bool has_rtree() const
Definition: display_list.h:296
sk_sp< const DlRTree > rtree() const
Definition: display_list.h:297
#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 300 of file display_list.h.

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

◆ Equals() [2/3]

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

Definition at line 312 of file display_list.cc.

312 {
313 if (this == other) {
314 return true;
315 }
316 if (byte_count_ != other->byte_count_ || op_count_ != other->op_count_) {
317 return false;
318 }
319 const uint8_t* ptr = storage_.get();
320 const uint8_t* o_ptr = other->storage_.get();
321 if (ptr == o_ptr) {
322 return true;
323 }
324 return CompareOps(ptr, ptr + byte_count_, o_ptr, o_ptr + other->byte_count_);
325}
static bool CompareOps(const uint8_t *ptrA, const uint8_t *endA, const uint8_t *ptrB, const uint8_t *endB)

◆ Equals() [3/3]

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

Definition at line 301 of file display_list.h.

301 {
302 return Equals(other.get());
303 }
T * get() const
Definition: SkRefCnt.h:303

◆ GetStorage()

const DisplayListStorage & flutter::DisplayList::GetStorage ( ) const
inline

Definition at line 321 of file display_list.h.

321{ return storage_; }

◆ has_rtree()

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

Definition at line 296 of file display_list.h.

296{ return rtree_ != nullptr; }

◆ isUIThreadSafe()

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

Definition at line 306 of file display_list.h.

306{ return is_ui_thread_safe_; }

◆ max_root_blend_mode()

DlBlendMode flutter::DisplayList::max_root_blend_mode ( ) const
inline

Indicates the maximum DlBlendMode used on any rendering op in the root surface of the DisplayList.

This condition can be used to determine what kind of surface to create for the root layer into which to render the DisplayList as some GPUs can support surfaces that do or do not support the readback that would be required for the indicated blend mode to do its work.

Definition at line 339 of file display_list.h.

339{ return max_root_blend_mode_; }

◆ 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 317 of file display_list.h.

317 {
318 return modifies_transparent_black_;
319 }

◆ op_count()

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

Definition at line 286 of file display_list.h.

286 {
287 return op_count_ + (nested ? nested_op_count_ : 0);
288 }

◆ root_has_backdrop_filter()

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

Indicates if there are any saveLayer operations at the root surface level of the DisplayList that use a backdrop filter.

This condition can be used to determine what kind of surface to create for the root layer into which to render the DisplayList as some GPUs can support surfaces that do or do not support the readback that would be required for the backdrop filter to do its work.

Definition at line 330 of file display_list.h.

330{ return root_has_backdrop_filter_; }

◆ rtree()

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

Definition at line 297 of file display_list.h.

297{ return rtree_; }

◆ total_depth()

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

Definition at line 290 of file display_list.h.

290{ return total_depth_; }

◆ unique_id()

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

Definition at line 292 of file display_list.h.

292{ return unique_id_; }

Friends And Related Function Documentation

◆ DisplayListBuilder

friend class DisplayListBuilder
friend

Definition at line 385 of file display_list.h.


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