Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::AndroidSurfaceVulkanImpeller Class Reference

#include <android_surface_vulkan_impeller.h>

Inheritance diagram for flutter::AndroidSurfaceVulkanImpeller:
flutter::AndroidSurface

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file android_surface_vulkan_impeller.h.

Constructor & Destructor Documentation

◆ AndroidSurfaceVulkanImpeller()

flutter::AndroidSurfaceVulkanImpeller::AndroidSurfaceVulkanImpeller ( const std::shared_ptr< AndroidContextVulkanImpeller > &  android_context)
explicit

Definition at line 19 of file android_surface_vulkan_impeller.cc.

20 {
21 is_valid_ = android_context->IsValid();
22
23 auto& context_vk =
24 impeller::ContextVK::Cast(*android_context->GetImpellerContext());
25 surface_context_vk_ = context_vk.CreateSurfaceContext();
26}
static ContextVK & Cast(Context &base)

◆ ~AndroidSurfaceVulkanImpeller()

flutter::AndroidSurfaceVulkanImpeller::~AndroidSurfaceVulkanImpeller ( )
overridedefault

Member Function Documentation

◆ CreateGPUSurface()

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

Implements flutter::AndroidSurface.

Definition at line 38 of file android_surface_vulkan_impeller.cc.

39 {
40 if (!IsValid()) {
41 return nullptr;
42 }
43
44 if (!native_window_ || !native_window_->IsValid()) {
45 return nullptr;
46 }
47
48 std::unique_ptr<GPUSurfaceVulkanImpeller> gpu_surface =
49 std::make_unique<GPUSurfaceVulkanImpeller>(surface_context_vk_);
50
51 if (!gpu_surface->IsValid()) {
52 return nullptr;
53 }
54
55 return gpu_surface;
56}

◆ GetImpellerContext()

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

Reimplemented from flutter::AndroidSurface.

Definition at line 94 of file android_surface_vulkan_impeller.cc.

94 {
95 return surface_context_vk_;
96}

◆ IsValid()

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

Implements flutter::AndroidSurface.

Definition at line 30 of file android_surface_vulkan_impeller.cc.

30 {
31 return is_valid_;
32}

◆ OnScreenSurfaceResize()

bool flutter::AndroidSurfaceVulkanImpeller::OnScreenSurfaceResize ( const SkISize size)
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 58 of file android_surface_vulkan_impeller.cc.

58 {
59 surface_context_vk_->UpdateSurfaceSize(
60 impeller::ISize{size.width(), size.height()});
61 return true;
62}
it will be possible to load the file into Perfetto s trace viewer 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
Definition switches.h:259
Type width
Definition size.h:22

◆ ResourceContextClearCurrent()

bool flutter::AndroidSurfaceVulkanImpeller::ResourceContextClearCurrent ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 68 of file android_surface_vulkan_impeller.cc.

68 {
69 return true;
70}

◆ ResourceContextMakeCurrent()

bool flutter::AndroidSurfaceVulkanImpeller::ResourceContextMakeCurrent ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 64 of file android_surface_vulkan_impeller.cc.

64 {
65 return true;
66}

◆ SetNativeWindow()

bool flutter::AndroidSurfaceVulkanImpeller::SetNativeWindow ( fml::RefPtr< AndroidNativeWindow window)
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 72 of file android_surface_vulkan_impeller.cc.

73 {
74 native_window_ = std::move(window);
75 bool success = native_window_ && native_window_->IsValid();
76 if (success) {
77 auto surface =
78 surface_context_vk_->CreateAndroidSurface(native_window_->handle());
79
80 if (!surface) {
81 FML_LOG(ERROR) << "Could not create a vulkan surface.";
82 return false;
83 }
84 auto size = native_window_->GetSize();
85 return surface_context_vk_->SetWindowSurface(
86 std::move(surface), impeller::ISize{size.width(), size.height()});
87 }
88
89 native_window_ = nullptr;
90 return false;
91}
GLFWwindow * window
Definition main.cc:45
VkSurfaceKHR surface
Definition main.cc:49
#define FML_LOG(severity)
Definition logging.h:82
#define ERROR(message)

◆ TeardownOnScreenContext()

void flutter::AndroidSurfaceVulkanImpeller::TeardownOnScreenContext ( )
overridevirtual

Implements flutter::AndroidSurface.

Definition at line 34 of file android_surface_vulkan_impeller.cc.

34 {
35 // Nothing to do.
36}

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