From db6bf076860022e6918e166adb52202ab3385de1 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Fri, 31 Mar 2023 08:05:36 -0700 Subject: [PATCH] Revert "[Impeller] Use Vulkan by default (#40809)" (flutter/engine#40820) This reverts commit 35efb76a0606844593208ce0c6722aeb9c6b89cf. Reverting for https://github.com/flutter/flutter/issues/123859 --- .../ci/licenses_golden/licenses_flutter | 8 ++-- engine/src/flutter/common/settings.h | 5 --- engine/src/flutter/shell/common/switches.cc | 3 -- engine/src/flutter/shell/common/switches.h | 6 --- .../flutter/shell/platform/android/BUILD.gn | 4 +- .../android/android_context_gl_impeller.cc | 18 +++++++++ ...peller.h => android_context_gl_impeller.h} | 14 +++---- .../android/android_context_gl_skia.cc | 2 +- .../android/android_context_gl_unittests.cc | 12 +++--- .../android/android_context_impeller.cc | 18 --------- .../android/android_surface_gl_impeller.cc | 3 +- .../android_surface_vulkan_impeller.cc | 3 -- .../android/context/android_context.h | 2 +- .../embedding/engine/FlutterShellArgs.java | 5 --- .../platform/android/platform_view_android.cc | 39 +++++++++---------- .../platform/android/platform_view_android.h | 4 +- .../engine/loader/FlutterLoaderTest.java | 18 --------- 17 files changed, 60 insertions(+), 104 deletions(-) create mode 100644 engine/src/flutter/shell/platform/android/android_context_gl_impeller.cc rename engine/src/flutter/shell/platform/android/{android_context_impeller.h => android_context_gl_impeller.h} (50%) delete mode 100644 engine/src/flutter/shell/platform/android/android_context_impeller.cc diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 00b5c8e2c2..6377aad2d8 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -2184,10 +2184,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 @@ -4763,10 +4763,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 6559fcc6c1..9e9fa7dea2 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -221,11 +221,6 @@ 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/shell/common/switches.cc b/engine/src/flutter/shell/common/switches.cc index e17b40c0d5..702cbd45ea 100644 --- a/engine/src/flutter/shell/common/switches.cc +++ b/engine/src/flutter/shell/common/switches.cc @@ -453,9 +453,6 @@ 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 de92a58e56..30d1f0307d 100644 --- a/engine/src/flutter/shell/common/switches.h +++ b/engine/src/flutter/shell/common/switches.h @@ -266,12 +266,6 @@ 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 45077e08a5..e056731dd6 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 new file mode 100644 index 0000000000..ff4f59a576 --- /dev/null +++ b/engine/src/flutter/shell/platform/android/android_context_gl_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_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_impeller.h b/engine/src/flutter/shell/platform/android/android_context_gl_impeller.h similarity index 50% rename from engine/src/flutter/shell/platform/android/android_context_impeller.h rename to engine/src/flutter/shell/platform/android/android_context_gl_impeller.h index f9b2a5e40c..51e9f7b128 100644 --- a/engine/src/flutter/shell/platform/android/android_context_impeller.h +++ b/engine/src/flutter/shell/platform/android/android_context_gl_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_impeller_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_android_context_impeller_H_ +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_ #include "flutter/fml/macros.h" #include "flutter/shell/platform/android/context/android_context.h" namespace flutter { -class AndroidContextImpeller : public AndroidContext { +class AndroidContextGLImpeller : public AndroidContext { public: - AndroidContextImpeller(); + AndroidContextGLImpeller(); - ~AndroidContextImpeller(); + ~AndroidContextGLImpeller(); // |AndroidContext| bool IsValid() const override; private: - FML_DISALLOW_COPY_AND_ASSIGN(AndroidContextImpeller); + FML_DISALLOW_COPY_AND_ASSIGN(AndroidContextGLImpeller); }; } // namespace flutter -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_android_context_impeller_H_ +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_ 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 c2223d2b9d..adc29695d7 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::kGPU), + : AndroidContext(AndroidRenderingAPI::kOpenGLES), 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 00b19af09a..bf1c7a7840 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::kGPU, environment, task_runners, 0); + AndroidRenderingAPI::kOpenGLES, 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::kGPU, environment, task_runners, 0); + AndroidRenderingAPI::kOpenGLES, 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::kGPU, environment, task_runners, 0); + AndroidRenderingAPI::kOpenGLES, 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::kGPU, environment, task_runners, 0); + AndroidRenderingAPI::kOpenGLES, 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::kGPU, environment, task_runners, 4); + AndroidRenderingAPI::kOpenGLES, 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::kGPU, environment, task_runners, 0); + AndroidRenderingAPI::kOpenGLES, 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 deleted file mode 100644 index d167e7d0c0..0000000000 --- a/engine/src/flutter/shell/platform/android/android_context_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_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_surface_gl_impeller.cc b/engine/src/flutter/shell/platform/android/android_surface_gl_impeller.cc index 5bd5bda733..3200822776 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,9 +75,10 @@ static std::shared_ptr CreateImpellerContext( FML_LOG(ERROR) << "Could not add reactor worker."; return nullptr; } - FML_LOG(ERROR) << "Using the Impeller GL rendering backend."; + FML_LOG(ERROR) << "Using the Impeller 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 8a76b0cd46..0e5ac734e3 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,9 +56,6 @@ 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 1535ff78b3..0bed23e398 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, - kGPU, + kOpenGLES, }; //------------------------------------------------------------------------------ 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 446027effc..e97eb66bfc 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,8 +46,6 @@ 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 = @@ -128,9 +126,6 @@ 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 545a3ee36a..804b0f111d 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,13 +33,11 @@ AndroidSurfaceFactoryImpl::AndroidSurfaceFactoryImpl( const std::shared_ptr& context, std::shared_ptr jni_facade, bool enable_impeller, - bool enable_vulkan_validation, - bool impeller_force_gl) + bool enable_vulkan_validation) : android_context_(context), jni_facade_(std::move(jni_facade)), enable_impeller_(enable_impeller), - enable_vulkan_validation_(enable_vulkan_validation), - impeller_force_gl_(impeller_force_gl) {} + enable_vulkan_validation_(enable_vulkan_validation) {} AndroidSurfaceFactoryImpl::~AndroidSurfaceFactoryImpl() = default; @@ -48,17 +46,17 @@ std::unique_ptr AndroidSurfaceFactoryImpl::CreateSurface() { case AndroidRenderingAPI::kSoftware: return std::make_unique(android_context_, jni_facade_); - case AndroidRenderingAPI::kGPU: + case AndroidRenderingAPI::kOpenGLES: if (enable_impeller_) { - if (!impeller_force_gl_) { - auto vk_surface = std::make_unique( - android_context_, jni_facade_, enable_vulkan_validation_); - if (vk_surface->IsValid()) { - return vk_surface; - } - } +// 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 return std::make_unique(android_context_, jni_facade_); +#endif } else { return std::make_unique(android_context_, jni_facade_); @@ -78,10 +76,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::kGPU, // + AndroidRenderingAPI::kOpenGLES, // fml::MakeRefCounted(), // task_runners, // msaa_samples // @@ -118,11 +116,10 @@ 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, // - delegate.OnPlatformViewGetSettings().impeller_force_gl // + android_context_, // + jni_facade_, // + delegate.OnPlatformViewGetSettings().enable_impeller, // + delegate.OnPlatformViewGetSettings().enable_vulkan_validation // ); android_surface_ = surface_factory_->CreateSurface(); FML_CHECK(android_surface_ && android_surface_->IsValid()) @@ -274,7 +271,7 @@ void PlatformViewAndroid::UpdateSemantics( void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::ScopedJavaGlobalRef& surface_texture) { - if (android_context_->RenderingApi() == AndroidRenderingAPI::kGPU) { + if (android_context_->RenderingApi() == AndroidRenderingAPI::kOpenGLES) { 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 b8221a9ccb..d7a8e8ce65 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -29,8 +29,7 @@ class AndroidSurfaceFactoryImpl : public AndroidSurfaceFactory { AndroidSurfaceFactoryImpl(const std::shared_ptr& context, std::shared_ptr jni_facade, bool enable_impeller, - bool enable_vulkan_validation, - bool impeller_force_gl); + bool enable_vulkan_validation); ~AndroidSurfaceFactoryImpl() override; @@ -41,7 +40,6 @@ 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 7718b44671..1d6bf53573 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,24 +193,6 @@ 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);