7 #include "flutter/fml/trace_event.h"
20 return parent_->GetBackendType();
24 return parent_->DescribeGpuModel();
28 return parent_->IsValid();
32 return parent_->GetResourceAllocator();
36 return parent_->GetShaderLibrary();
40 return parent_->GetSamplerLibrary();
44 return parent_->GetPipelineLibrary();
48 return parent_->CreateCommandBuffer();
53 return parent_->GetCapabilities();
66 swapchain_ = std::move(swapchain);
71 TRACE_EVENT0(
"impeller", __FUNCTION__);
72 auto surface = swapchain_ ? swapchain_->AcquireNextDrawable() :
nullptr;
76 if (
auto pipeline_library = parent_->GetPipelineLibrary()) {
80 if (
auto allocator = parent_->GetResourceAllocator()) {
81 allocator->DidAcquireSurfaceFrame();
83 parent_->GetCommandPoolRecycler()->Dispose();
88 parent_->SetSyncPresentation(value);
93 vk::UniqueSurfaceKHR SurfaceContextVK::CreateAndroidSurface(
94 ANativeWindow* window)
const {
95 if (!parent_->GetInstance()) {
96 return vk::UniqueSurfaceKHR{VK_NULL_HANDLE};
99 auto create_info = vk::AndroidSurfaceCreateInfoKHR().setWindow(window);
101 parent_->GetInstance().createAndroidSurfaceKHRUnique(create_info);
103 if (surface_res.result != vk::Result::eSuccess) {
105 << vk::to_string(surface_res.result);
106 return vk::UniqueSurfaceKHR{VK_NULL_HANDLE};
109 return std::move(surface_res.value);
112 #endif // FML_OS_ANDROID