Skip to content

Commit

Permalink
Clear the canvas when attempting to render to the surface. (flutter#5036
Browse files Browse the repository at this point in the history
)
  • Loading branch information
chinmaygarde authored Apr 18, 2018
1 parent d8eb659 commit 5822b6e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5822b6e

Please sign in to comment.