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, std::shared_ptr< fml::BasicTaskRunner > io_task_runner)
 
 ~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,
std::shared_ptr< fml::BasicTaskRunner io_task_runner 
)
explicit

Definition at line 142 of file android_context_dynamic_impeller.cc.

146 settings_(settings),
147 io_task_runner_(std::move(io_task_runner)) {}
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 173 of file android_context_dynamic_impeller.cc.

173 {
174 return gl_context_;
175}

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

162 {
163 if (vk_context_) {
164 return vk_context_->GetImpellerContext();
165 }
166 if (gl_context_) {
167 return gl_context_->GetImpellerContext();
168 }
169 return nullptr;
170}

◆ GetVKContext()

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

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

Definition at line 178 of file android_context_dynamic_impeller.cc.

178 {
179 return vk_context_;
180}

◆ IsDynamicSelection()

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

Reimplemented from flutter::AndroidContext.

Definition at line 35 of file android_context_dynamic_impeller.h.

35{ return true; }

◆ IsValid()

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

Reimplemented from flutter::AndroidContext.

Definition at line 32 of file android_context_dynamic_impeller.h.

32{ 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 182 of file android_context_dynamic_impeller.cc.

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

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


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