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 if (!swapchain->IsValid()) {
70 swapchain_ = std::move(swapchain);
75 TRACE_EVENT0(
"impeller", __FUNCTION__);
76 auto surface = swapchain_ ? swapchain_->AcquireNextDrawable() :
nullptr;
80 if (
auto pipeline_library = parent_->GetPipelineLibrary()) {
84 if (
auto allocator = parent_->GetResourceAllocator()) {
85 allocator->DidAcquireSurfaceFrame();
87 parent_->GetCommandPoolRecycler()->Dispose();
92 parent_->SetSyncPresentation(value);
97 vk::UniqueSurfaceKHR SurfaceContextVK::CreateAndroidSurface(
98 ANativeWindow* window)
const {
99 if (!parent_->GetInstance()) {
100 return vk::UniqueSurfaceKHR{VK_NULL_HANDLE};
103 auto create_info = vk::AndroidSurfaceCreateInfoKHR().setWindow(window);
105 parent_->GetInstance().createAndroidSurfaceKHRUnique(create_info);
107 if (surface_res.result != vk::Result::eSuccess) {
109 << vk::to_string(surface_res.result);
110 return vk::UniqueSurfaceKHR{VK_NULL_HANDLE};
113 return std::move(surface_res.value);
116 #endif // FML_OS_ANDROID