Make context current on teardown
Normally, SkiaOutputSurfaceImplOnGpu is responsible for making a GL context current before any calls into DirectContextProvider (e.g. ImplOnGpu::CopyResult, ImplOnGpu::PerformDelayedWork, ~ImplOnGpu). One exception to this is if there is an asynchronous GLRendererCopier readback in flight as ~ImplOnGpu is called (e.g. for tab picker on Android). Specifically, if either ReadPixelsWorkflow::Finish or ~ReadPixelsWorkflow has not been called yet. This CL does 2 things: 1) It does a glFinish() to guaranteee that ReadPixelsWorkflow::Finish will be called before ~ImplOnGpu finishes. This may cause some jank, but it is the simplest method to avoid a leak of GPU resources for in flight readbacks. 2) It does a MakeCurrent in DirectContextProvider::Destroy to make sure that a context is current when ~GLPixelBufferRGBAResult is called (see [1]). [1] https://cs.chromium.org/chromium/src/components/viz/service/display/gl_renderer_copier.cc?rcl=ec3242c55275c8f1c2ea6ac2a0211c391eba7ddc&l=543 Bug: 1020558 Change-Id: I5092594b879efaedd65f2ed9ee3fce297930d294 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898126 Commit-Queue: Jonathan Backer <backer@chromium.org> Reviewed-by:kylechar <kylechar@chromium.org> Cr-Commit-Position: refs/heads/master@{#712274}
Showing
Please register or sign in to comment