Flutter Engine
 
Loading...
Searching...
No Matches
flutter::AndroidContextDynamicImpeller Class Reference

An Impeller Android context that dynamically creates either an [AndroidContextGLImpeller] or an [AndroidContextVKImpeller]. More...

#include <android_context_dynamic_impeller.h>

Inheritance diagram for flutter::AndroidContextDynamicImpeller:
flutter::AndroidContext

Public Member Functions

 AndroidContextDynamicImpeller (const AndroidContext::ContextSettings &settings)
 
 ~AndroidContextDynamicImpeller ()
 
bool IsValid () const override
 
bool IsDynamicSelection () const override
 
AndroidRenderingAPI RenderingApi () const override
 
std::shared_ptr< AndroidContextGLImpellerGetGLContext () const
 Retrieve the GL Context if it was created, or nullptr.
 
std::shared_ptr< AndroidContextVKImpellerGetVKContext () const
 Retrieve the VK context if it was created, or nullptr.
 
void SetupImpellerContext () override
 Perform deferred setup for the impeller Context.
 
std::shared_ptr< impeller::ContextGetImpellerContext () const override
 Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.
 
- Public Member Functions inherited from flutter::AndroidContext
 AndroidContext (AndroidRenderingAPI rendering_api)
 
virtual ~AndroidContext ()
 
void SetMainSkiaContext (const sk_sp< GrDirectContext > &main_context)
 Setter for the Skia context to be used by subsequent AndroidSurfaces.
 
sk_sp< GrDirectContext > GetMainSkiaContext () const
 Accessor for the Skia context associated with AndroidSurfaces and the raster thread.
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::AndroidContext
void SetImpellerContext (const std::shared_ptr< impeller::Context > &impeller_context)
 

Detailed Description

An Impeller Android context that dynamically creates either an [AndroidContextGLImpeller] or an [AndroidContextVKImpeller].

The construction of these objects is deferred until [GetImpellerContext] is invoked. Up to this point, the reported backend will be kImpellerAutoselect.

Definition at line 23 of file android_context_dynamic_impeller.h.

Constructor & Destructor Documentation

◆ AndroidContextDynamicImpeller()

flutter::AndroidContextDynamicImpeller::AndroidContextDynamicImpeller ( const AndroidContext::ContextSettings settings)
explicit

Definition at line 141 of file android_context_dynamic_impeller.cc.

144 settings_(settings) {}
AndroidContext(AndroidRenderingAPI rendering_api)

◆ ~AndroidContextDynamicImpeller()

flutter::AndroidContextDynamicImpeller::~AndroidContextDynamicImpeller ( )
default

Member Function Documentation

◆ GetGLContext()

std::shared_ptr< AndroidContextGLImpeller > flutter::AndroidContextDynamicImpeller::GetGLContext ( ) const

Retrieve the GL Context if it was created, or nullptr.

Definition at line 170 of file android_context_dynamic_impeller.cc.

170 {
171 return gl_context_;
172}

◆ GetImpellerContext()

std::shared_ptr< impeller::Context > flutter::AndroidContextDynamicImpeller::GetImpellerContext ( ) const
overridevirtual

Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.

Reimplemented from flutter::AndroidContext.

Definition at line 159 of file android_context_dynamic_impeller.cc.

159 {
160 if (vk_context_) {
161 return vk_context_->GetImpellerContext();
162 }
163 if (gl_context_) {
164 return gl_context_->GetImpellerContext();
165 }
166 return nullptr;
167}

◆ GetVKContext()

std::shared_ptr< AndroidContextVKImpeller > flutter::AndroidContextDynamicImpeller::GetVKContext ( ) const

Retrieve the VK context if it was created, or nullptr.

Definition at line 175 of file android_context_dynamic_impeller.cc.

175 {
176 return vk_context_;
177}

◆ IsDynamicSelection()

bool flutter::AndroidContextDynamicImpeller::IsDynamicSelection ( ) const
inlineoverridevirtual

Reimplemented from flutter::AndroidContext.

Definition at line 34 of file android_context_dynamic_impeller.h.

34{ return true; }

◆ IsValid()

bool flutter::AndroidContextDynamicImpeller::IsValid ( ) const
inlineoverridevirtual

Reimplemented from flutter::AndroidContext.

Definition at line 31 of file android_context_dynamic_impeller.h.

31{ return true; }

◆ RenderingApi()

AndroidRenderingAPI flutter::AndroidContextDynamicImpeller::RenderingApi ( ) const
overridevirtual

◆ SetupImpellerContext()

void flutter::AndroidContextDynamicImpeller::SetupImpellerContext ( )
overridevirtual

Perform deferred setup for the impeller Context.

Reimplemented from flutter::AndroidContext.

Definition at line 179 of file android_context_dynamic_impeller.cc.

179 {
180 if (vk_context_ || gl_context_) {
181 return;
182 }
183 vk_context_ = GetActualRenderingAPIForImpeller(android_get_device_api_level(),
184 settings_);
185 if (!vk_context_) {
186 gl_context_ = std::make_shared<AndroidContextGLImpeller>(
187 std::make_unique<impeller::egl::Display>(),
188 settings_.enable_gpu_tracing);
189 }
190}

References flutter::AndroidContext::ContextSettings::enable_gpu_tracing.


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