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

Unified Diff: cc/animation/animation_player.cc

Issue 1539233002: CC Animations: Fix the case when main-thread player changes layer_id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | cc/animation/animation_player_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 c237aa7fb8b17f5f7172f29d57d23a54ecdcb517..dee19eabdd1e97f9292b55be16af959c8c296acd 100644
--- a/cc/animation/animation_player.cc
+++ b/cc/animation/animation_player.cc
@@ -154,15 +154,12 @@ void AnimationPlayer::RemoveAnimation(int animation_id) {
}
void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) {
- if (!element_animations_) {
- if (player_impl->element_animations())
+ if (layer_id_ != player_impl->layer_id()) {
+ if (player_impl->layer_id())
player_impl->DetachLayer();
- return;
+ if (layer_id_)
+ player_impl->AttachLayer(layer_id_);
}
-
- DCHECK(layer_id_);
- if (!player_impl->element_animations())
- player_impl->AttachLayer(layer_id_);
}
void AnimationPlayer::NotifyAnimationStarted(
« no previous file with comments | « no previous file | cc/animation/animation_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698