From 6abd95a53be0908bf0c0c2c6171d5b98b8246df3 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Fri, 17 Mar 2023 20:35:36 -0700 Subject: [PATCH] Provisional iOS impeller flag flip (flutter/engine#40405) --- engine/src/flutter/common/settings.h | 5 +++++ engine/src/flutter/shell/common/switches.cc | 8 ++++++-- .../scenario_app/ios/Scenarios/Scenarios/Info.plist | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index e5c3940876..d4722b1dbd 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -14,6 +14,7 @@ #include #include +#include "flutter/fml/build_config.h" #include "flutter/fml/closure.h" #include "flutter/fml/mapping.h" #include "flutter/fml/time/time_point.h" @@ -210,7 +211,11 @@ struct Settings { // Enable the Impeller renderer on supported platforms. Ignored if Impeller is // not supported on the platform. +#if FML_OS_IOS || FML_OS_IOS_SIMULATOR + bool enable_impeller = true; +#else bool enable_impeller = false; +#endif // 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 63c12cbe3b..a94d1cbabf 100644 --- a/engine/src/flutter/shell/common/switches.cc +++ b/engine/src/flutter/shell/common/switches.cc @@ -443,8 +443,12 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { settings.use_asset_fonts = !command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts)); - settings.enable_impeller = - command_line.HasOption(FlagForSwitch(Switch::EnableImpeller)); + std::string enable_impeller_value; + if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableImpeller), + &enable_impeller_value)) { + settings.enable_impeller = + enable_impeller_value.empty() || "true" == enable_impeller_value; + } settings.enable_embedder_api = command_line.HasOption(FlagForSwitch(Switch::EnableEmbedderAPI)); diff --git a/engine/src/flutter/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist b/engine/src/flutter/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist index bc23fd5445..0605d9602d 100644 --- a/engine/src/flutter/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist +++ b/engine/src/flutter/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist @@ -41,5 +41,7 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + FLTEnableImpeller +