Flutter Engine
The Flutter Engine
|
Holds state that is shared across Android surfaces. More...
#include <android_context.h>
Public Member Functions | |
AndroidContext (AndroidRenderingAPI rendering_api) | |
virtual | ~AndroidContext () |
AndroidRenderingAPI | RenderingApi () const |
virtual bool | IsValid () const |
void | SetMainSkiaContext (const sk_sp< GrDirectContext > &main_context) |
Setter for the Skia context to be used by subsequent AndroidSurfaces. More... | |
sk_sp< GrDirectContext > | GetMainSkiaContext () const |
Accessor for the Skia context associated with AndroidSurfaces and the raster thread. More... | |
std::shared_ptr< impeller::Context > | GetImpellerContext () const |
Accessor for the Impeller context associated with AndroidSurfaces and the raster thread. More... | |
Protected Member Functions | |
void | SetImpellerContext (const std::shared_ptr< impeller::Context > &context) |
Holds state that is shared across Android surfaces.
Definition at line 19 of file android_context.h.
|
explicit |
Definition at line 9 of file android_context.cc.
|
virtual |
Definition at line 12 of file android_context.cc.
std::shared_ptr< impeller::Context > flutter::AndroidContext::GetImpellerContext | ( | ) | const |
Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.
Definition at line 38 of file android_context.cc.
sk_sp< GrDirectContext > flutter::AndroidContext::GetMainSkiaContext | ( | ) | const |
Accessor for the Skia context associated with AndroidSurfaces and the raster thread.
This context is created lazily by the AndroidSurface based on their respective rendering backend and set on this AndroidContext to share via SetMainSkiaContext.
nullptr
when no Skia context has been set yet by its AndroidSurface via SetMainSkiaContext. Definition at line 34 of file android_context.cc.
|
virtual |
Reimplemented in flutter::AndroidContextGLImpeller, flutter::AndroidContextGLSkia, and flutter::AndroidContextVulkanImpeller.
Definition at line 25 of file android_context.cc.
AndroidRenderingAPI flutter::AndroidContext::RenderingApi | ( | ) | const |
Definition at line 21 of file android_context.cc.
|
protected |
Intended to be called from a subclass constructor after setup work for the context has completed.
Definition at line 42 of file android_context.cc.
void flutter::AndroidContext::SetMainSkiaContext | ( | const sk_sp< GrDirectContext > & | main_context | ) |
Setter for the Skia context to be used by subsequent AndroidSurfaces.
This is useful to reduce memory consumption when creating multiple AndroidSurfaces for the same AndroidContext.
The first AndroidSurface should set this for the AndroidContext if the AndroidContext does not yet have a Skia context to share via GetMainSkiaContext.
Definition at line 29 of file android_context.cc.