From f151017380887f722fa1fd62b7833d93a950d2a6 Mon Sep 17 00:00:00 2001 From: ColdPaleLight Date: Thu, 28 Oct 2021 01:50:55 +0800 Subject: [PATCH] [iOS] Make sure spawnee's isGpuDisabled is set correctly when FlutterEngine spawn --- shell/platform/darwin/ios/framework/Source/FlutterEngine.mm | 1 + .../darwin/ios/framework/Source/FlutterEngineGroupTest.mm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index de4f4c20ec74b..f19ce94dd5db5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -1041,6 +1041,7 @@ - (FlutterEngine*)spawnWithEntrypoint:(/*nullable*/ NSString*)entrypoint result->_threadHost = _threadHost; result->_profiler = _profiler; result->_profiler_metrics = _profiler_metrics; + result->_isGpuDisabled = _isGpuDisabled; [result setupShell:std::move(shell) withObservatoryPublication:NO]; return result; } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm index dd34a667f80c1..ad2df532da8c2 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm @@ -24,10 +24,12 @@ - (void)testMake { - (void)testSpawn { FlutterEngineGroup* group = [[FlutterEngineGroup alloc] initWithName:@"foo" project:nil]; FlutterEngine* spawner = [group makeEngineWithEntrypoint:nil libraryURI:nil]; + spawner.isGpuDisabled = YES; FlutterEngine* spawnee = [group makeEngineWithEntrypoint:nil libraryURI:nil]; XCTAssertNotNil(spawner); XCTAssertNotNil(spawnee); XCTAssertEqual(&spawner.threadHost, &spawnee.threadHost); + XCTAssertEqual(spawner.isGpuDisabled, spawnee.isGpuDisabled); } - (void)testDeleteLastEngine {