From 7535cb10bcd4565032f68e1b975875f7686a955e Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 24 Feb 2025 18:40:29 -0800 Subject: [PATCH] Move `AndroidRenderingApi` from `common` to `shell/platform/android` (#163796) Towards https://github.com/flutter/flutter/issues/163792. Major changes: - `enum class AndroidRenderingAPI` physically moves to `shell/platform/android` - Store in `FlutterMain` (as a result of `::init`), instead of in `Settings` --------- Co-authored-by: Jonah Williams --- .../ci/licenses_golden/licenses_flutter | 2 ++ engine/src/flutter/common/settings.h | 13 -------- .../android/android_context_vk_impeller.h | 1 - .../android/android_rendering_selector.h | 20 +++++++++++++ .../platform/android/android_shell_holder.cc | 30 ++++++++++--------- .../platform/android/android_shell_holder.h | 13 ++++---- .../android/android_shell_holder_unittests.cc | 12 +++++--- .../android/context/android_context.h | 3 +- .../shell/platform/android/flutter_main.cc | 22 +++++++------- .../shell/platform/android/flutter_main.h | 6 +++- .../android/jni/platform_view_android_jni.h | 2 -- .../platform/android/platform_view_android.cc | 7 ++--- .../platform/android/platform_view_android.h | 4 +-- .../android/platform_view_android_jni_impl.cc | 8 ++--- 14 files changed, 76 insertions(+), 67 deletions(-) create mode 100644 engine/src/flutter/shell/platform/android/android_rendering_selector.h diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 477559f727..ceddc67532 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -42960,6 +42960,7 @@ ORIGIN: ../../../flutter/shell/platform/android/android_environment_gl.h + ../.. ORIGIN: ../../../flutter/shell/platform/android/android_exports.lst + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_image_generator.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_image_generator.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/android_rendering_selector.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_shell_holder.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_shell_holder.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_surface_gl_impeller.cc + ../../../flutter/LICENSE @@ -45876,6 +45877,7 @@ FILE: ../../../flutter/shell/platform/android/android_environment_gl.h FILE: ../../../flutter/shell/platform/android/android_exports.lst FILE: ../../../flutter/shell/platform/android/android_image_generator.cc FILE: ../../../flutter/shell/platform/android/android_image_generator.h +FILE: ../../../flutter/shell/platform/android/android_rendering_selector.h FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc FILE: ../../../flutter/shell/platform/android/android_shell_holder.h FILE: ../../../flutter/shell/platform/android/android_surface_gl_impeller.cc diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index 51e64016d5..b80fb59f22 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -7,7 +7,6 @@ #include -#include #include #include #include @@ -22,14 +21,6 @@ namespace flutter { -// The combination of targeted graphics API and Impeller support. -enum class AndroidRenderingAPI { - kSoftware, - kImpellerOpenGLES, - kImpellerVulkan, - kSkiaOpenGLES -}; - class FrameTiming { public: enum Phase { @@ -240,10 +231,6 @@ struct Settings { // Log a warning during shell initialization if Impeller is not enabled. bool warn_on_impeller_opt_out = false; - // The selected Android rendering API. - AndroidRenderingAPI android_rendering_api = - AndroidRenderingAPI::kSkiaOpenGLES; - // Requests a specific rendering backend. std::optional requested_rendering_backend; diff --git a/engine/src/flutter/shell/platform/android/android_context_vk_impeller.h b/engine/src/flutter/shell/platform/android/android_context_vk_impeller.h index 65b13d7056..5eb7b4ec6d 100644 --- a/engine/src/flutter/shell/platform/android/android_context_vk_impeller.h +++ b/engine/src/flutter/shell/platform/android/android_context_vk_impeller.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_VK_IMPELLER_H_ #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_VK_IMPELLER_H_ -#include "flutter/fml/concurrent_message_loop.h" #include "flutter/fml/macros.h" #include "flutter/fml/native_library.h" #include "flutter/shell/platform/android/context/android_context.h" diff --git a/engine/src/flutter/shell/platform/android/android_rendering_selector.h b/engine/src/flutter/shell/platform/android/android_rendering_selector.h new file mode 100644 index 0000000000..63220fb858 --- /dev/null +++ b/engine/src/flutter/shell/platform/android/android_rendering_selector.h @@ -0,0 +1,20 @@ +// 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. + +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_RENDERING_SELECTOR_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_RENDERING_SELECTOR_H_ + +namespace flutter { + +// The combination of targeted graphics API and Impeller support. +enum class AndroidRenderingAPI { + kSoftware, + kImpellerOpenGLES, + kImpellerVulkan, + kSkiaOpenGLES +}; + +} // namespace flutter + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_RENDERING_SELECTOR_H_ diff --git a/engine/src/flutter/shell/platform/android/android_shell_holder.cc b/engine/src/flutter/shell/platform/android/android_shell_holder.cc index 6fd4d87046..6fe15e673f 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder.cc +++ b/engine/src/flutter/shell/platform/android/android_shell_holder.cc @@ -4,31 +4,27 @@ #define FML_USED_ON_EMBEDDER -#include "flutter/shell/platform/android/android_shell_holder.h" - #include #include #include #include #include -#include #include #include #include "common/settings.h" #include "flutter/fml/cpu_affinity.h" #include "flutter/fml/logging.h" -#include "flutter/fml/make_copyable.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/native_library.h" -#include "flutter/fml/platform/android/jni_util.h" #include "flutter/lib/ui/painting/image_generator_registry.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/run_configuration.h" #include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/android/android_display.h" #include "flutter/shell/platform/android/android_image_generator.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" +#include "flutter/shell/platform/android/android_shell_holder.h" #include "flutter/shell/platform/android/context/android_context.h" #include "flutter/shell/platform/android/platform_view_android.h" @@ -85,8 +81,11 @@ static PlatformData GetDefaultPlatformData() { AndroidShellHolder::AndroidShellHolder( const flutter::Settings& settings, - std::shared_ptr jni_facade) - : settings_(settings), jni_facade_(jni_facade) { + std::shared_ptr jni_facade, + AndroidRenderingAPI android_rendering_api) + : settings_(settings), + jni_facade_(jni_facade), + android_rendering_api_(android_rendering_api) { static size_t thread_host_count = 1; auto thread_label = std::to_string(thread_host_count++); @@ -113,15 +112,15 @@ AndroidShellHolder::AndroidShellHolder( thread_host_ = std::make_shared(host_config); fml::WeakPtr weak_platform_view; + AndroidRenderingAPI rendering_api = android_rendering_api_; Shell::CreateCallback on_create_platform_view = - [&jni_facade, &weak_platform_view](Shell& shell) { + [&jni_facade, &weak_platform_view, rendering_api](Shell& shell) { std::unique_ptr platform_view_android; platform_view_android = std::make_unique( shell, // delegate shell.GetTaskRunners(), // task runners jni_facade, // JNI interop - shell.GetSettings() - .enable_software_rendering // use software rendering + rendering_api // rendering API ); weak_platform_view = platform_view_android->GetWeakPtr(); return platform_view_android; @@ -188,13 +187,15 @@ AndroidShellHolder::AndroidShellHolder( const std::shared_ptr& thread_host, std::unique_ptr shell, std::unique_ptr apk_asset_provider, - const fml::WeakPtr& platform_view) + const fml::WeakPtr& platform_view, + AndroidRenderingAPI rendering_api) : settings_(settings), jni_facade_(jni_facade), platform_view_(platform_view), thread_host_(thread_host), shell_(std::move(shell)), - apk_asset_provider_(std::move(apk_asset_provider)) { + apk_asset_provider_(std::move(apk_asset_provider)), + android_rendering_api_(rendering_api) { FML_DCHECK(jni_facade); FML_DCHECK(shell_); FML_DCHECK(shell_->IsSetup()); @@ -275,7 +276,8 @@ std::unique_ptr AndroidShellHolder::Spawn( return std::unique_ptr(new AndroidShellHolder( GetSettings(), jni_facade, thread_host_, std::move(shell), - apk_asset_provider_->Clone(), weak_platform_view)); + apk_asset_provider_->Clone(), weak_platform_view, + android_context->RenderingApi())); } void AndroidShellHolder::Launch( diff --git a/engine/src/flutter/shell/platform/android/android_shell_holder.h b/engine/src/flutter/shell/platform/android/android_shell_holder.h index b72ecec586..5894c0f966 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder.h +++ b/engine/src/flutter/shell/platform/android/android_shell_holder.h @@ -7,17 +7,13 @@ #include -#include "flutter/assets/asset_manager.h" #include "flutter/fml/macros.h" -#include "flutter/fml/unique_fd.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/platform_data.h" #include "flutter/shell/common/run_configuration.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" #include "flutter/shell/platform/android/apk_asset_provider.h" #include "flutter/shell/platform/android/jni/platform_view_android_jni.h" -#include "flutter/shell/platform/android/platform_message_handler_android.h" #include "flutter/shell/platform/android/platform_view_android.h" namespace flutter { @@ -42,7 +38,8 @@ namespace flutter { class AndroidShellHolder { public: AndroidShellHolder(const flutter::Settings& settings, - std::shared_ptr jni_facade); + std::shared_ptr jni_facade, + AndroidRenderingAPI android_rendering_api); ~AndroidShellHolder(); @@ -119,6 +116,7 @@ class AndroidShellHolder { bool is_valid_ = false; uint64_t next_pointer_flow_id_ = 0; std::unique_ptr apk_asset_provider_; + const AndroidRenderingAPI android_rendering_api_; //---------------------------------------------------------------------------- /// @brief Constructor with its components injected. @@ -136,7 +134,8 @@ class AndroidShellHolder { const std::shared_ptr& thread_host, std::unique_ptr shell, std::unique_ptr apk_asset_provider, - const fml::WeakPtr& platform_view); + const fml::WeakPtr& platform_view, + AndroidRenderingAPI rendering_api); static void ThreadDestructCallback(void* value); std::optional BuildRunConfiguration( const std::string& entrypoint, diff --git a/engine/src/flutter/shell/platform/android/android_shell_holder_unittests.cc b/engine/src/flutter/shell/platform/android/android_shell_holder_unittests.cc index cbd3cd27fc..1b324ffbb6 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder_unittests.cc +++ b/engine/src/flutter/shell/platform/android/android_shell_holder_unittests.cc @@ -145,7 +145,8 @@ TEST(AndroidShellHolder, Create) { Settings settings; settings.enable_software_rendering = false; auto jni = std::make_shared(); - auto holder = std::make_unique(settings, jni); + auto holder = std::make_unique( + settings, jni, AndroidRenderingAPI::kImpellerOpenGLES); EXPECT_NE(holder.get(), nullptr); EXPECT_TRUE(holder->IsValid()); EXPECT_NE(holder->GetPlatformView().get(), nullptr); @@ -158,7 +159,8 @@ TEST(AndroidShellHolder, HandlePlatformMessage) { Settings settings; settings.enable_software_rendering = false; auto jni = std::make_shared(); - auto holder = std::make_unique(settings, jni); + auto holder = std::make_unique( + settings, jni, AndroidRenderingAPI::kImpellerOpenGLES); EXPECT_NE(holder.get(), nullptr); EXPECT_TRUE(holder->IsValid()); EXPECT_NE(holder->GetPlatformView().get(), nullptr); @@ -186,7 +188,8 @@ TEST(AndroidShellHolder, HandlePlatformMessage) { TEST(AndroidShellHolder, CreateWithMergedPlatformAndUIThread) { Settings settings; auto jni = std::make_shared(); - auto holder = std::make_unique(settings, jni); + auto holder = std::make_unique( + settings, jni, AndroidRenderingAPI::kImpellerOpenGLES); auto window = fml::MakeRefCounted( nullptr, /*is_fake_window=*/true); holder->GetPlatformView()->NotifyCreated(window); @@ -200,7 +203,8 @@ TEST(AndroidShellHolder, CreateWithUnMergedPlatformAndUIThread) { Settings settings; settings.merged_platform_ui_thread = false; auto jni = std::make_shared(); - auto holder = std::make_unique(settings, jni); + auto holder = std::make_unique( + settings, jni, AndroidRenderingAPI::kImpellerOpenGLES); auto window = fml::MakeRefCounted( nullptr, /*is_fake_window=*/true); holder->GetPlatformView()->NotifyCreated(window); diff --git a/engine/src/flutter/shell/platform/android/context/android_context.h b/engine/src/flutter/shell/platform/android/context/android_context.h index 09c49d0d63..7eec67b421 100644 --- a/engine/src/flutter/shell/platform/android/context/android_context.h +++ b/engine/src/flutter/shell/platform/android/context/android_context.h @@ -5,10 +5,9 @@ #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_CONTEXT_ANDROID_CONTEXT_H_ #define FLUTTER_SHELL_PLATFORM_ANDROID_CONTEXT_ANDROID_CONTEXT_H_ -#include "common/settings.h" #include "flutter/fml/macros.h" -#include "flutter/fml/task_runner.h" #include "flutter/impeller/renderer/context.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" namespace flutter { diff --git a/engine/src/flutter/shell/platform/android/flutter_main.cc b/engine/src/flutter/shell/platform/android/flutter_main.cc index 3458175bfa..d255f4a766 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.cc +++ b/engine/src/flutter/shell/platform/android/flutter_main.cc @@ -15,22 +15,18 @@ #include "flutter/fml/command_line.h" #include "flutter/fml/file.h" #include "flutter/fml/logging.h" -#include "flutter/fml/macros.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/native_library.h" -#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/paths_android.h" #include "flutter/lib/ui/plugins/callback_cache.h" #include "flutter/runtime/dart_vm.h" -#include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/android/android_context_vk_impeller.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" #include "flutter/shell/platform/android/context/android_context.h" #include "flutter/shell/platform/android/flutter_main.h" #include "impeller/base/validation.h" #include "impeller/toolkit/android/proc_table.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" #include "txt/platform.h" namespace flutter { @@ -68,8 +64,9 @@ static constexpr const char* kBLC[] = { } // anonymous namespace -FlutterMain::FlutterMain(const flutter::Settings& settings) - : settings_(settings) {} +FlutterMain::FlutterMain(const flutter::Settings& settings, + flutter::AndroidRenderingAPI android_rendering_api) + : settings_(settings), android_rendering_api_(android_rendering_api) {} FlutterMain::~FlutterMain() = default; @@ -85,6 +82,10 @@ const flutter::Settings& FlutterMain::GetSettings() const { return settings_; } +flutter::AndroidRenderingAPI FlutterMain::GetAndroidRenderingAPI() { + return android_rendering_api_; +} + void FlutterMain::Init(JNIEnv* env, jclass clazz, jobject context, @@ -116,8 +117,8 @@ void FlutterMain::Init(JNIEnv* env, } } - settings.android_rendering_api = SelectedRenderingAPI(settings); - switch (settings.android_rendering_api) { + AndroidRenderingAPI android_rendering_api = SelectedRenderingAPI(settings); + switch (android_rendering_api) { case AndroidRenderingAPI::kSoftware: case AndroidRenderingAPI::kSkiaOpenGLES: settings.enable_impeller = false; @@ -187,8 +188,7 @@ void FlutterMain::Init(JNIEnv* env, // Not thread safe. Will be removed when FlutterMain is refactored to no // longer be a singleton. - g_flutter_main.reset(new FlutterMain(settings)); - + g_flutter_main.reset(new FlutterMain(settings, android_rendering_api)); g_flutter_main->SetupDartVMServiceUriCallback(env); } diff --git a/engine/src/flutter/shell/platform/android/flutter_main.h b/engine/src/flutter/shell/platform/android/flutter_main.h index 66af0012a0..f6e27bcdc9 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.h +++ b/engine/src/flutter/shell/platform/android/flutter_main.h @@ -10,6 +10,7 @@ #include "flutter/common/settings.h" #include "flutter/fml/macros.h" #include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" namespace flutter { @@ -22,6 +23,7 @@ class FlutterMain { static FlutterMain& Get(); const flutter::Settings& GetSettings() const; + flutter::AndroidRenderingAPI GetAndroidRenderingAPI(); static AndroidRenderingAPI SelectedRenderingAPI( const flutter::Settings& settings); @@ -32,9 +34,11 @@ class FlutterMain { private: const flutter::Settings settings_; + const flutter::AndroidRenderingAPI android_rendering_api_; DartServiceIsolate::CallbackHandle vm_service_uri_callback_ = 0; - explicit FlutterMain(const flutter::Settings& settings); + explicit FlutterMain(const flutter::Settings& settings, + flutter::AndroidRenderingAPI android_rendering_api); static void Init(JNIEnv* env, jclass clazz, diff --git a/engine/src/flutter/shell/platform/android/jni/platform_view_android_jni.h b/engine/src/flutter/shell/platform/android/jni/platform_view_android_jni.h index 4c78c044f3..1412cddad1 100644 --- a/engine/src/flutter/shell/platform/android/jni/platform_view_android_jni.h +++ b/engine/src/flutter/shell/platform/android/jni/platform_view_android_jni.h @@ -7,13 +7,11 @@ #include -#include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" #include "flutter/flow/embedded_views.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/android/surface/android_native_window.h" -#include "third_party/skia/include/core/SkMatrix.h" #if FML_OS_ANDROID #include "flutter/fml/platform/android/scoped_java_ref.h" diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index b170047f53..9114d568de 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -16,6 +16,7 @@ #include "flutter/shell/platform/android/android_context_gl_impeller.h" #include "flutter/shell/platform/android/android_context_gl_skia.h" #include "flutter/shell/platform/android/android_context_vk_impeller.h" +#include "flutter/shell/platform/android/android_rendering_selector.h" #include "flutter/shell/platform/android/android_surface_gl_impeller.h" #include "flutter/shell/platform/android/android_surface_gl_skia.h" #include "flutter/shell/platform/android/android_surface_software.h" @@ -79,7 +80,6 @@ std::unique_ptr AndroidSurfaceFactoryImpl::CreateSurface() { } static std::shared_ptr CreateAndroidContext( - bool use_software_rendering, const flutter::TaskRunners& task_runners, AndroidRenderingAPI android_rendering_api, bool enable_opengl_gpu_tracing, @@ -106,15 +106,14 @@ PlatformViewAndroid::PlatformViewAndroid( PlatformView::Delegate& delegate, const flutter::TaskRunners& task_runners, const std::shared_ptr& jni_facade, - bool use_software_rendering) + AndroidRenderingAPI rendering_api) : PlatformViewAndroid( delegate, task_runners, jni_facade, CreateAndroidContext( - use_software_rendering, task_runners, - delegate.OnPlatformViewGetSettings().android_rendering_api, + rendering_api, delegate.OnPlatformViewGetSettings().enable_opengl_gpu_tracing, CreateContextSettings(delegate.OnPlatformViewGetSettings()))) {} diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.h b/engine/src/flutter/shell/platform/android/platform_view_android.h index c14e98d3be..fcf2fa9ead 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -7,11 +7,9 @@ #include #include -#include #include #include -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/common/platform_view.h" @@ -46,7 +44,7 @@ class PlatformViewAndroid final : public PlatformView { PlatformViewAndroid(PlatformView::Delegate& delegate, const flutter::TaskRunners& task_runners, const std::shared_ptr& jni_facade, - bool use_software_rendering); + AndroidRenderingAPI rendering_api); //---------------------------------------------------------------------------- /// @brief Creates a new PlatformViewAndroid but using an existing diff --git a/engine/src/flutter/shell/platform/android/platform_view_android_jni_impl.cc b/engine/src/flutter/shell/platform/android/platform_view_android_jni_impl.cc index 245beee8ce..06d2b3467b 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android_jni_impl.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android_jni_impl.cc @@ -20,16 +20,13 @@ #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/impeller/toolkit/android/proc_table.h" #include "flutter/lib/ui/plugins/callback_cache.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_shell_holder.h" #include "flutter/shell/platform/android/apk_asset_provider.h" #include "flutter/shell/platform/android/flutter_main.h" -#include "flutter/shell/platform/android/image_external_texture_gl.h" #include "flutter/shell/platform/android/jni/platform_view_android_jni.h" #include "flutter/shell/platform/android/platform_view_android.h" -#include "impeller/toolkit/android/proc_table.h" #define ANDROID_SHELL_HOLDER \ (reinterpret_cast(shell_holder)) @@ -169,7 +166,8 @@ static jlong AttachJNI(JNIEnv* env, jclass clazz, jobject flutterJNI) { std::shared_ptr jni_facade = std::make_shared(java_object); auto shell_holder = std::make_unique( - FlutterMain::Get().GetSettings(), jni_facade); + FlutterMain::Get().GetSettings(), jni_facade, + FlutterMain::Get().GetAndroidRenderingAPI()); if (shell_holder->IsValid()) { return reinterpret_cast(shell_holder.release()); } else {