diff --git a/flutter/shell/platform/tizen/flutter_project_bundle.cc b/flutter/shell/platform/tizen/flutter_project_bundle.cc index c37b6f0..53257e4 100644 --- a/flutter/shell/platform/tizen/flutter_project_bundle.cc +++ b/flutter/shell/platform/tizen/flutter_project_bundle.cc @@ -50,6 +50,8 @@ FlutterProjectBundle::FlutterProjectBundle( std::string(properties.dart_entrypoint_argv[i])); } + merged_platform_ui_thread_ = properties.merged_platform_ui_thread; + // Resolve any relative paths. if (assets_path_.is_relative() || icu_path_.is_relative() || (!aot_library_path_.empty() && aot_library_path_.is_relative())) { diff --git a/flutter/shell/platform/tizen/flutter_project_bundle.h b/flutter/shell/platform/tizen/flutter_project_bundle.h index c167357..4a08254 100644 --- a/flutter/shell/platform/tizen/flutter_project_bundle.h +++ b/flutter/shell/platform/tizen/flutter_project_bundle.h @@ -67,6 +67,9 @@ class FlutterProjectBundle { return dart_entrypoint_arguments_; } + // Whether the UI isolate should be running on the platform thread. + bool merged_platform_ui_thread() const { return merged_platform_ui_thread_; } + private: std::filesystem::path assets_path_; std::filesystem::path icu_path_; @@ -80,6 +83,9 @@ class FlutterProjectBundle { // Dart entrypoint arguments. std::vector dart_entrypoint_arguments_; + + // Whether the UI isolate should be running on the platform thread. + bool merged_platform_ui_thread_; }; } // namespace flutter diff --git a/flutter/shell/platform/tizen/flutter_tizen_engine.cc b/flutter/shell/platform/tizen/flutter_tizen_engine.cc index 848b02b..68c740c 100644 --- a/flutter/shell/platform/tizen/flutter_tizen_engine.cc +++ b/flutter/shell/platform/tizen/flutter_tizen_engine.cc @@ -174,6 +174,11 @@ bool FlutterTizenEngine::RunEngine() { custom_task_runners.render_task_runner = &render_task_runner; } + if (project_->merged_platform_ui_thread()) { + FT_LOG(Info) << "Running with merged platform and UI thread. Experimental."; + custom_task_runners.ui_task_runner = &platform_task_runner; + } + FlutterProjectArgs args = {}; args.struct_size = sizeof(FlutterProjectArgs); args.assets_path = assets_path_string.c_str(); diff --git a/flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc b/flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc index 44763c3..c5c7db8 100644 --- a/flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc +++ b/flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc @@ -23,6 +23,7 @@ class FlutterTizenEngineTest : public ::testing::Test { engine_prop.assets_path = "/foo/flutter_assets"; engine_prop.icu_data_path = "/foo/icudtl.dat"; engine_prop.aot_library_path = "/foo/libapp.so"; + engine_prop.merged_platform_ui_thread = true; FlutterProjectBundle project(engine_prop); auto engine = std::make_unique(project); @@ -64,6 +65,8 @@ TEST_F(FlutterTizenEngineTest, RunDoesExpectedInitialization) { EXPECT_EQ(args->dart_entrypoint_argc, 0); EXPECT_NE(args->platform_message_callback, nullptr); EXPECT_NE(args->custom_task_runners, nullptr); + EXPECT_EQ(args->custom_task_runners->platform_task_runner, + args->custom_task_runners->ui_task_runner); EXPECT_EQ(args->custom_dart_entrypoint, nullptr); return kSuccess; diff --git a/flutter/shell/platform/tizen/public/flutter_tizen.h b/flutter/shell/platform/tizen/public/flutter_tizen.h index 6d95099..1289fd1 100644 --- a/flutter/shell/platform/tizen/public/flutter_tizen.h +++ b/flutter/shell/platform/tizen/public/flutter_tizen.h @@ -100,6 +100,8 @@ typedef struct { // Array of Dart entrypoint arguments. This is deep copied during the call // to FlutterDesktopRunEngine. const char** dart_entrypoint_argv; + // Whether the UI isolate should run on the platform thread. + bool merged_platform_ui_thread; } FlutterDesktopEngineProperties; // ========== Engine ==========