Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9912c8e

Browse files
authored
Revert "[Impeller] Added a switch to turn on vulkan (#42585)"
This reverts commit f5007e9.
1 parent 686e02a commit 9912c8e

File tree

7 files changed

+24
-63
lines changed

7 files changed

+24
-63
lines changed

common/settings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ struct Settings {
217217
bool enable_impeller = false;
218218
#endif
219219

220-
// Requests a particular backend to be used (ex "opengles" or "vulkan")
221-
std::optional<std::string> impeller_backend;
222-
223220
// Enable Vulkan validation on backends that support it. The validation layers
224221
// must be available to the application.
225222
bool enable_vulkan_validation = false;

shell/common/switches.cc

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -443,23 +443,11 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
443443
settings.use_asset_fonts =
444444
!command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts));
445445

446-
{
447-
std::string enable_impeller_value;
448-
if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableImpeller),
449-
&enable_impeller_value)) {
450-
settings.enable_impeller =
451-
enable_impeller_value.empty() || "true" == enable_impeller_value;
452-
}
453-
}
454-
455-
{
456-
std::string impeller_backend_value;
457-
if (command_line.GetOptionValue(FlagForSwitch(Switch::ImpellerBackend),
458-
&impeller_backend_value)) {
459-
if (!impeller_backend_value.empty()) {
460-
settings.impeller_backend = impeller_backend_value;
461-
}
462-
}
446+
std::string enable_impeller_value;
447+
if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableImpeller),
448+
&enable_impeller_value)) {
449+
settings.enable_impeller =
450+
enable_impeller_value.empty() || "true" == enable_impeller_value;
463451
}
464452

465453
settings.enable_vulkan_validation =

shell/common/switches.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@ DEF_SWITCH(EnableImpeller,
261261
"enable-impeller",
262262
"Enable the Impeller renderer on supported platforms. Ignored if "
263263
"Impeller is not supported on the platform.")
264-
DEF_SWITCH(ImpellerBackend,
265-
"impeller-backend",
266-
"Requests a particular Impeller backend on platforms that support "
267-
"multiple backends. (ex `opengles` or `vulkan`)")
268264
DEF_SWITCH(EnableVulkanValidation,
269265
"enable-vulkan-validation",
270266
"Enable loading Vulkan validation layers. The layers must be "

shell/platform/android/android_context_gl_impeller.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static std::shared_ptr<impeller::Context> CreateImpellerContext(
7474
FML_LOG(ERROR) << "Could not add reactor worker.";
7575
return nullptr;
7676
}
77-
FML_LOG(ERROR) << "Using the Impeller rendering backend (OpenGLES).";
77+
FML_LOG(ERROR) << "Using the Impeller rendering backend.";
7878
return context;
7979
}
8080

shell/platform/android/android_context_vulkan_impeller.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ static std::shared_ptr<impeller::Context> CreateImpellerContext(
3434
settings.cache_directory = fml::paths::GetCachesDirectory();
3535
settings.worker_task_runner = std::move(worker_task_runner);
3636
settings.enable_validation = enable_vulkan_validation;
37-
38-
FML_LOG(ERROR) << "Using the Impeller rendering backend (Vulkan).";
39-
4037
return impeller::ContextVK::Create(std::move(settings));
4138
}
4239

shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public class FlutterLoader {
4141
"io.flutter.embedding.android.OldGenHeapSize";
4242
private static final String ENABLE_IMPELLER_META_DATA_KEY =
4343
"io.flutter.embedding.android.EnableImpeller";
44-
private static final String IMPELLER_BACKEND_META_DATA_KEY =
45-
"io.flutter.embedding.android.ImpellerBackend";
4644

4745
/**
4846
* Set whether leave or clean up the VM after the last shell shuts down. It can be set from app's
@@ -318,12 +316,8 @@ public void ensureInitializationComplete(
318316

319317
shellArgs.add("--prefetched-default-font-manager");
320318

321-
if (metaData != null) {
322-
if (metaData.getBoolean(ENABLE_IMPELLER_META_DATA_KEY, false)) {
323-
shellArgs.add("--enable-impeller");
324-
}
325-
String backend = metaData.getString(IMPELLER_BACKEND_META_DATA_KEY, "opengles");
326-
shellArgs.add("--impeller-backend=" + backend);
319+
if (metaData != null && metaData.getBoolean(ENABLE_IMPELLER_META_DATA_KEY, false)) {
320+
shellArgs.add("--enable-impeller");
327321
}
328322

329323
final String leakVM = isLeakVM(metaData) ? "true" : "false";

shell/platform/android/platform_view_android.cc

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ std::unique_ptr<AndroidSurface> AndroidSurfaceFactoryImpl::CreateSurface() {
5151
}
5252
case AndroidRenderingAPI::kVulkan:
5353
FML_DCHECK(enable_impeller_);
54-
return std::make_unique<AndroidSurfaceVulkanImpeller>(
54+
// TODO(kaushikiska@): Enable this after wiring a preference for Vulkan
55+
// backend.
56+
#if false
57+
return std::make_unique<AndroidSurfaceVulkanImpeller>(
5558
std::static_pointer_cast<AndroidContextVulkanImpeller>(
5659
android_context_));
60+
#else
61+
return std::make_unique<AndroidSurfaceGLImpeller>(
62+
std::static_pointer_cast<AndroidContextGLImpeller>(android_context_));
63+
#endif
5764
default:
5865
FML_DCHECK(false);
5966
return nullptr;
@@ -66,36 +73,19 @@ static std::shared_ptr<flutter::AndroidContext> CreateAndroidContext(
6673
const std::shared_ptr<fml::ConcurrentTaskRunner>& worker_task_runner,
6774
uint8_t msaa_samples,
6875
bool enable_impeller,
69-
const std::optional<std::string>& impeller_backend,
7076
bool enable_vulkan_validation) {
7177
if (use_software_rendering) {
7278
return std::make_shared<AndroidContext>(AndroidRenderingAPI::kSoftware);
7379
}
7480
if (enable_impeller) {
75-
// TODO(gaaclarke): We need to devise a more complete heuristic about what
76-
// backend to use by default.
77-
// Default value is OpenGLES.
78-
AndroidRenderingAPI backend = AndroidRenderingAPI::kOpenGLES;
79-
if (impeller_backend.has_value()) {
80-
if (impeller_backend.value() == "opengles") {
81-
backend = AndroidRenderingAPI::kOpenGLES;
82-
} else if (impeller_backend.value() == "vulkan") {
83-
backend = AndroidRenderingAPI::kVulkan;
84-
} else {
85-
FML_CHECK(impeller_backend.value() == "vulkan" ||
86-
impeller_backend.value() == "opengles");
87-
}
88-
}
89-
switch (backend) {
90-
case AndroidRenderingAPI::kOpenGLES:
91-
return std::make_unique<AndroidContextGLImpeller>(
92-
std::make_unique<impeller::egl::Display>());
93-
case AndroidRenderingAPI::kVulkan:
94-
return std::make_unique<AndroidContextVulkanImpeller>(
95-
enable_vulkan_validation, worker_task_runner);
96-
default:
97-
FML_UNREACHABLE();
98-
}
81+
// TODO(kaushikiska@): Enable this after wiring a preference for Vulkan
82+
// backend.
83+
#if false
84+
return std::make_unique<AndroidContextVulkanImpeller>(enable_vulkan_validation, std::move(worker_task_runner));
85+
#else
86+
return std::make_unique<AndroidContextGLImpeller>(
87+
std::make_unique<impeller::egl::Display>());
88+
#endif
9989
}
10090
return std::make_unique<AndroidContextGLSkia>(
10191
AndroidRenderingAPI::kOpenGLES, //
@@ -122,7 +112,6 @@ PlatformViewAndroid::PlatformViewAndroid(
122112
worker_task_runner,
123113
msaa_samples,
124114
delegate.OnPlatformViewGetSettings().enable_impeller,
125-
delegate.OnPlatformViewGetSettings().impeller_backend,
126115
delegate.OnPlatformViewGetSettings().enable_vulkan_validation)) {}
127116

128117
PlatformViewAndroid::PlatformViewAndroid(

0 commit comments

Comments
 (0)