Sped up shader warmup by only drawing on a 100x100 surface (#36482)

Sped up shader warmup by only drawing on a 100x100 surface and doing
the draw calls on top of each other.
This commit is contained in:
gaaclarke
2019-07-26 10:05:40 -07:00
committed by GitHub
parent 0d0af31598
commit 9b150f134b
2 changed files with 25 additions and 10 deletions

View File

@@ -16,7 +16,9 @@ Future<void> beginFrame(Duration timeStamp) async {
final ui.Canvas canvas = ui.Canvas(recorder, paintBounds);
final ui.Paint backgroundPaint = ui.Paint()..color = Colors.white;
canvas.drawRect(paintBounds, backgroundPaint);
await const DefaultShaderWarmUp().warmUpOnCanvas(canvas);
await const DefaultShaderWarmUp(
drawCallSpacing: 80.0, canvasSize: ui.Size(1024, 1024))
.warmUpOnCanvas(canvas);
final ui.Picture picture = recorder.endRecording();
// COMPOSITE