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

An Impeller Android surface class that dynamically creates either an [AndroidSurfaceVKImpeller] or an [AndroidSurfaceGLImpeller]. More...

#include <android_surface_dynamic_impeller.h>

Inheritance diagram for flutter::AndroidSurfaceDynamicImpeller:
flutter::AndroidSurface

Public Member Functions

 AndroidSurfaceDynamicImpeller (std::shared_ptr< AndroidContextDynamicImpeller > &android_context)
 
 ~AndroidSurfaceDynamicImpeller () override
 
bool IsValid () const override
 
std::unique_ptr< SurfaceCreateGPUSurface (GrDirectContext *gr_context) override
 
void TeardownOnScreenContext () override
 
bool OnScreenSurfaceResize (const DlISize &size) override
 
bool ResourceContextMakeCurrent () override
 
bool ResourceContextClearCurrent () override
 
std::shared_ptr< impeller::ContextGetImpellerContext () override
 
bool SetNativeWindow (fml::RefPtr< AndroidNativeWindow > window, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade) override
 
std::unique_ptr< SurfaceCreateSnapshotSurface () override
 
void SetupImpellerSurface () override
 
- Public Member Functions inherited from flutter::AndroidSurface
virtual ~AndroidSurface ()
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::AndroidSurface
 AndroidSurface ()
 

Detailed Description

An Impeller Android surface class that dynamically creates either an [AndroidSurfaceVKImpeller] or an [AndroidSurfaceGLImpeller].

The backing surface is created the first time [CreateGPUSurface] is called.

Definition at line 26 of file android_surface_dynamic_impeller.h.

Constructor & Destructor Documentation

◆ AndroidSurfaceDynamicImpeller()

flutter::AndroidSurfaceDynamicImpeller::AndroidSurfaceDynamicImpeller ( std::shared_ptr< AndroidContextDynamicImpeller > &  android_context)
explicit

Definition at line 13 of file android_surface_dynamic_impeller.cc.

15 : android_context_(android_context) {}

◆ ~AndroidSurfaceDynamicImpeller()

flutter::AndroidSurfaceDynamicImpeller::~AndroidSurfaceDynamicImpeller ( )
overridedefault

Member Function Documentation

◆ CreateGPUSurface()

std::unique_ptr< Surface > flutter::AndroidSurfaceDynamicImpeller::CreateGPUSurface ( GrDirectContext *  gr_context)
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 31 of file android_surface_dynamic_impeller.cc.

32 {
33 if (vulkan_surface_) {
34 if (window_) {
35 vulkan_surface_->SetNativeWindow(window_, jni_facade_);
36 }
37 return vulkan_surface_->CreateGPUSurface(gr_context);
38 }
39 if (gl_surface_) {
40 if (window_) {
41 gl_surface_->SetNativeWindow(window_, jni_facade_);
42 }
43 return gl_surface_->CreateGPUSurface(gr_context);
44 }
45 return nullptr;
46}

◆ CreateSnapshotSurface()

std::unique_ptr< Surface > flutter::AndroidSurfaceDynamicImpeller::CreateSnapshotSurface ( )
overridevirtual

Reimplemented from flutter::AndroidSurface.

Definition at line 106 of file android_surface_dynamic_impeller.cc.

106 {
107 if (vulkan_surface_) {
108 return vulkan_surface_->CreateSnapshotSurface();
109 }
110 if (gl_surface_) {
111 return gl_surface_->CreateSnapshotSurface();
112 }
113 return nullptr;
114}

◆ GetImpellerContext()

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

Reimplemented from flutter::AndroidSurface.

Definition at line 117 of file android_surface_dynamic_impeller.cc.

117 {
118 return android_context_->GetImpellerContext();
119}

◆ IsValid()

bool flutter::AndroidSurfaceDynamicImpeller::IsValid ( ) const
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 19 of file android_surface_dynamic_impeller.cc.

19 {
20 return true;
21}

◆ OnScreenSurfaceResize()

bool flutter::AndroidSurfaceDynamicImpeller::OnScreenSurfaceResize ( const DlISize size)
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 61 of file android_surface_dynamic_impeller.cc.

61 {
62 if (vulkan_surface_) {
63 return vulkan_surface_->OnScreenSurfaceResize(size);
64 }
65 if (gl_surface_) {
66 return gl_surface_->OnScreenSurfaceResize(size);
67 }
68 return false;
69}
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size

References flutter::size.

◆ ResourceContextClearCurrent()

bool flutter::AndroidSurfaceDynamicImpeller::ResourceContextClearCurrent ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 81 of file android_surface_dynamic_impeller.cc.

81 {
82 if (vulkan_surface_) {
83 return vulkan_surface_->ResourceContextClearCurrent();
84 }
85 if (gl_surface_) {
86 return gl_surface_->ResourceContextClearCurrent();
87 }
88 return false;
89}

◆ ResourceContextMakeCurrent()

bool flutter::AndroidSurfaceDynamicImpeller::ResourceContextMakeCurrent ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 71 of file android_surface_dynamic_impeller.cc.

71 {
72 if (vulkan_surface_) {
73 return vulkan_surface_->ResourceContextMakeCurrent();
74 }
75 if (gl_surface_) {
76 return gl_surface_->ResourceContextMakeCurrent();
77 }
78 return false;
79}

◆ SetNativeWindow()

bool flutter::AndroidSurfaceDynamicImpeller::SetNativeWindow ( fml::RefPtr< AndroidNativeWindow window,
const std::shared_ptr< PlatformViewAndroidJNI > &  jni_facade 
)
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 91 of file android_surface_dynamic_impeller.cc.

93 {
94 if (vulkan_surface_) {
95 return vulkan_surface_->SetNativeWindow(window, jni_facade);
96 }
97 if (gl_surface_) {
98 return gl_surface_->SetNativeWindow(window, jni_facade);
99 }
100 window_ = window;
101 jni_facade_ = jni_facade;
102 return true;
103}
GLFWwindow * window
Definition main.cc:60

References window.

◆ SetupImpellerSurface()

void flutter::AndroidSurfaceDynamicImpeller::SetupImpellerSurface ( )
overridevirtual

Reimplemented from flutter::AndroidSurface.

Definition at line 48 of file android_surface_dynamic_impeller.cc.

48 {
49 AndroidRenderingAPI api = android_context_->RenderingApi();
51 vulkan_surface_ = std::make_unique<AndroidSurfaceVKImpeller>(
52 android_context_->GetVKContext());
54 gl_surface_ = std::make_unique<AndroidSurfaceGLImpeller>(
55 android_context_->GetGLContext());
56 } else {
58 }
59}
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE, flutter::kImpellerOpenGLES, and flutter::kImpellerVulkan.

◆ TeardownOnScreenContext()

void flutter::AndroidSurfaceDynamicImpeller::TeardownOnScreenContext ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 23 of file android_surface_dynamic_impeller.cc.

23 {
24 if (vulkan_surface_) {
25 vulkan_surface_->TeardownOnScreenContext();
26 } else if (gl_surface_) {
27 gl_surface_->TeardownOnScreenContext();
28 }
29}

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