Flutter Engine
 
Loading...
Searching...
No Matches
flutter::PlatformViewLayer Class Reference

Represents a platform view layer, including all mutations. More...

#include <platform_view_layer.h>

Inheritance diagram for flutter::PlatformViewLayer:
flutter::Layer

Public Member Functions

 PlatformViewLayer (const DlPoint &offset, const DlSize &size, int64_t view_id)
 
void Preroll (PrerollContext *context) override
 
void Paint (PaintContext &context) const override
 
 PlatformViewLayer (const FlutterLayer *_Nonnull layer)
 
 PlatformViewLayer (FlutterPlatformViewIdentifier identifier, const std::vector< FlutterPlatformViewMutation > &mutations, FlutterPoint offset, FlutterSize size)
 
FlutterPlatformViewIdentifier identifier () const
 
const std::vector< FlutterPlatformViewMutation > & mutations () const
 
FlutterPoint offset () const
 
FlutterSize size () const
 
- 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
 
virtual void Diff (DiffContext *context, const Layer *old_layer)
 
virtual void PreservePaintRegion (DiffContext *context)
 
virtual void PaintChildren (PaintContext &context) const
 
bool subtree_has_platform_view () const
 
void set_subtree_has_platform_view (bool value)
 
const DlRectpaint_bounds () const
 
void set_paint_bounds (const DlRect &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
 

Additional Inherited Members

- Static Public Attributes inherited from flutter::Layer
static constexpr int kSaveLayerRenderFlags
 
static constexpr int kRasterCacheRenderFlags
 

Detailed Description

Represents a platform view layer, including all mutations.

Definition at line 13 of file platform_view_layer.h.

Constructor & Destructor Documentation

◆ PlatformViewLayer() [1/3]

flutter::PlatformViewLayer::PlatformViewLayer ( const DlPoint offset,
const DlSize size,
int64_t  view_id 
)

Definition at line 11 of file platform_view_layer.cc.

14 : offset_(offset), size_(size), view_id_(view_id) {}
FlutterPoint offset() const
G_BEGIN_DECLS FlutterViewId view_id

◆ PlatformViewLayer() [2/3]

flutter::PlatformViewLayer::PlatformViewLayer ( const FlutterLayer *_Nonnull  layer)
explicit

Creates platform view from provided FlutterLayer, which must be of type kFlutterLayerContentTypePlatformView.

◆ PlatformViewLayer() [3/3]

flutter::PlatformViewLayer::PlatformViewLayer ( FlutterPlatformViewIdentifier  identifier,
const std::vector< FlutterPlatformViewMutation > &  mutations,
FlutterPoint  offset,
FlutterSize  size 
)

Definition at line 26 of file FlutterMutatorView.mm.

30 : identifier_(identifier), mutations_(mutations), offset_(offset), size_(size) {}
const std::vector< FlutterPlatformViewMutation > & mutations() const
FlutterPlatformViewIdentifier identifier() const

Member Function Documentation

◆ identifier()

FlutterPlatformViewIdentifier flutter::PlatformViewLayer::identifier ( ) const
inline

Definition at line 27 of file FlutterMutatorView.h.

27{ return identifier_; }

◆ mutations()

const std::vector< FlutterPlatformViewMutation > & flutter::PlatformViewLayer::mutations ( ) const
inline

Definition at line 28 of file FlutterMutatorView.h.

28{ return mutations_; }

◆ offset()

FlutterPoint flutter::PlatformViewLayer::offset ( ) const
inline

Definition at line 29 of file FlutterMutatorView.h.

29{ return offset_; }

◆ Paint()

void flutter::PlatformViewLayer::Paint ( PaintContext context) const
overridevirtual

Implements flutter::Layer.

Definition at line 36 of file platform_view_layer.cc.

36 {
37 if (context.view_embedder == nullptr) {
38 FML_DLOG(ERROR) << "Trying to embed a platform view but the PaintContext "
39 "does not support embedding";
40 return;
41 }
42 DlCanvas* canvas = context.view_embedder->CompositeEmbeddedView(view_id_);
43 context.canvas = canvas;
44 context.state_stack.set_delegate(canvas);
45 context.rendering_above_platform_view = true;
46}
#define FML_DLOG(severity)
Definition logging.h:121
flutter::DlCanvas DlCanvas

References flutter::PaintContext::canvas, flutter::ExternalViewEmbedder::CompositeEmbeddedView(), FML_DLOG, flutter::PaintContext::rendering_above_platform_view, flutter::LayerStateStack::set_delegate(), flutter::PaintContext::state_stack, and flutter::PaintContext::view_embedder.

◆ Preroll()

void flutter::PlatformViewLayer::Preroll ( PrerollContext context)
overridevirtual

Implements flutter::Layer.

Definition at line 16 of file platform_view_layer.cc.

16 {
18
19 if (context->view_embedder == nullptr) {
20 FML_DLOG(ERROR) << "Trying to embed a platform view but the PrerollContext "
21 "does not support embedding";
22 return;
23 }
24 context->has_platform_view = true;
26 MutatorsStack mutators;
27 context->state_stack.fill(&mutators);
28 std::unique_ptr<EmbeddedViewParams> params =
29 std::make_unique<EmbeddedViewParams>(context->state_stack.matrix(), size_,
30 mutators);
31 context->view_embedder->PrerollCompositeEmbeddedView(view_id_,
32 std::move(params));
33 context->view_embedder->PushVisitedPlatformView(view_id_);
34}
void set_subtree_has_platform_view(bool value)
Definition layer.h:188
void set_paint_bounds(const DlRect &paint_bounds)
Definition layer.h:209
const EmbeddedViewParams * params
static constexpr TRect MakeOriginSize(const TPoint< Type > &origin, const TSize< Type > &size)
Definition rect.h:144

References flutter::LayerStateStack::fill(), FML_DLOG, flutter::PrerollContext::has_platform_view, impeller::TRect< Scalar >::MakeOriginSize(), flutter::LayerStateStack::matrix(), params, flutter::ExternalViewEmbedder::PrerollCompositeEmbeddedView(), flutter::ExternalViewEmbedder::PushVisitedPlatformView(), flutter::Layer::set_paint_bounds(), flutter::Layer::set_subtree_has_platform_view(), flutter::PrerollContext::state_stack, and flutter::PrerollContext::view_embedder.

◆ size()

FlutterSize flutter::PlatformViewLayer::size ( ) const
inline

Definition at line 30 of file FlutterMutatorView.h.

30{ return size_; }

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