Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
flutter::EmbedderRenderTarget Class Referenceabstract

Describes a surface whose backing store is managed by the embedder. The type of surface depends on the client rendering API used. The embedder is notified of the collection of this render target via a callback. More...

#include <embedder_render_target.h>

Inheritance diagram for flutter::EmbedderRenderTarget:
flutter::EmbedderRenderTargetImpeller flutter::EmbedderRenderTargetSkia

Public Member Functions

virtual ~EmbedderRenderTarget ()
 Destroys this instance of the render target and invokes the callback for the embedder to release its resource associated with the particular backing store.
 
virtual sk_sp< SkSurfaceGetSkiaSurface () const =0
 A render surface the rasterizer can use to draw into the backing store of this render target.
 
virtual impeller::RenderTargetGetImpellerRenderTarget () const =0
 An impeller render target the rasterizer can use to draw into the backing store.
 
virtual std::shared_ptr< impeller::AiksContextGetAiksContext () const =0
 Returns the AiksContext that should be used for rendering, if this render target is backed by Impeller.
 
virtual SkISize GetRenderTargetSize () const =0
 Returns the size of the render target.
 
const FlutterBackingStoreGetBackingStore () const
 The embedder backing store descriptor. This is the descriptor that was given to the engine by the embedder. This descriptor may contain context the embedder can use to associate it resources with the compositor layers when they are given back to it in present callback. The engine does not use this in any way.
 

Protected Member Functions

 EmbedderRenderTarget (FlutterBackingStore backing_store, fml::closure on_release)
 Creates a render target whose backing store is managed by the embedder. The way this render target is exposed to the engine is via an SkSurface and a callback that is invoked by this object in its destructor.
 

Detailed Description

Describes a surface whose backing store is managed by the embedder. The type of surface depends on the client rendering API used. The embedder is notified of the collection of this render target via a callback.

Definition at line 28 of file embedder_render_target.h.

Constructor & Destructor Documentation

◆ ~EmbedderRenderTarget()

flutter::EmbedderRenderTarget::~EmbedderRenderTarget ( )
virtual

Destroys this instance of the render target and invokes the callback for the embedder to release its resource associated with the particular backing store.

Definition at line 20 of file embedder_render_target.cc.

20 {
21 if (on_release_) {
22 on_release_();
23 }
24}

◆ EmbedderRenderTarget()

flutter::EmbedderRenderTarget::EmbedderRenderTarget ( FlutterBackingStore  backing_store,
fml::closure  on_release 
)
protected

Creates a render target whose backing store is managed by the embedder. The way this render target is exposed to the engine is via an SkSurface and a callback that is invoked by this object in its destructor.

Parameters
[in]backing_storeThe backing store describing this render target.
[in]on_releaseThe callback to invoke (eventually forwarded to the embedder) when the backing store is no longer required by the engine.

Definition at line 12 of file embedder_render_target.cc.

14 : backing_store_(backing_store), on_release_(std::move(on_release)) {
15 // TODO(38468): The optimization to elide backing store updates between frames
16 // has not been implemented yet.
17 backing_store_.did_update = true;
18}

Member Function Documentation

◆ GetAiksContext()

virtual std::shared_ptr< impeller::AiksContext > flutter::EmbedderRenderTarget::GetAiksContext ( ) const
pure virtual

Returns the AiksContext that should be used for rendering, if this render target is backed by Impeller.

Returns
The Impeller Aiks context.

Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.

◆ GetBackingStore()

const FlutterBackingStore * flutter::EmbedderRenderTarget::GetBackingStore ( ) const

The embedder backing store descriptor. This is the descriptor that was given to the engine by the embedder. This descriptor may contain context the embedder can use to associate it resources with the compositor layers when they are given back to it in present callback. The engine does not use this in any way.

Returns
The backing store.

Definition at line 26 of file embedder_render_target.cc.

26 {
27 return &backing_store_;
28}

◆ GetImpellerRenderTarget()

virtual impeller::RenderTarget * flutter::EmbedderRenderTarget::GetImpellerRenderTarget ( ) const
pure virtual

An impeller render target the rasterizer can use to draw into the backing store.

Returns
The Impeller render target.

Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.

◆ GetRenderTargetSize()

virtual SkISize flutter::EmbedderRenderTarget::GetRenderTargetSize ( ) const
pure virtual

Returns the size of the render target.

Returns
The size of the render target.

Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.

◆ GetSkiaSurface()

virtual sk_sp< SkSurface > flutter::EmbedderRenderTarget::GetSkiaSurface ( ) const
pure virtual

A render surface the rasterizer can use to draw into the backing store of this render target.

Returns
The render surface.

Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.


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