Clear the canvas when attempting to render to the surface. (flutter/engine#5036)

This commit is contained in:
Chinmay Garde
2018-04-17 19:04:52 -07:00
committed by GitHub
parent e01a739b45
commit 7b5e21ff33

View File

@@ -100,8 +100,14 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) {
// for instrumentation.
compositor_context_.engine_time().SetLapTime(layer_tree.construction_time());
auto compositor_frame = compositor_context_.AcquireFrame(
surface_->GetContext(), frame->SkiaCanvas(), true);
auto canvas = frame->SkiaCanvas();
auto compositor_frame =
compositor_context_.AcquireFrame(surface_->GetContext(), canvas, true);
if (canvas) {
canvas->clear(SK_ColorBLACK);
}
if (compositor_frame && compositor_frame->Raster(layer_tree, false)) {
frame->Submit();