aw: Fix gpu memory leak on detach
As mentioned in the bug, when renderer does not produce a frame, ChildFrame will not update layer_tree_frame_sink_id in WaitOnFutureIfNeeded, so it's kept at 0u. Then this messes up HardwareRenderer::last_committed_layer_tree_frame_sink_id_ tracking which can lead to resources incorrectly not returned in HardwareRenderer::ReturnResourcesToCompositor. Not only positive values are valid frame_sink_id, so it is safe to use 0u as a sentinel value. See g_next_layer_tree_frame_sink_id in render_thread_impl.cc. So avoid updating HardwareRenderer if the id is invalid. Bug: 1059869 Change-Id: Ibcec3d474ab09f360d4b16c1ca20e46527603565 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094471Reviewed-by:Vasiliy Telezhnikov <vasilyt@chromium.org> Commit-Queue: Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#748344}
Showing
Please register or sign in to comment