7 #include "flutter/fml/trace_event.h"
14 #endif // FML_OS_ANDROID
19 const std::shared_ptr<Context>& context,
20 vk::UniqueSurfaceKHR surface,
23 auto swapchain = std::shared_ptr<KHRSwapchainVK>(
24 new KHRSwapchainVK(context, std::move(surface), size, enable_msaa));
25 if (!swapchain->IsValid()) {
34 const std::shared_ptr<Context>& context,
35 ANativeWindow* p_window,
37 TRACE_EVENT0(
"impeller",
"CreateAndroidSwapchain");
42 android::NativeWindow window(p_window);
43 if (!window.IsValid()) {
47 vk::AndroidSurfaceCreateInfoKHR surface_info;
48 surface_info.setWindow(window.GetHandle());
49 auto [result, surface] =
52 if (result != vk::Result::eSuccess) {
54 << vk::to_string(result);
60 if constexpr (
false) {
67 auto ahb_swapchain = std::shared_ptr<AHBSwapchainVK>(
new AHBSwapchainVK(
75 if (ahb_swapchain->IsValid()) {
79 <<
"Could not create AHB swapchain. Falling back to KHR variant.";
85 return Create(context, std::move(surface), window.GetSize(), enable_msaa);
87 #endif // FML_OS_ANDROID