Clear GL context before Gr context (flutter/engine#20957)

This commit is contained in:
Emmanuel Garcia
2020-09-02 15:08:16 -07:00
committed by GitHub
parent 0239bf949d
commit aea17076cb

View File

@@ -467,16 +467,19 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) {
FireNextFrameCallbackIfPresent();
// 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);
}
// Clear the render context after submitting the frame.
// This ensures that the GL context is released after drawing to the
// surface.
surface_->ClearRenderContext();
return raster_status;
}