Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | List of all members
flutter::Layer Class Referenceabstract

#include <layer.h>

Inheritance diagram for flutter::Layer:
flutter::ContainerLayer flutter::DisplayListLayer flutter::PerformanceOverlayLayer flutter::PlatformViewLayer flutter::TextureLayer flutter::testing::MockLayer flutter::BackdropFilterLayer flutter::CacheableContainerLayer flutter::TransformLayer flutter::testing::MockCacheableLayer flutter::ClipShapeLayer< SkPath > flutter::ClipShapeLayer< SkRRect > flutter::ClipShapeLayer< SkRect > flutter::ClipShapeLayer< T > flutter::ColorFilterLayer flutter::ImageFilterLayer flutter::OpacityLayer flutter::ShaderMaskLayer flutter::testing::MockCacheableContainerLayer

Classes

class  AutoPrerollSaveLayerState
 

Public Member Functions

 Layer ()
 
virtual ~Layer ()
 
void AssignOldLayer (Layer *old_layer)
 
virtual bool IsReplacing (DiffContext *context, const Layer *old_layer) const
 
virtual void Diff (DiffContext *context, const Layer *old_layer)
 
virtual void PreservePaintRegion (DiffContext *context)
 
virtual void Preroll (PrerollContext *context)=0
 
virtual void Paint (PaintContext &context) const =0
 
virtual void PaintChildren (PaintContext &context) const
 
bool subtree_has_platform_view () const
 
void set_subtree_has_platform_view (bool value)
 
const SkRectpaint_bounds () const
 
void set_paint_bounds (const SkRect &paint_bounds)
 
bool is_empty () const
 
bool needs_painting (PaintContext &context) const
 
uint64_t original_layer_id () const
 
uint64_t unique_id () const
 
virtual RasterCacheKeyID caching_key_id () const
 
virtual const ContainerLayeras_container_layer () const
 
virtual const DisplayListLayeras_display_list_layer () const
 
virtual const TextureLayeras_texture_layer () const
 
virtual const PerformanceOverlayLayeras_performance_overlay_layer () const
 
virtual const testing::MockLayeras_mock_layer () const
 

Static Public Attributes

static constexpr int kSaveLayerRenderFlags
 
static constexpr int kRasterCacheRenderFlags
 

Detailed Description

Definition at line 126 of file layer.h.

Constructor & Destructor Documentation

◆ Layer()

flutter::Layer::Layer ( )

Definition at line 11 of file layer.cc.

12 : paint_bounds_(SkRect::MakeEmpty()),
13 unique_id_(NextUniqueID()),
14 original_layer_id_(unique_id_) {}
static constexpr SkRect MakeEmpty()
Definition SkRect.h:595

◆ ~Layer()

flutter::Layer::~Layer ( )
virtualdefault

Member Function Documentation

◆ as_container_layer()

virtual const ContainerLayer * flutter::Layer::as_container_layer ( ) const
inlinevirtual

Reimplemented in flutter::ContainerLayer.

Definition at line 255 of file layer.h.

255{ return nullptr; }

◆ as_display_list_layer()

virtual const DisplayListLayer * flutter::Layer::as_display_list_layer ( ) const
inlinevirtual

Reimplemented in flutter::DisplayListLayer.

Definition at line 256 of file layer.h.

256 {
257 return nullptr;
258 }

◆ as_mock_layer()

virtual const testing::MockLayer * flutter::Layer::as_mock_layer ( ) const
inlinevirtual

Reimplemented in flutter::testing::MockLayer.

Definition at line 263 of file layer.h.

263{ return nullptr; }

◆ as_performance_overlay_layer()

virtual const PerformanceOverlayLayer * flutter::Layer::as_performance_overlay_layer ( ) const
inlinevirtual

Reimplemented in flutter::PerformanceOverlayLayer.

Definition at line 260 of file layer.h.

260 {
261 return nullptr;
262 }

◆ as_texture_layer()

virtual const TextureLayer * flutter::Layer::as_texture_layer ( ) const
inlinevirtual

Reimplemented in flutter::TextureLayer.

Definition at line 259 of file layer.h.

259{ return nullptr; }

◆ AssignOldLayer()

void flutter::Layer::AssignOldLayer ( Layer old_layer)
inline

Definition at line 145 of file layer.h.

145 {
146 original_layer_id_ = old_layer->original_layer_id_;
147 }

◆ caching_key_id()

virtual RasterCacheKeyID flutter::Layer::caching_key_id ( ) const
inlinevirtual

Reimplemented in flutter::DisplayListLayer.

Definition at line 252 of file layer.h.

252 {
253 return RasterCacheKeyID(unique_id_, RasterCacheKeyType::kLayer);
254 }

◆ Diff()

virtual void flutter::Layer::Diff ( DiffContext context,
const Layer old_layer 
)
inlinevirtual

◆ is_empty()

bool flutter::Layer::is_empty ( ) const
inline

Definition at line 227 of file layer.h.

227{ return paint_bounds_.isEmpty(); }
bool isEmpty() const
Definition SkRect.h:693

◆ IsReplacing()

virtual bool flutter::Layer::IsReplacing ( DiffContext context,
const Layer old_layer 
) const
inlinevirtual

Reimplemented in flutter::DisplayListLayer, flutter::PerformanceOverlayLayer, flutter::TextureLayer, and flutter::testing::MockLayer.

Definition at line 152 of file layer.h.

152 {
153 return original_layer_id_ == old_layer->original_layer_id_;
154 }

◆ needs_painting()

bool flutter::Layer::needs_painting ( PaintContext context) const
inline

Definition at line 231 of file layer.h.

231 {
232 if (subtree_has_platform_view_) {
233 // Workaround for the iOS embedder. The iOS embedder expects that
234 // if we preroll it, then we will later call its Paint() method.
235 // Now that we preroll all layers without any culling, we may
236 // call its Preroll() without calling its Paint(). For now, we
237 // will not perform paint culling on any subtree that has a
238 // platform view.
239 // See https://github.com/flutter/flutter/issues/81419
240 return true;
241 }
242 return !context.state_stack.painting_is_nop() &&
243 !context.state_stack.content_culled(paint_bounds_);
244 }

◆ original_layer_id()

uint64_t flutter::Layer::original_layer_id ( ) const
inline

Definition at line 248 of file layer.h.

248{ return original_layer_id_; }

◆ Paint()

virtual void flutter::Layer::Paint ( PaintContext context) const
pure virtual

◆ paint_bounds()

const SkRect & flutter::Layer::paint_bounds ( ) const
inline

Definition at line 209 of file layer.h.

209{ return paint_bounds_; }

◆ PaintChildren()

virtual void flutter::Layer::PaintChildren ( PaintContext context) const
inlinevirtual

Reimplemented in flutter::ContainerLayer.

Definition at line 198 of file layer.h.

198{ FML_DCHECK(false); }
#define FML_DCHECK(condition)
Definition logging.h:103

◆ Preroll()

virtual void flutter::Layer::Preroll ( PrerollContext context)
pure virtual

◆ PreservePaintRegion()

virtual void flutter::Layer::PreservePaintRegion ( DiffContext context)
inlinevirtual

Reimplemented in flutter::ContainerLayer.

Definition at line 162 of file layer.h.

162 {
163 // retained layer means same instance so 'this' is used to index into both
164 // current and old region
165 context->SetLayerPaintRegion(this, context->GetOldLayerPaintRegion(this));
166 }

◆ set_paint_bounds()

void flutter::Layer::set_paint_bounds ( const SkRect paint_bounds)
inline

Definition at line 222 of file layer.h.

222 {
223 paint_bounds_ = paint_bounds;
224 }
const SkRect & paint_bounds() const
Definition layer.h:209

◆ set_subtree_has_platform_view()

void flutter::Layer::set_subtree_has_platform_view ( bool  value)
inline

Definition at line 201 of file layer.h.

201 {
202 subtree_has_platform_view_ = value;
203 }
uint8_t value

◆ subtree_has_platform_view()

bool flutter::Layer::subtree_has_platform_view ( ) const
inline

Definition at line 200 of file layer.h.

200{ return subtree_has_platform_view_; }

◆ unique_id()

uint64_t flutter::Layer::unique_id ( ) const
inline

Definition at line 250 of file layer.h.

250{ return unique_id_; }

Member Data Documentation

◆ kRasterCacheRenderFlags

constexpr int flutter::Layer::kRasterCacheRenderFlags
staticconstexpr
Initial value:

Definition at line 139 of file layer.h.

◆ kSaveLayerRenderFlags

constexpr int flutter::Layer::kSaveLayerRenderFlags
staticconstexpr

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