Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3178)

Unified Diff: cc/animation/animation_player.cc

Issue 2757453003: Purge impl-only animations awaiting deletion in AnimationPlayer::UpdateState. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_player.cc
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
index dd57cade867919dd604bfa673e986f86baab6078..d77e1de677395b4d51ccd15fc0d4b23e9d3ec685 100644
--- a/cc/animation/animation_player.cc
+++ b/cc/animation/animation_player.cc
@@ -253,7 +253,7 @@ void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) {
return;
MarkAbortedAnimationsForDeletion(player_impl);
- PurgeAnimationsMarkedForDeletion();
+ PurgeAnimationsMarkedForDeletion(/* impl_only */ false);
PushNewAnimationsToImplThread(player_impl);
// Remove finished impl side animations only after pushing,
@@ -298,6 +298,7 @@ void AnimationPlayer::UpdateState(bool start_ready_animations,
MarkFinishedAnimations(last_tick_time_);
MarkAnimationsForDeletion(last_tick_time_, events);
+ PurgeAnimationsMarkedForDeletion(/* impl_only */ true);
if (start_ready_animations) {
if (needs_to_start_animations()) {
@@ -1097,10 +1098,12 @@ void AnimationPlayer::MarkAbortedAnimationsForDeletion(
element_animations_->SetNeedsUpdateImplClientState();
}
-void AnimationPlayer::PurgeAnimationsMarkedForDeletion() {
- base::EraseIf(animations_, [](const std::unique_ptr<Animation>& animation) {
- return animation->run_state() == Animation::WAITING_FOR_DELETION;
- });
+void AnimationPlayer::PurgeAnimationsMarkedForDeletion(bool impl_only) {
+ base::EraseIf(
+ animations_, [impl_only](const std::unique_ptr<Animation>& animation) {
+ return animation->run_state() == Animation::WAITING_FOR_DELETION &&
+ (!impl_only || animation->is_impl_only());
+ });
}
void AnimationPlayer::PushNewAnimationsToImplThread(
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698