// 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_context.h" #include "flutter/shell/platform/android/android_context_gl.h" #include "flutter/shell/platform/android/android_environment_gl.h" namespace flutter { std::shared_ptr CreateContextGL() { auto context_gl = std::make_shared( AndroidRenderingAPI::kOpenGLES, fml::MakeRefCounted()); FML_CHECK(context_gl->IsValid()) << "Could not create an Android context GL."; return context_gl; } AndroidContext::AndroidContext(AndroidRenderingAPI rendering_api) : rendering_api_(rendering_api) {} AndroidContext::~AndroidContext() = default; AndroidRenderingAPI AndroidContext::RenderingApi() const { return rendering_api_; } std::shared_ptr AndroidContext::Create( AndroidRenderingAPI rendering_api) { if (rendering_api == AndroidRenderingAPI::kOpenGLES) { return CreateContextGL(); } return std::make_shared(rendering_api); } } // namespace flutter