From a8a7d1db42c278a880d279f107abc8089cc24d77 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 10 Oct 2024 16:21:40 -0700 Subject: [PATCH] [engine] remove merge thread setting and fix default value. (flutter/engine#55810) When I removed the configration, I neglected the line that overrode the default from settings. This opted everyone back out. :( --- engine/src/flutter/common/settings.h | 4 ---- engine/src/flutter/shell/common/switches.cc | 3 --- .../platform/android/android_shell_holder.cc | 9 +-------- .../android/android_shell_holder_unittests.cc | 15 --------------- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index 345cf3d977..6d973fa120 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -232,10 +232,6 @@ struct Settings { // Force disable the android surface control even where supported. bool disable_surface_control = false; - // If true, the UI thread is the platform thread on supported - // platforms. - bool merged_platform_ui_thread = true; - // Log a warning during shell initialization if Impeller is not enabled. bool warn_on_impeller_opt_out = false; diff --git a/engine/src/flutter/shell/common/switches.cc b/engine/src/flutter/shell/common/switches.cc index de131b00fd..0fdb14827a 100644 --- a/engine/src/flutter/shell/common/switches.cc +++ b/engine/src/flutter/shell/common/switches.cc @@ -360,9 +360,6 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { settings.verbose_logging = command_line.HasOption(FlagForSwitch(Switch::VerboseLogging)); - settings.merged_platform_ui_thread = command_line.HasOption( - FlagForSwitch(Switch::EnableMergedPlatformUIThread)); - command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), &settings.assets_path); 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 e86effe09b..6ff32d8c83 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder.cc +++ b/engine/src/flutter/shell/platform/android/android_shell_holder.cc @@ -90,9 +90,6 @@ AndroidShellHolder::AndroidShellHolder( auto thread_label = std::to_string(thread_host_count++); auto mask = ThreadHost::Type::kRaster | ThreadHost::Type::kIo; - if (!settings.merged_platform_ui_thread) { - mask |= ThreadHost::Type::kUi; - } flutter::ThreadHost::ThreadHostConfig host_config( thread_label, mask, AndroidPlatformThreadConfigSetter); @@ -139,11 +136,7 @@ AndroidShellHolder::AndroidShellHolder( fml::RefPtr platform_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); raster_runner = thread_host_->raster_thread->GetTaskRunner(); - if (settings.merged_platform_ui_thread) { - ui_runner = platform_runner; - } else { - ui_runner = thread_host_->ui_thread->GetTaskRunner(); - } + ui_runner = platform_runner; io_runner = thread_host_->io_thread->GetTaskRunner(); flutter::TaskRunners task_runners(thread_label, // label 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 0a1f1ed3fc..d65bfae3c3 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 @@ -163,7 +163,6 @@ TEST(AndroidShellHolder, HandlePlatformMessage) { TEST(AndroidShellHolder, CreateWithMergedPlatformAndUIThread) { Settings settings; - settings.merged_platform_ui_thread = true; auto jni = std::make_shared(); auto holder = std::make_unique(settings, jni); auto window = fml::MakeRefCounted( @@ -175,19 +174,5 @@ TEST(AndroidShellHolder, CreateWithMergedPlatformAndUIThread) { holder->GetShellForTesting()->GetTaskRunners().GetPlatformTaskRunner()); } -TEST(AndroidShellHolder, CreateWithUnMergedPlatformAndUIThread) { - Settings settings; - settings.merged_platform_ui_thread = false; - auto jni = std::make_shared(); - auto holder = std::make_unique(settings, jni); - auto window = fml::MakeRefCounted( - nullptr, /*is_fake_window=*/true); - holder->GetPlatformView()->NotifyCreated(window); - - EXPECT_NE( - holder->GetShellForTesting()->GetTaskRunners().GetUITaskRunner(), - holder->GetShellForTesting()->GetTaskRunners().GetPlatformTaskRunner()); -} - } // namespace testing } // namespace flutter