Skip to content

Commit 939d2f1

Browse files
gaaclarkehjfreyer
authored andcommitted
Fixed issue where the gpu disable syncswitch was being overridden after init. (flutter#24958)
1 parent 2a773c6 commit 939d2f1

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ - (void)setupShell:(std::unique_ptr<flutter::Shell>)shell
526526
_publisher.reset([[FlutterObservatoryPublisher alloc]
527527
initWithEnableObservatoryPublication:doesObservatoryPublication]);
528528
[self maybeSetupPlatformViewChannels];
529-
_shell->GetIsGpuDisabledSyncSwitch()->SetSwitch(_isGpuDisabled ? true : false);
530529
}
531530

532531
+ (BOOL)isProfilerEnabled {
@@ -611,15 +610,15 @@ - (BOOL)createShell:(NSString*)entrypoint
611610
_threadHost->io_thread->GetTaskRunner() // io
612611
);
613612

613+
_isGpuDisabled = [UIApplication sharedApplication].applicationState != UIApplicationStateActive;
614614
// Create the shell. This is a blocking operation.
615615
std::unique_ptr<flutter::Shell> shell = flutter::Shell::Create(
616-
std::move(platformData), // window data
617-
std::move(task_runners), // task runners
618-
std::move(settings), // settings
619-
on_create_platform_view, // platform view creation
620-
on_create_rasterizer, // rasterzier creation
621-
/*is_gpu_disabled=*/[UIApplication sharedApplication].applicationState !=
622-
UIApplicationStateActive);
616+
/*platform_data=*/std::move(platformData),
617+
/*task_runners=*/std::move(task_runners),
618+
/*settings=*/std::move(settings),
619+
/*on_create_platform_view=*/on_create_platform_view,
620+
/*on_create_rasterizer=*/on_create_rasterizer,
621+
/*is_gpu_disabled=*/_isGpuDisabled);
623622

624623
if (shell == nullptr) {
625624
FML_LOG(ERROR) << "Could not start a shell FlutterEngine with entrypoint: "

0 commit comments

Comments
 (0)