Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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 140 of file android_context_dynamic_impeller.cc.

143 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 169 of file android_context_dynamic_impeller.cc.

169 {
170 return gl_context_;
171}

◆ 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 158 of file android_context_dynamic_impeller.cc.

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

◆ GetVKContext()

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

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

Definition at line 174 of file android_context_dynamic_impeller.cc.

174 {
175 return vk_context_;
176}

◆ 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 178 of file android_context_dynamic_impeller.cc.

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

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


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