use immutable buffer for loading asset images (#103496)

This commit is contained in:
Jonah Williams
2022-05-27 12:23:12 -07:00
committed by GitHub
parent 5cb9c2197f
commit 8d2978af64
20 changed files with 368 additions and 74 deletions

View File

@@ -87,9 +87,7 @@ Future<void> main() async {
for (int i = 0; i < 10; i += 1) {
await Future.wait(<Future<ui.ImmutableBuffer>>[
for (String asset in assets)
rootBundle.load(asset).then((ByteData data) {
return ui.ImmutableBuffer.fromUint8List(data.buffer.asUint8List());
})
rootBundle.loadBuffer(asset)
]);
}
watch.stop();