// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface.h" #include #include "flutter/shell/platform/android/android_surface_gl.h" #include "flutter/shell/platform/android/android_surface_software.h" #if SHELL_ENABLE_VULKAN #include "flutter/shell/platform/android/android_surface_vulkan.h" #endif // SHELL_ENABLE_VULKAN namespace flutter { std::unique_ptr AndroidSurface::Create( std::shared_ptr android_context) { std::unique_ptr surface; switch (android_context->RenderingApi()) { case AndroidRenderingAPI::kSoftware: surface = std::make_unique(); break; case AndroidRenderingAPI::kOpenGLES: surface = std::make_unique(android_context); break; case AndroidRenderingAPI::kVulkan: #if SHELL_ENABLE_VULKAN surface = std::make_unique(); #endif // SHELL_ENABLE_VULKAN break; } FML_CHECK(surface); return surface->IsValid() ? std::move(surface) : nullptr; ; } AndroidSurface::~AndroidSurface() = default; } // namespace flutter