Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
flutter::ClipShapeLayer< T > Class Template Referenceabstract

#include <clip_shape_layer.h>

Inheritance diagram for flutter::ClipShapeLayer< T >:
flutter::CacheableContainerLayer flutter::ContainerLayer flutter::Layer

Public Types

using ClipShape = T
 

Public Member Functions

 ClipShapeLayer (const ClipShape &clip_shape, Clip clip_behavior)
 
void Diff (DiffContext *context, const Layer *old_layer) override
 
void Preroll (PrerollContext *context) override
 
void Paint (PaintContext &context) const override
 
bool UsesSaveLayer () const
 
- Public Member Functions inherited from flutter::CacheableContainerLayer
 CacheableContainerLayer (int layer_cached_threshold=RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer, bool can_cache_children=false)
 
const LayerRasterCacheItemraster_cache_item () const
 
- Public Member Functions inherited from flutter::ContainerLayer
 ContainerLayer ()
 
void Diff (DiffContext *context, const Layer *old_layer) override
 
void PreservePaintRegion (DiffContext *context) override
 
virtual void Add (std::shared_ptr< Layer > layer)
 
void Preroll (PrerollContext *context) override
 
void Paint (PaintContext &context) const override
 
const std::vector< std::shared_ptr< Layer > > & layers () const
 
virtual void DiffChildren (DiffContext *context, const ContainerLayer *old_layer)
 
void PaintChildren (PaintContext &context) const override
 
const ContainerLayeras_container_layer () const override
 
const SkRectchild_paint_bounds () const
 
void set_child_paint_bounds (const SkRect &bounds)
 
int children_renderable_state_flags () const
 
void set_children_renderable_state_flags (int flags)
 
- Public Member Functions inherited from flutter::Layer
 Layer ()
 
virtual ~Layer ()
 
void AssignOldLayer (Layer *old_layer)
 
virtual bool IsReplacing (DiffContext *context, const Layer *old_layer) 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 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
 

Protected Member Functions

virtual const SkRectclip_shape_bounds () const =0
 
virtual void ApplyClip (LayerStateStack::MutatorContext &mutator) const =0
 
virtual ~ClipShapeLayer ()=default
 
const ClipShapeclip_shape () const
 
Clip clip_behavior () const
 
- Protected Member Functions inherited from flutter::ContainerLayer
void PrerollChildren (PrerollContext *context, SkRect *child_paint_bounds)
 

Additional Inherited Members

- Static Public Attributes inherited from flutter::Layer
static constexpr int kSaveLayerRenderFlags
 
static constexpr int kRasterCacheRenderFlags
 
- Protected Attributes inherited from flutter::CacheableContainerLayer
std::unique_ptr< LayerRasterCacheItemlayer_raster_cache_item_
 

Detailed Description

template<class T>
class flutter::ClipShapeLayer< T >

Definition at line 15 of file clip_shape_layer.h.

Member Typedef Documentation

◆ ClipShape

template<class T >
using flutter::ClipShapeLayer< T >::ClipShape = T

Definition at line 17 of file clip_shape_layer.h.

Constructor & Destructor Documentation

◆ ClipShapeLayer()

template<class T >
flutter::ClipShapeLayer< T >::ClipShapeLayer ( const ClipShape clip_shape,
Clip  clip_behavior 
)
inline

Definition at line 18 of file clip_shape_layer.h.

20 clip_shape_(clip_shape),
21 clip_behavior_(clip_behavior) {
23 }
CacheableContainerLayer(int layer_cached_threshold=RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer, bool can_cache_children=false)
const ClipShape & clip_shape() const
#define FML_DCHECK(condition)
Definition logging.h:103
@ kNone
Definition layer.h:52

◆ ~ClipShapeLayer()

template<class T >
virtual flutter::ClipShapeLayer< T >::~ClipShapeLayer ( )
protectedvirtualdefault

Member Function Documentation

◆ ApplyClip()

template<class T >
virtual void flutter::ClipShapeLayer< T >::ApplyClip ( LayerStateStack::MutatorContext mutator) const
protectedpure virtual

◆ clip_behavior()

template<class T >
Clip flutter::ClipShapeLayer< T >::clip_behavior ( ) const
inlineprotected

Definition at line 112 of file clip_shape_layer.h.

112{ return clip_behavior_; }

◆ clip_shape()

template<class T >
const ClipShape & flutter::ClipShapeLayer< T >::clip_shape ( ) const
inlineprotected

Definition at line 111 of file clip_shape_layer.h.

111{ return clip_shape_; }

◆ clip_shape_bounds()

template<class T >
virtual const SkRect & flutter::ClipShapeLayer< T >::clip_shape_bounds ( ) const
protectedpure virtual

◆ Diff()

template<class T >
void flutter::ClipShapeLayer< T >::Diff ( DiffContext context,
const Layer old_layer 
)
inlineoverridevirtual

Reimplemented from flutter::Layer.

Definition at line 25 of file clip_shape_layer.h.

25 {
26 DiffContext::AutoSubtreeRestore subtree(context);
27 auto* prev = static_cast<const ClipShapeLayer<ClipShape>*>(old_layer);
28 if (!context->IsSubtreeDirty()) {
30 if (clip_behavior_ != prev->clip_behavior_ ||
31 clip_shape_ != prev->clip_shape_) {
32 context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(old_layer));
33 }
34 }
35 if (UsesSaveLayer() && context->has_raster_cache()) {
36 context->WillPaintWithIntegralTransform();
37 }
38 if (context->PushCullRect(clip_shape_bounds())) {
39 DiffChildren(context, prev);
40 }
41 context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
42 }
static float prev(float f)
virtual const SkRect & clip_shape_bounds() const =0
virtual void DiffChildren(DiffContext *context, const ContainerLayer *old_layer)

◆ Paint()

template<class T >
void flutter::ClipShapeLayer< T >::Paint ( PaintContext context) const
inlineoverridevirtual

Implements flutter::Layer.

Definition at line 75 of file clip_shape_layer.h.

75 {
76 FML_DCHECK(needs_painting(context));
77
78 auto mutator = context.state_stack.save();
79 ApplyClip(mutator);
80
81 if (!UsesSaveLayer()) {
82 PaintChildren(context);
83 return;
84 }
85
86 if (context.raster_cache) {
87 mutator.integralTransform();
88 auto restore_apply = context.state_stack.applyState(
90
91 DlPaint paint;
92 if (layer_raster_cache_item_->Draw(context,
93 context.state_stack.fill(paint))) {
94 return;
95 }
96 }
97
98 mutator.saveLayer(paint_bounds());
99 PaintChildren(context);
100 }
std::unique_ptr< LayerRasterCacheItem > layer_raster_cache_item_
virtual void ApplyClip(LayerStateStack::MutatorContext &mutator) const =0
void PaintChildren(PaintContext &context) const override
static constexpr int kCallerCanApplyOpacity
const SkRect & paint_bounds() const
Definition layer.h:209
bool needs_painting(PaintContext &context) const
Definition layer.h:231
const Paint & paint

◆ Preroll()

template<class T >
void flutter::ClipShapeLayer< T >::Preroll ( PrerollContext context)
inlineoverridevirtual

Implements flutter::Layer.

Definition at line 44 of file clip_shape_layer.h.

44 {
45 bool uses_save_layer = UsesSaveLayer();
46
47 // We can use the raster_cache for children only when the use_save_layer is
48 // true so if use_save_layer is false we pass the layer_raster_item is
49 // nullptr which mean we don't do raster cache logic.
50 AutoCache cache =
51 AutoCache(uses_save_layer ? layer_raster_cache_item_.get() : nullptr,
52 context, context->state_stack.transform_3x3());
53
54 Layer::AutoPrerollSaveLayerState save =
56
57 auto mutator = context->state_stack.save();
58 ApplyClip(mutator);
59
64 } else {
66 }
67
68 // If we use a SaveLayer then we can accept opacity on behalf
69 // of our children and apply it in the saveLayer.
70 if (uses_save_layer) {
71 context->renderable_state_flags = kSaveLayerRenderFlags;
72 }
73 }
void PrerollChildren(PrerollContext *context, SkRect *child_paint_bounds)
const SkRect & child_paint_bounds() const
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
Definition layer.cc:40
static constexpr int kSaveLayerRenderFlags
Definition layer.h:131
void set_paint_bounds(const SkRect &paint_bounds)
Definition layer.h:222
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
Definition switches.h:191
static constexpr SkRect MakeEmpty()
Definition SkRect.h:595
bool intersect(const SkRect &r)
Definition SkRect.cpp:114

◆ UsesSaveLayer()

template<class T >
bool flutter::ClipShapeLayer< T >::UsesSaveLayer ( ) const
inline

Definition at line 102 of file clip_shape_layer.h.

102 {
103 return clip_behavior_ == Clip::kAntiAliasWithSaveLayer;
104 }
@ kAntiAliasWithSaveLayer
Definition layer.h:52

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