Do not call Picture.toImage on web during shader warm-up (#60379)

This commit is contained in:
Yegor 2020-06-26 13:33:02 -07:00 committed by GitHub
parent 769468298b
commit 7518a146c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,10 @@ abstract class ShaderWarmUp {
final ui.Picture picture = recorder.endRecording();
final TimelineTask shaderWarmUpTask = TimelineTask();
shaderWarmUpTask.start('Warm-up shader');
await picture.toImage(size.width.ceil(), size.height.ceil());
// Picture.toImage is not yet implemented on the web.
if (!kIsWeb) {
await picture.toImage(size.width.ceil(), size.height.ceil());
}
shaderWarmUpTask.finish();
}
}