Skip to content

Commit 61e057a

Browse files
author
Emmanuel Garcia
authored
Clear GL context before Gr context (flutter#20957)
1 parent 80f4481 commit 61e057a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

shell/common/rasterizer.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,19 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) {
467467

468468
FireNextFrameCallbackIfPresent();
469469

470-
if (surface_->GetContext()) {
471-
TRACE_EVENT0("flutter", "PerformDeferredSkiaCleanup");
472-
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
473-
}
474-
475470
// Clear the render context after submitting the frame.
476471
// This ensures that the GL context is released after drawing to the
477472
// surface.
473+
//
474+
// The GL context must be clear before performing Gr context deferred
475+
// cleanup.
478476
surface_->ClearRenderContext();
479477

478+
if (surface_->GetContext()) {
479+
TRACE_EVENT0("flutter", "PerformDeferredSkiaCleanup");
480+
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
481+
}
482+
480483
return raster_status;
481484
}
482485

0 commit comments

Comments
 (0)