From 73b01fb980f970924bd8fc4bae47afee7c01d157 Mon Sep 17 00:00:00 2001 From: ColdPaleLight <31977171+ColdPaleLight@users.noreply.github.com> Date: Fri, 5 Nov 2021 02:19:14 +0800 Subject: [PATCH] [iOS] Make sure spawnee's isGpuDisabled is set correctly when FlutterEngine spawn (flutter/engine#29361) --- .../shell/platform/darwin/ios/framework/Source/FlutterEngine.mm | 1 + .../darwin/ios/framework/Source/FlutterEngineGroupTest.mm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 8f5da97990..9d942a27ee 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -1034,6 +1034,7 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS 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/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm index dd34a667f8..ad2df532da 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm @@ -24,10 +24,12 @@ FLUTTER_ASSERT_ARC - (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 {