Flutter Engine
flutter::EmbedderRenderTarget Class Reference

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>

Public Member Functions

 EmbedderRenderTarget (FlutterBackingStore backing_store, sk_sp< SkSurface > render_surface, 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. More...
 
 ~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. More...
 
sk_sp< SkSurface > GetRenderSurface () const
 A render surface the rasterizer can use to draw into the backing store of this render target. More...
 
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. More...
 

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 22 of file embedder_render_target.h.

Constructor & Destructor Documentation

◆ EmbedderRenderTarget()

flutter::EmbedderRenderTarget::EmbedderRenderTarget ( FlutterBackingStore  backing_store,
sk_sp< SkSurface >  render_surface,
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.

Parameters
[in]backing_storeThe backing store describing this render target.
[in]render_surfaceThe surface for this 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 11 of file embedder_render_target.cc.

References FlutterBackingStore::did_update, and FML_DCHECK.

14  : backing_store_(backing_store),
15  render_surface_(std::move(render_surface)),
16  on_release_(on_release) {
17  // TODO(38468): The optimization to elide backing store updates between frames
18  // has not been implemented yet.
19  backing_store_.did_update = true;
20  FML_DCHECK(render_surface_);
21 }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ ~EmbedderRenderTarget()

flutter::EmbedderRenderTarget::~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.

Definition at line 23 of file embedder_render_target.cc.

23  {
24  if (on_release_) {
25  on_release_();
26  }
27 }

Member Function Documentation

◆ 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 29 of file embedder_render_target.cc.

29  {
30  return &backing_store_;
31 }

◆ GetRenderSurface()

sk_sp< SkSurface > flutter::EmbedderRenderTarget::GetRenderSurface ( ) const

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

Returns
The render surface.

Definition at line 33 of file embedder_render_target.cc.

Referenced by flutter::EmbedderExternalView::Render().

33  {
34  return render_surface_;
35 }

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