[iOS] Make sure spawnee's isGpuDisabled is set correctly when FlutterEngine spawn (flutter/engine#29361)

This commit is contained in:
ColdPaleLight
2021-11-05 02:19:14 +08:00
committed by GitHub
parent 6979fa97da
commit 73b01fb980
2 changed files with 3 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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 {