diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index cf6bc16b71..38682964a5 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -2182,10 +2182,10 @@ ORIGIN: ../../../flutter/shell/gpu/gpu_surface_vulkan_impeller.h + ../../../flut ORIGIN: ../../../flutter/shell/platform/android/AndroidManifest.xml + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_choreographer.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_choreographer.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/android_context_gl_impeller.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/android_context_gl_impeller.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_context_gl_skia.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_context_gl_skia.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/android_context_impeller.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/android_context_impeller.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_display.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_display.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/android_egl_surface.cc + ../../../flutter/LICENSE @@ -4759,10 +4759,10 @@ FILE: ../../../flutter/shell/gpu/gpu_surface_vulkan_impeller.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/android_choreographer.cc FILE: ../../../flutter/shell/platform/android/android_choreographer.h -FILE: ../../../flutter/shell/platform/android/android_context_gl_impeller.cc -FILE: ../../../flutter/shell/platform/android/android_context_gl_impeller.h FILE: ../../../flutter/shell/platform/android/android_context_gl_skia.cc FILE: ../../../flutter/shell/platform/android/android_context_gl_skia.h +FILE: ../../../flutter/shell/platform/android/android_context_impeller.cc +FILE: ../../../flutter/shell/platform/android/android_context_impeller.h FILE: ../../../flutter/shell/platform/android/android_display.cc FILE: ../../../flutter/shell/platform/android/android_display.h FILE: ../../../flutter/shell/platform/android/android_egl_surface.cc diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index 9e9fa7dea2..6559fcc6c1 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -221,6 +221,11 @@ struct Settings { // must be available to the application. bool enable_vulkan_validation = false; + // Force Impeller to use the GL backend if possible. + // On platforms where there is no GL backend (e.g. macOS and iOS), this is a + // no-op. + bool impeller_force_gl = false; + // Data set by platform-specific embedders for use in font initialization. uint32_t font_initialization_data = 0; diff --git a/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.h b/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.h index 9aa7755d90..1b352c6771 100644 --- a/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.h +++ b/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.h @@ -13,6 +13,7 @@ #include "impeller/entity/contents/filters/color_filter_contents.h" #include "impeller/entity/entity.h" #include "impeller/geometry/path.h" +#include "impeller/renderer/capabilities.h" #include "impeller/renderer/sampler_descriptor.h" namespace impeller { diff --git a/engine/src/flutter/shell/common/switches.cc b/engine/src/flutter/shell/common/switches.cc index 702cbd45ea..e17b40c0d5 100644 --- a/engine/src/flutter/shell/common/switches.cc +++ b/engine/src/flutter/shell/common/switches.cc @@ -453,6 +453,9 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { settings.enable_vulkan_validation = command_line.HasOption(FlagForSwitch(Switch::EnableVulkanValidation)); + settings.impeller_force_gl = + command_line.HasOption(FlagForSwitch(Switch::ImpellerForceGL)); + settings.enable_embedder_api = command_line.HasOption(FlagForSwitch(Switch::EnableEmbedderAPI)); diff --git a/engine/src/flutter/shell/common/switches.h b/engine/src/flutter/shell/common/switches.h index 30d1f0307d..de92a58e56 100644 --- a/engine/src/flutter/shell/common/switches.h +++ b/engine/src/flutter/shell/common/switches.h @@ -266,6 +266,12 @@ DEF_SWITCH(EnableVulkanValidation, "Enable loading Vulkan validation layers. The layers must be " "available to the application and loadable. On non-Vulkan backends, " "this flag does nothing.") +DEF_SWITCH( + ImpellerForceGL, + "impeller-force-gl", + "Force Impeller to use the GL backend if it is available. If Impeller is " + "not enabled or it does not support a GL backend for the target " + "platform this flag does nothing.") DEF_SWITCH(LeakVM, "leak-vm", "When the last shell shuts down, the shared VM is leaked by default " diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index e056731dd6..45077e08a5 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -66,10 +66,10 @@ source_set("flutter_shell_native_src") { "$root_build_dir/flutter_icu/icudtl.o", "android_choreographer.cc", "android_choreographer.h", - "android_context_gl_impeller.cc", - "android_context_gl_impeller.h", "android_context_gl_skia.cc", "android_context_gl_skia.h", + "android_context_impeller.cc", + "android_context_impeller.h", "android_display.cc", "android_display.h", "android_egl_surface.cc", diff --git a/engine/src/flutter/shell/platform/android/android_context_gl_impeller.cc b/engine/src/flutter/shell/platform/android/android_context_gl_impeller.cc deleted file mode 100644 index ff4f59a576..0000000000 --- a/engine/src/flutter/shell/platform/android/android_context_gl_impeller.cc +++ /dev/null @@ -1,18 +0,0 @@ -// 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_gl_impeller.h" - -namespace flutter { - -AndroidContextGLImpeller::AndroidContextGLImpeller() - : AndroidContext(AndroidRenderingAPI::kOpenGLES) {} - -AndroidContextGLImpeller::~AndroidContextGLImpeller() = default; - -bool AndroidContextGLImpeller::IsValid() const { - return true; -} - -} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_context_gl_skia.cc b/engine/src/flutter/shell/platform/android/android_context_gl_skia.cc index adc29695d7..c2223d2b9d 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl_skia.cc +++ b/engine/src/flutter/shell/platform/android/android_context_gl_skia.cc @@ -69,7 +69,7 @@ AndroidContextGLSkia::AndroidContextGLSkia( fml::RefPtr environment, const TaskRunners& task_runners, uint8_t msaa_samples) - : AndroidContext(AndroidRenderingAPI::kOpenGLES), + : AndroidContext(AndroidRenderingAPI::kGPU), environment_(std::move(environment)), config_(nullptr), task_runners_(task_runners) { diff --git a/engine/src/flutter/shell/platform/android/android_context_gl_unittests.cc b/engine/src/flutter/shell/platform/android/android_context_gl_unittests.cc index bf1c7a7840..00b19af09a 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl_unittests.cc +++ b/engine/src/flutter/shell/platform/android/android_context_gl_unittests.cc @@ -87,7 +87,7 @@ TEST(AndroidContextGl, Create) { ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); + AndroidRenderingAPI::kGPU, environment, task_runners, 0); context->SetMainSkiaContext(main_context); EXPECT_NE(context.get(), nullptr); context.reset(); @@ -108,7 +108,7 @@ TEST(AndroidContextGl, CreateSingleThread) { TaskRunners(thread_label, platform_runner, platform_runner, platform_runner, platform_runner); auto context = std::make_unique( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); + AndroidRenderingAPI::kGPU, environment, task_runners, 0); context->SetMainSkiaContext(main_context); EXPECT_NE(context.get(), nullptr); context.reset(); @@ -127,7 +127,7 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNotNull) { ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto android_context = std::make_shared( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); + AndroidRenderingAPI::kGPU, environment, task_runners, 0); auto jni = std::make_shared(); auto android_surface = std::make_unique(android_context, jni); @@ -155,7 +155,7 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNull) { ThreadHost thread_host(host_config); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto android_context = std::make_shared( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); + AndroidRenderingAPI::kGPU, environment, task_runners, 0); auto jni = std::make_shared(); auto android_surface = std::make_unique(android_context, jni); @@ -178,7 +178,7 @@ TEST(AndroidContextGl, DISABLED_MSAAx4) { ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 4); + AndroidRenderingAPI::kGPU, environment, task_runners, 4); context->SetMainSkiaContext(main_context); EGLint sample_count; @@ -200,7 +200,7 @@ TEST(AndroidContextGl, EnsureMakeCurrentChecksCurrentContextStatus) { ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( - AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); + AndroidRenderingAPI::kGPU, environment, task_runners, 0); auto pbuffer_surface = context->CreatePbufferSurface(); auto status = pbuffer_surface->MakeCurrent(); diff --git a/engine/src/flutter/shell/platform/android/android_context_impeller.cc b/engine/src/flutter/shell/platform/android/android_context_impeller.cc new file mode 100644 index 0000000000..d167e7d0c0 --- /dev/null +++ b/engine/src/flutter/shell/platform/android/android_context_impeller.cc @@ -0,0 +1,18 @@ +// 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_impeller.h" + +namespace flutter { + +AndroidContextImpeller::AndroidContextImpeller() + : AndroidContext(AndroidRenderingAPI::kGPU) {} + +AndroidContextImpeller::~AndroidContextImpeller() = default; + +bool AndroidContextImpeller::IsValid() const { + return true; +} + +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_context_gl_impeller.h b/engine/src/flutter/shell/platform/android/android_context_impeller.h similarity index 50% rename from engine/src/flutter/shell/platform/android/android_context_gl_impeller.h rename to engine/src/flutter/shell/platform/android/android_context_impeller.h index 51e9f7b128..f9b2a5e40c 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl_impeller.h +++ b/engine/src/flutter/shell/platform/android/android_context_impeller.h @@ -2,27 +2,27 @@ // 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_CONTEXT_GL_IMPELLER_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_ +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_android_context_impeller_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_android_context_impeller_H_ #include "flutter/fml/macros.h" #include "flutter/shell/platform/android/context/android_context.h" namespace flutter { -class AndroidContextGLImpeller : public AndroidContext { +class AndroidContextImpeller : public AndroidContext { public: - AndroidContextGLImpeller(); + AndroidContextImpeller(); - ~AndroidContextGLImpeller(); + ~AndroidContextImpeller(); // |AndroidContext| bool IsValid() const override; private: - FML_DISALLOW_COPY_AND_ASSIGN(AndroidContextGLImpeller); + FML_DISALLOW_COPY_AND_ASSIGN(AndroidContextImpeller); }; } // namespace flutter -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_ +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_android_context_impeller_H_ diff --git a/engine/src/flutter/shell/platform/android/android_surface_gl_impeller.cc b/engine/src/flutter/shell/platform/android/android_surface_gl_impeller.cc index 3200822776..5bd5bda733 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl_impeller.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_gl_impeller.cc @@ -75,10 +75,9 @@ static std::shared_ptr CreateImpellerContext( FML_LOG(ERROR) << "Could not add reactor worker."; return nullptr; } - FML_LOG(ERROR) << "Using the Impeller rendering backend."; + FML_LOG(ERROR) << "Using the Impeller GL rendering backend."; return context; } - AndroidSurfaceGLImpeller::AndroidSurfaceGLImpeller( const std::shared_ptr& android_context, const std::shared_ptr& jni_facade) diff --git a/engine/src/flutter/shell/platform/android/android_surface_vulkan_impeller.cc b/engine/src/flutter/shell/platform/android/android_surface_vulkan_impeller.cc index 0e5ac734e3..8a76b0cd46 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_vulkan_impeller.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_vulkan_impeller.cc @@ -56,6 +56,9 @@ AndroidSurfaceVulkanImpeller::AndroidSurfaceVulkanImpeller( CreateImpellerContext(proc_table_, workers_, enable_vulkan_validation); is_valid_ = proc_table_->HasAcquiredMandatoryProcAddresses() && impeller_context_; + if (is_valid_) { + FML_LOG(ERROR) << "Using the Impeller Vulkan rendering backend."; + } } AndroidSurfaceVulkanImpeller::~AndroidSurfaceVulkanImpeller() = default; 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 0bed23e398..1535ff78b3 100644 --- a/engine/src/flutter/shell/platform/android/context/android_context.h +++ b/engine/src/flutter/shell/platform/android/context/android_context.h @@ -13,7 +13,7 @@ namespace flutter { enum class AndroidRenderingAPI { kSoftware, - kOpenGLES, + kGPU, }; //------------------------------------------------------------------------------ diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java index e97eb66bfc..446027effc 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java @@ -46,6 +46,8 @@ public class FlutterShellArgs { public static final String ARG_ENABLE_IMPELLER = "--enable-impeller"; public static final String ARG_KEY_ENABLE_VULKAN_VALIDATION = "enable-vulkan-validation"; public static final String ARG_ENABLE_VULKAN_VALIDATION = "--enable-vulkan-validation"; + public static final String ARG_KEY_IMPELLER_FORCE_GL = "impeller-force-gl"; + public static final String ARG_IMPELLER_FORCE_GL = "--impeller-force-gl"; public static final String ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION = "dump-skp-on-shader-compilation"; public static final String ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION = @@ -126,6 +128,9 @@ public class FlutterShellArgs { if (intent.getBooleanExtra(ARG_KEY_ENABLE_VULKAN_VALIDATION, false)) { args.add(ARG_ENABLE_VULKAN_VALIDATION); } + if (intent.getBooleanExtra(ARG_KEY_IMPELLER_FORCE_GL, false)) { + args.add(ARG_IMPELLER_FORCE_GL); + } if (intent.getBooleanExtra(ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION, false)) { args.add(ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION); } 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 804b0f111d..545a3ee36a 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -10,8 +10,8 @@ #include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/shell_io_manager.h" #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" -#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_impeller.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl_impeller.h" #include "flutter/shell/platform/android/android_surface_gl_skia.h" @@ -33,11 +33,13 @@ AndroidSurfaceFactoryImpl::AndroidSurfaceFactoryImpl( const std::shared_ptr& context, std::shared_ptr jni_facade, bool enable_impeller, - bool enable_vulkan_validation) + bool enable_vulkan_validation, + bool impeller_force_gl) : android_context_(context), jni_facade_(std::move(jni_facade)), enable_impeller_(enable_impeller), - enable_vulkan_validation_(enable_vulkan_validation) {} + enable_vulkan_validation_(enable_vulkan_validation), + impeller_force_gl_(impeller_force_gl) {} AndroidSurfaceFactoryImpl::~AndroidSurfaceFactoryImpl() = default; @@ -46,17 +48,17 @@ std::unique_ptr AndroidSurfaceFactoryImpl::CreateSurface() { case AndroidRenderingAPI::kSoftware: return std::make_unique(android_context_, jni_facade_); - case AndroidRenderingAPI::kOpenGLES: + case AndroidRenderingAPI::kGPU: if (enable_impeller_) { -// TODO(kaushikiska@): Enable this after wiring a preference for Vulkan backend. -#if false - return std::make_unique( - android_context_, jni_facade_, enable_vulkan_validation_); - -#else + if (!impeller_force_gl_) { + auto vk_surface = std::make_unique( + android_context_, jni_facade_, enable_vulkan_validation_); + if (vk_surface->IsValid()) { + return vk_surface; + } + } return std::make_unique(android_context_, jni_facade_); -#endif } else { return std::make_unique(android_context_, jni_facade_); @@ -76,10 +78,10 @@ static std::shared_ptr CreateAndroidContext( return std::make_shared(AndroidRenderingAPI::kSoftware); } if (enable_impeller) { - return std::make_unique(); + return std::make_unique(); } return std::make_unique( - AndroidRenderingAPI::kOpenGLES, // + AndroidRenderingAPI::kGPU, // fml::MakeRefCounted(), // task_runners, // msaa_samples // @@ -116,10 +118,11 @@ PlatformViewAndroid::PlatformViewAndroid( FML_CHECK(android_context_->IsValid()) << "Could not create surface from invalid Android context."; surface_factory_ = std::make_shared( - android_context_, // - jni_facade_, // - delegate.OnPlatformViewGetSettings().enable_impeller, // - delegate.OnPlatformViewGetSettings().enable_vulkan_validation // + android_context_, // + jni_facade_, // + delegate.OnPlatformViewGetSettings().enable_impeller, // + delegate.OnPlatformViewGetSettings().enable_vulkan_validation, // + delegate.OnPlatformViewGetSettings().impeller_force_gl // ); android_surface_ = surface_factory_->CreateSurface(); FML_CHECK(android_surface_ && android_surface_->IsValid()) @@ -271,7 +274,7 @@ void PlatformViewAndroid::UpdateSemantics( void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::ScopedJavaGlobalRef& surface_texture) { - if (android_context_->RenderingApi() == AndroidRenderingAPI::kOpenGLES) { + if (android_context_->RenderingApi() == AndroidRenderingAPI::kGPU) { RegisterTexture(std::make_shared( texture_id, surface_texture, jni_facade_)); } else { 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 d7a8e8ce65..b8221a9ccb 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -29,7 +29,8 @@ class AndroidSurfaceFactoryImpl : public AndroidSurfaceFactory { AndroidSurfaceFactoryImpl(const std::shared_ptr& context, std::shared_ptr jni_facade, bool enable_impeller, - bool enable_vulkan_validation); + bool enable_vulkan_validation, + bool impeller_force_gl); ~AndroidSurfaceFactoryImpl() override; @@ -40,6 +41,7 @@ class AndroidSurfaceFactoryImpl : public AndroidSurfaceFactory { std::shared_ptr jni_facade_; const bool enable_impeller_; const bool enable_vulkan_validation_; + const bool impeller_force_gl_; }; class PlatformViewAndroid final : public PlatformView { diff --git a/engine/src/flutter/shell/platform/android/test/io/flutter/embedding/engine/loader/FlutterLoaderTest.java b/engine/src/flutter/shell/platform/android/test/io/flutter/embedding/engine/loader/FlutterLoaderTest.java index 1d6bf53573..7718b44671 100644 --- a/engine/src/flutter/shell/platform/android/test/io/flutter/embedding/engine/loader/FlutterLoaderTest.java +++ b/engine/src/flutter/shell/platform/android/test/io/flutter/embedding/engine/loader/FlutterLoaderTest.java @@ -193,6 +193,24 @@ public class FlutterLoaderTest { assertFalse(arguments.contains(enableVulkanValidationArg)); } + @Test + public void itDoesNotSetEnableGLByDefault() { + FlutterJNI mockFlutterJNI = mock(FlutterJNI.class); + FlutterLoader flutterLoader = new FlutterLoader(mockFlutterJNI); + + assertFalse(flutterLoader.initialized()); + flutterLoader.startInitialization(ctx); + flutterLoader.ensureInitializationComplete(ctx, null); + shadowOf(getMainLooper()).idle(); + + final String enableGLArg = "--impeller-force-gl"; + ArgumentCaptor shellArgsCaptor = ArgumentCaptor.forClass(String[].class); + verify(mockFlutterJNI, times(1)) + .init(eq(ctx), shellArgsCaptor.capture(), anyString(), anyString(), anyString(), anyLong()); + List arguments = Arrays.asList(shellArgsCaptor.getValue()); + assertFalse(arguments.contains(enableGLArg)); + } + @Test public void itSetsEnableImpellerFromMetaData() { FlutterJNI mockFlutterJNI = mock(FlutterJNI.class);