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

150 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 176 of file android_context_dynamic_impeller.cc.

176 {
177 return gl_context_;
178}

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

165 {
166 if (vk_context_) {
167 return vk_context_->GetImpellerContext();
168 }
169 if (gl_context_) {
170 return gl_context_->GetImpellerContext();
171 }
172 return nullptr;
173}

◆ GetVKContext()

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

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

Definition at line 181 of file android_context_dynamic_impeller.cc.

181 {
182 return vk_context_;
183}

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

185 {
186 if (vk_context_ || gl_context_) {
187 return;
188 }
189 vk_context_ = GetActualRenderingAPIForImpeller(android_get_device_api_level(),
190 settings_);
191 if (!vk_context_) {
192 gl_context_ = std::make_shared<AndroidContextGLImpeller>(
193 std::make_unique<impeller::egl::Display>(),
194 settings_.enable_gpu_tracing);
195 }
196}

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


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