Flutter Engine
flutter::EmbedderExternalViewEmbedder Class Referencefinal

The external view embedder used by the generic embedder API. This class acts a proxy between the rasterizer and the embedder when the rasterizer is rendering into multiple layers. It asks the embedder for the render targets for the various layers the rasterizer is rendering into, recycles the render targets as necessary and converts rasterizer specific metadata into an embedder friendly format so that it can present the layers on-screen. More...

#include <embedder_external_view_embedder.h>

Inheritance diagram for flutter::EmbedderExternalViewEmbedder:
flutter::ExternalViewEmbedder

Public Types

using CreateRenderTargetCallback = std::function< std::unique_ptr< EmbedderRenderTarget >(GrDirectContext *context, const FlutterBackingStoreConfig &config)>
 
using PresentCallback = std::function< bool(const std::vector< const FlutterLayer * > &layers)>
 
using SurfaceTransformationCallback = std::function< SkMatrix(void)>
 

Public Member Functions

 EmbedderExternalViewEmbedder (bool avoid_backing_store_cache, const CreateRenderTargetCallback &create_render_target_callback, const PresentCallback &present_callback)
 Creates an external view embedder used by the generic embedder API. More...
 
 ~EmbedderExternalViewEmbedder () override
 Collects the external view embedder. More...
 
void SetSurfaceTransformationCallback (SurfaceTransformationCallback surface_transformation_callback)
 Sets the surface transformation callback used by the external view embedder to ask the platform for the per frame root surface transformation. More...
 
- Public Member Functions inherited from flutter::ExternalViewEmbedder
 ExternalViewEmbedder ()=default
 
virtual ~ExternalViewEmbedder ()=default
 
virtual PostPrerollResult PostPrerollAction (fml::RefPtr< fml::RasterThreadMerger > raster_thread_merger)
 
virtual void EndFrame (bool should_resubmit_frame, fml::RefPtr< fml::RasterThreadMerger > raster_thread_merger)
 
virtual bool SupportsDynamicThreadMerging ()
 
virtual void Teardown ()
 
 FML_DISALLOW_COPY_AND_ASSIGN (ExternalViewEmbedder)
 

Detailed Description

The external view embedder used by the generic embedder API. This class acts a proxy between the rasterizer and the embedder when the rasterizer is rendering into multiple layers. It asks the embedder for the render targets for the various layers the rasterizer is rendering into, recycles the render targets as necessary and converts rasterizer specific metadata into an embedder friendly format so that it can present the layers on-screen.

Definition at line 29 of file embedder_external_view_embedder.h.

Member Typedef Documentation

◆ CreateRenderTargetCallback

◆ PresentCallback

using flutter::EmbedderExternalViewEmbedder::PresentCallback = std::function<bool(const std::vector<const FlutterLayer*>& layers)>

Definition at line 36 of file embedder_external_view_embedder.h.

◆ SurfaceTransformationCallback

Constructor & Destructor Documentation

◆ EmbedderExternalViewEmbedder()

flutter::EmbedderExternalViewEmbedder::EmbedderExternalViewEmbedder ( bool  avoid_backing_store_cache,
const CreateRenderTargetCallback create_render_target_callback,
const PresentCallback present_callback 
)

Creates an external view embedder used by the generic embedder API.

Parameters
[in]avoid_backing_store_cacheIf set, create_render_target callback will beinvoked every frame for every engine composited layer. The result will not cached.
[in]create_render_target_callbackThe render target callback used to request the render target for a layer.
[in]present_callbackThe callback used to forward a collection of layers (backed by fulfilled render targets) to the embedder for presentation.

Definition at line 15 of file embedder_external_view_embedder.cc.

References FML_DCHECK, and ~EmbedderExternalViewEmbedder().

19  : avoid_backing_store_cache_(avoid_backing_store_cache),
20  create_render_target_callback_(create_render_target_callback),
21  present_callback_(present_callback) {
22  FML_DCHECK(create_render_target_callback_);
23  FML_DCHECK(present_callback_);
24 }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ ~EmbedderExternalViewEmbedder()

flutter::EmbedderExternalViewEmbedder::~EmbedderExternalViewEmbedder ( )
overridedefault

Collects the external view embedder.

Referenced by EmbedderExternalViewEmbedder().

Member Function Documentation

◆ SetSurfaceTransformationCallback()

void flutter::EmbedderExternalViewEmbedder::SetSurfaceTransformationCallback ( SurfaceTransformationCallback  surface_transformation_callback)

Sets the surface transformation callback used by the external view embedder to ask the platform for the per frame root surface transformation.

Parameters
[in]surface_transformation_callbackThe surface transformation callback

Definition at line 28 of file embedder_external_view_embedder.cc.

References FML_DCHECK, FML_DLOG, and view.

29  {
30  surface_transformation_callback_ = surface_transformation_callback;
31 }

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