Skip to content

Commit

Permalink
Clear frame references at the end of every CanvasKit frame (#16525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Terkelsen committed Feb 10, 2020
1 parent c477c06 commit a662579
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/web_ui/lib/src/engine/compositor/rasterizer.dart
Expand Up @@ -37,7 +37,8 @@ class Rasterizer {
final SurfaceFrame frame = surface.acquireFrame(layerTree.frameSize);
surface.viewEmbedder.frameSize = layerTree.frameSize;
final SkCanvas canvas = frame.skiaCanvas;
final Frame compositorFrame = context.acquireFrame(canvas, surface.viewEmbedder);
final Frame compositorFrame =
context.acquireFrame(canvas, surface.viewEmbedder);

compositorFrame.raster(layerTree, ignoreRasterCache: true);
surface.addToScene();
Expand All @@ -57,5 +58,9 @@ class Rasterizer {
final ui.VoidCallback callback = _postFrameCallbacks[i];
callback();
}
for (int i = 0; i < _frameReferences.length; i++) {
_frameReferences[i].value = null;
}
_frameReferences.clear();
}
}

0 comments on commit a662579

Please sign in to comment.