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>
Classes | |
| struct | SetCurrentResult |
Public Types | |
| using | MakeOrClearCurrentCallback = std::function< SetCurrentResult()> |
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< SkSurface > | GetSkiaSurface () const =0 |
| A render surface the rasterizer can use to draw into the backing store of this render target. | |
| virtual impeller::RenderTarget * | GetImpellerRenderTarget () const =0 |
| An impeller render target the rasterizer can use to draw into the backing store. | |
| virtual std::shared_ptr< impeller::AiksContext > | GetAiksContext () const =0 |
| Returns the AiksContext that should be used for rendering, if this render target is backed by Impeller. | |
| virtual DlISize | GetRenderTargetSize () const =0 |
| Returns the size of the render target. | |
| const FlutterBackingStore * | 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. | |
| virtual SetCurrentResult | MaybeMakeCurrent () const |
| Make the render target current. | |
| virtual SetCurrentResult | MaybeClearCurrent () const |
| Clear the current render target. | |
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. | |
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.
| using flutter::EmbedderRenderTarget::MakeOrClearCurrentCallback = std::function<SetCurrentResult()> |
Definition at line 42 of file embedder_render_target.h.
|
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.
|
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.
| [in] | backing_store | The backing store describing this render target. |
| [in] | on_release | The 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.
References FlutterBackingStore::did_update.
|
pure virtual |
Returns the AiksContext that should be used for rendering, if this render target is backed by Impeller.
Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.
Referenced by flutter::EmbedderExternalView::Render().
| 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.
Definition at line 26 of file embedder_render_target.cc.
|
pure virtual |
An impeller render target the rasterizer can use to draw into the backing store.
Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.
Referenced by flutter::EmbedderExternalView::Render().
|
pure virtual |
Returns the size of the render target.
Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.
Referenced by flutter::EmbedderExternalView::Render().
|
pure virtual |
A render surface the rasterizer can use to draw into the backing store of this render target.
Implemented in flutter::EmbedderRenderTargetImpeller, and flutter::EmbedderRenderTargetSkia.
Referenced by flutter::EmbedderExternalView::Render().
|
inlinevirtual |
Clear the current render target.
Reimplemented in flutter::EmbedderRenderTargetSkia.
Definition at line 110 of file embedder_render_target.h.
Referenced by flutter::EmbedderExternalView::Render().
|
inlinevirtual |
Make the render target current.
Sometimes render targets are actually (for example)
EGL surfaces instead of framebuffers or textures.
In that case, we can't fully wrap them as SkSurfaces, instead,
the embedder will provide a callback that should be called
when the target surface should be made current.
Reimplemented in flutter::EmbedderRenderTargetSkia.
Definition at line 104 of file embedder_render_target.h.
Referenced by flutter::EmbedderExternalView::Render().