mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Revert "Always make gpu thread different from platform thread regardless of platform view (#16068)" (flutter/engine#16161)
This reverts commit f979af16ec379f268468015c7cb555849783ec21.
This commit is contained in:
parent
5e2f68131d
commit
56929f0ee2
@ -426,19 +426,43 @@ NSString* const FlutterDefaultDartEntrypoint = nil;
|
||||
return std::make_unique<flutter::Rasterizer>(shell, shell.GetTaskRunners());
|
||||
};
|
||||
|
||||
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
|
||||
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
|
||||
_threadHost.gpu_thread->GetTaskRunner(), // gpu
|
||||
_threadHost.ui_thread->GetTaskRunner(), // ui
|
||||
_threadHost.io_thread->GetTaskRunner() // io
|
||||
);
|
||||
// Create the shell. This is a blocking operation.
|
||||
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
|
||||
std::move(windowData), // window data
|
||||
std::move(settings), // settings
|
||||
on_create_platform_view, // platform view creation
|
||||
on_create_rasterizer // rasterzier creation
|
||||
);
|
||||
if (flutter::IsIosEmbeddedViewsPreviewEnabled()) {
|
||||
// Embedded views requires the gpu and the platform views to be the same.
|
||||
// The plan is to eventually dynamically merge the threads when there's a
|
||||
// platform view in the layer tree.
|
||||
// For now we use a fixed thread configuration with the same thread used as the
|
||||
// gpu and platform task runner.
|
||||
// TODO(amirh/chinmaygarde): remove this, and dynamically change the thread configuration.
|
||||
// https://github.com/flutter/flutter/issues/23975
|
||||
|
||||
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
|
||||
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
|
||||
fml::MessageLoop::GetCurrent().GetTaskRunner(), // gpu
|
||||
_threadHost.ui_thread->GetTaskRunner(), // ui
|
||||
_threadHost.io_thread->GetTaskRunner() // io
|
||||
);
|
||||
// Create the shell. This is a blocking operation.
|
||||
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
|
||||
std::move(windowData), // window data
|
||||
std::move(settings), // settings
|
||||
on_create_platform_view, // platform view creation
|
||||
on_create_rasterizer // rasterzier creation
|
||||
);
|
||||
} else {
|
||||
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
|
||||
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
|
||||
_threadHost.gpu_thread->GetTaskRunner(), // gpu
|
||||
_threadHost.ui_thread->GetTaskRunner(), // ui
|
||||
_threadHost.io_thread->GetTaskRunner() // io
|
||||
);
|
||||
// Create the shell. This is a blocking operation.
|
||||
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
|
||||
std::move(windowData), // window data
|
||||
std::move(settings), // settings
|
||||
on_create_platform_view, // platform view creation
|
||||
on_create_rasterizer // rasterzier creation
|
||||
);
|
||||
}
|
||||
|
||||
if (_shell == nullptr) {
|
||||
FML_LOG(ERROR) << "Could not start a shell FlutterEngine with entrypoint: "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user