7 #include "flutter/fml/trace_event.h"
15 #endif // FML_OS_ANDROID
20 const std::shared_ptr<Context>& context,
21 vk::UniqueSurfaceKHR surface,
24 auto swapchain = std::shared_ptr<KHRSwapchainVK>(
25 new KHRSwapchainVK(context, std::move(surface), size, enable_msaa));
26 if (!swapchain->IsValid()) {
35 const std::shared_ptr<Context>& context,
36 ANativeWindow* p_window,
38 TRACE_EVENT0(
"impeller",
"CreateAndroidSwapchain");
43 android::NativeWindow window(p_window);
44 if (!window.IsValid()) {
48 vk::AndroidSurfaceCreateInfoKHR surface_info;
49 surface_info.setWindow(window.GetHandle());
50 auto [result, surface] =
53 if (result != vk::Result::eSuccess) {
55 << vk::to_string(result);
59 return Create(context, std::move(surface), window.GetSize(), enable_msaa);
61 #endif // FML_OS_ANDROID