mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Evict BitmapCanvas(s) from cache when canvas allocation fails (flutter/engine#16793)
This commit is contained in:
parent
94c31a6e2a
commit
0e20dc802c
@ -95,6 +95,14 @@ class _CanvasPool extends _SaveStackTracking {
|
||||
width: _widthInBitmapPixels,
|
||||
height: _heightInBitmapPixels,
|
||||
);
|
||||
if (_canvas == null) {
|
||||
// Evict BitmapCanvas(s) and retry.
|
||||
_reduceCanvasMemoryUsage();
|
||||
_canvas = html.CanvasElement(
|
||||
width: _widthInBitmapPixels,
|
||||
height: _heightInBitmapPixels,
|
||||
);
|
||||
}
|
||||
_canvas.style
|
||||
..position = 'absolute'
|
||||
..width = '${cssWidth}px'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user