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

Commit 0889e97

Browse files
author
Chris Yang
authored
Always make gpu thread different from platform thread regardless of platform view (#16068)
1 parent 532fdc4 commit 0889e97

File tree

1 file changed

+13
-37
lines changed

1 file changed

+13
-37
lines changed

shell/platform/darwin/ios/framework/Source/FlutterEngine.mm

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -426,43 +426,19 @@ - (BOOL)createShell:(NSString*)entrypoint libraryURI:(NSString*)libraryURI {
426426
return std::make_unique<flutter::Rasterizer>(shell, shell.GetTaskRunners());
427427
};
428428

429-
if (flutter::IsIosEmbeddedViewsPreviewEnabled()) {
430-
// Embedded views requires the gpu and the platform views to be the same.
431-
// The plan is to eventually dynamically merge the threads when there's a
432-
// platform view in the layer tree.
433-
// For now we use a fixed thread configuration with the same thread used as the
434-
// gpu and platform task runner.
435-
// TODO(amirh/chinmaygarde): remove this, and dynamically change the thread configuration.
436-
// https://github.com/flutter/flutter/issues/23975
437-
438-
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
439-
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
440-
fml::MessageLoop::GetCurrent().GetTaskRunner(), // gpu
441-
_threadHost.ui_thread->GetTaskRunner(), // ui
442-
_threadHost.io_thread->GetTaskRunner() // io
443-
);
444-
// Create the shell. This is a blocking operation.
445-
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
446-
std::move(windowData), // window data
447-
std::move(settings), // settings
448-
on_create_platform_view, // platform view creation
449-
on_create_rasterizer // rasterzier creation
450-
);
451-
} else {
452-
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
453-
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
454-
_threadHost.gpu_thread->GetTaskRunner(), // gpu
455-
_threadHost.ui_thread->GetTaskRunner(), // ui
456-
_threadHost.io_thread->GetTaskRunner() // io
457-
);
458-
// Create the shell. This is a blocking operation.
459-
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
460-
std::move(windowData), // window data
461-
std::move(settings), // settings
462-
on_create_platform_view, // platform view creation
463-
on_create_rasterizer // rasterzier creation
464-
);
465-
}
429+
flutter::TaskRunners task_runners(threadLabel.UTF8String, // label
430+
fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform
431+
_threadHost.gpu_thread->GetTaskRunner(), // gpu
432+
_threadHost.ui_thread->GetTaskRunner(), // ui
433+
_threadHost.io_thread->GetTaskRunner() // io
434+
);
435+
// Create the shell. This is a blocking operation.
436+
_shell = flutter::Shell::Create(std::move(task_runners), // task runners
437+
std::move(windowData), // window data
438+
std::move(settings), // settings
439+
on_create_platform_view, // platform view creation
440+
on_create_rasterizer // rasterzier creation
441+
);
466442

467443
if (_shell == nullptr) {
468444
FML_LOG(ERROR) << "Could not start a shell FlutterEngine with entrypoint: "

0 commit comments

Comments
 (0)