Skip to content

Commit

Permalink
Clear GL context before Gr context (flutter#20957)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia authored Sep 2, 2020
1 parent 80f4481 commit 61e057a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,19 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) {

FireNextFrameCallbackIfPresent();

if (surface_->GetContext()) {
TRACE_EVENT0("flutter", "PerformDeferredSkiaCleanup");
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
}

// Clear the render context after submitting the frame.
// This ensures that the GL context is released after drawing to the
// surface.
//
// The GL context must be clear before performing Gr context deferred
// cleanup.
surface_->ClearRenderContext();

if (surface_->GetContext()) {
TRACE_EVENT0("flutter", "PerformDeferredSkiaCleanup");
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
}

return raster_status;
}

Expand Down

0 comments on commit 61e057a

Please sign in to comment.