Fix AnimationThroughputReporter leak when layer gone
Fix AnimationThroughputReporter leaks its AnimationTracker when the underlying layer is released before the reporter. In such case, AnimationTracker holds a ref count of LayerAnimator so that that the animator and the animation sequences are kept around even if the underlying layer is released. And the animations will never run in such case and the tracker is leaked. The CL fixes the issue by observing LayerDestroyed to clean up. Also rename IsTrackingAnimation -> HasAnimationsToTrack to better reflect its meaning that returning a true means there will be animations to be tracked but does not mean it is tracking them right now. Bug: 1158510 Change-Id: I98980522a9b6866b0f635a512d0fbb6987eb2c59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2590646 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by:kylechar <kylechar@chromium.org> Reviewed-by:
Mitsuru Oshima <oshima@chromium.org> Cr-Commit-Position: refs/heads/master@{#837388}
Showing
Please register or sign in to comment