OLD | NEW |
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_player.h" | 5 #include "cc/animation/animation_player.h" |
6 | 6 |
7 #include "cc/animation/animation_delegate.h" | 7 #include "cc/animation/animation_delegate.h" |
8 #include "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
9 #include "cc/animation/animation_timeline.h" | 9 #include "cc/animation/animation_timeline.h" |
10 #include "cc/animation/element_animations.h" | 10 #include "cc/animation/element_animations.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } else { | 146 } else { |
147 auto animations_to_remove = | 147 auto animations_to_remove = |
148 std::remove_if(animations_.begin(), animations_.end(), | 148 std::remove_if(animations_.begin(), animations_.end(), |
149 [animation_id](const scoped_ptr<Animation>& animation) { | 149 [animation_id](const scoped_ptr<Animation>& animation) { |
150 return animation->id() == animation_id; | 150 return animation->id() == animation_id; |
151 }); | 151 }); |
152 animations_.erase(animations_to_remove, animations_.end()); | 152 animations_.erase(animations_to_remove, animations_.end()); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
| 156 void AnimationPlayer::AbortAnimation(int animation_id) { |
| 157 DCHECK(element_animations_); |
| 158 element_animations_->layer_animation_controller()->AbortAnimation( |
| 159 animation_id); |
| 160 SetNeedsCommit(); |
| 161 } |
| 162 |
156 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) { | 163 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) { |
157 if (!element_animations_) { | 164 if (!element_animations_) { |
158 if (player_impl->element_animations()) | 165 if (player_impl->element_animations()) |
159 player_impl->DetachLayer(); | 166 player_impl->DetachLayer(); |
160 return; | 167 return; |
161 } | 168 } |
162 | 169 |
163 DCHECK(layer_id_); | 170 DCHECK(layer_id_); |
164 if (!player_impl->element_animations()) | 171 if (!player_impl->element_animations()) |
165 player_impl->AttachLayer(layer_id_); | 172 player_impl->AttachLayer(layer_id_); |
(...skipping 17 matching lines...) Expand all Loading... |
183 target_property, group); | 190 target_property, group); |
184 } | 191 } |
185 | 192 |
186 void AnimationPlayer::SetNeedsCommit() { | 193 void AnimationPlayer::SetNeedsCommit() { |
187 DCHECK(animation_host_); | 194 DCHECK(animation_host_); |
188 animation_host_->SetNeedsCommit(); | 195 animation_host_->SetNeedsCommit(); |
189 animation_host_->SetNeedsRebuildPropertyTrees(); | 196 animation_host_->SetNeedsRebuildPropertyTrees(); |
190 } | 197 } |
191 | 198 |
192 } // namespace cc | 199 } // namespace cc |
OLD | NEW |