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

Side by Side Diff: cc/animation/animation_timeline.cc

Issue 1322853003: CC Animations: Allow timelines and players without host to support non-compositingMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/animation/animation_timeline.h" 5 #include "cc/animation/animation_timeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/animation/animation_player.h" 9 #include "cc/animation/animation_player.h"
10 10
(...skipping 17 matching lines...) Expand all
28 return timeline; 28 return timeline;
29 } 29 }
30 30
31 void AnimationTimeline::SetAnimationHost(AnimationHost* animation_host) { 31 void AnimationTimeline::SetAnimationHost(AnimationHost* animation_host) {
32 animation_host_ = animation_host; 32 animation_host_ = animation_host;
33 for (auto& player : players_) 33 for (auto& player : players_)
34 player->SetAnimationHost(animation_host); 34 player->SetAnimationHost(animation_host);
35 } 35 }
36 36
37 void AnimationTimeline::AttachPlayer(scoped_refptr<AnimationPlayer> player) { 37 void AnimationTimeline::AttachPlayer(scoped_refptr<AnimationPlayer> player) {
38 DCHECK(animation_host_);
39 player->SetAnimationHost(animation_host_); 38 player->SetAnimationHost(animation_host_);
39
40 player->SetAnimationTimeline(this); 40 player->SetAnimationTimeline(this);
41 players_.push_back(player); 41 players_.push_back(player);
42 } 42 }
43 43
44 void AnimationTimeline::DetachPlayer(scoped_refptr<AnimationPlayer> player) { 44 void AnimationTimeline::DetachPlayer(scoped_refptr<AnimationPlayer> player) {
45 for (AnimationPlayerList::iterator iter = players_.begin(); 45 for (AnimationPlayerList::iterator iter = players_.begin();
46 iter != players_.end(); ++iter) { 46 iter != players_.end(); ++iter) {
47 if (iter->get() != player) 47 if (iter->get() != player)
48 continue; 48 continue;
49 49
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void AnimationTimeline::PushPropertiesToImplThread( 111 void AnimationTimeline::PushPropertiesToImplThread(
112 AnimationTimeline* timeline_impl) { 112 AnimationTimeline* timeline_impl) {
113 for (auto& player : players_) { 113 for (auto& player : players_) {
114 AnimationPlayer* player_impl = timeline_impl->GetPlayerById(player->id()); 114 AnimationPlayer* player_impl = timeline_impl->GetPlayerById(player->id());
115 if (player_impl) 115 if (player_impl)
116 player->PushPropertiesTo(player_impl); 116 player->PushPropertiesTo(player_impl);
117 } 117 }
118 } 118 }
119 119
120 } // namespace cc 120 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698