Skip to content

Commit

Permalink
Fixed issue where the gpu disable syncswitch was being overridden aft…
Browse files Browse the repository at this point in the history
…er init. (flutter#24958)
  • Loading branch information
gaaclarke authored Mar 15, 2021
1 parent 3a1a3e6 commit e3a84f9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
@@ -526,7 +526,6 @@ - (void)setupShell:(std::unique_ptr<flutter::Shell>)shell
_publisher.reset([[FlutterObservatoryPublisher alloc]
initWithEnableObservatoryPublication:doesObservatoryPublication]);
[self maybeSetupPlatformViewChannels];
_shell->GetIsGpuDisabledSyncSwitch()->SetSwitch(_isGpuDisabled ? true : false);
}

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

_isGpuDisabled = [UIApplication sharedApplication].applicationState != UIApplicationStateActive;
// Create the shell. This is a blocking operation.
std::unique_ptr<flutter::Shell> shell = flutter::Shell::Create(
std::move(platformData), // window data
std::move(task_runners), // task runners
std::move(settings), // settings
on_create_platform_view, // platform view creation
on_create_rasterizer, // rasterzier creation
/*is_gpu_disabled=*/[UIApplication sharedApplication].applicationState !=
UIApplicationStateActive);
/*platform_data=*/std::move(platformData),
/*task_runners=*/std::move(task_runners),
/*settings=*/std::move(settings),
/*on_create_platform_view=*/on_create_platform_view,
/*on_create_rasterizer=*/on_create_rasterizer,
/*is_gpu_disabled=*/_isGpuDisabled);

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

0 comments on commit e3a84f9

Please sign in to comment.