| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/animation/animation_delegate.h" | 9 #include "cc/animation/animation_delegate.h" |
| 10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) { | 174 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) { |
| 175 if (element_id_ != player_impl->element_id()) { | 175 if (element_id_ != player_impl->element_id()) { |
| 176 if (player_impl->element_id()) | 176 if (player_impl->element_id()) |
| 177 player_impl->DetachElement(); | 177 player_impl->DetachElement(); |
| 178 if (element_id_) | 178 if (element_id_) |
| 179 player_impl->AttachElement(element_id_); | 179 player_impl->AttachElement(element_id_); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 void AnimationPlayer::NotifyAnimationStarted( | 183 void AnimationPlayer::OnAnimationStarted(base::TimeTicks monotonic_time, |
| 184 base::TimeTicks monotonic_time, | 184 TargetProperty::Type target_property, |
| 185 TargetProperty::Type target_property, | 185 int group) { |
| 186 int group) { | |
| 187 if (animation_delegate_) | 186 if (animation_delegate_) |
| 188 animation_delegate_->NotifyAnimationStarted(monotonic_time, target_property, | 187 animation_delegate_->NotifyAnimationStarted(monotonic_time, target_property, |
| 189 group); | 188 group); |
| 190 } | 189 } |
| 191 | 190 |
| 192 void AnimationPlayer::NotifyAnimationFinished( | 191 void AnimationPlayer::OnAnimationFinished(base::TimeTicks monotonic_time, |
| 193 base::TimeTicks monotonic_time, | 192 TargetProperty::Type target_property, |
| 194 TargetProperty::Type target_property, | 193 int group) { |
| 195 int group) { | |
| 196 if (animation_delegate_) | 194 if (animation_delegate_) |
| 197 animation_delegate_->NotifyAnimationFinished(monotonic_time, | 195 animation_delegate_->NotifyAnimationFinished(monotonic_time, |
| 198 target_property, group); | 196 target_property, group); |
| 199 } | 197 } |
| 200 | 198 |
| 201 void AnimationPlayer::NotifyAnimationAborted( | 199 void AnimationPlayer::OnAnimationAborted(base::TimeTicks monotonic_time, |
| 202 base::TimeTicks monotonic_time, | 200 TargetProperty::Type target_property, |
| 203 TargetProperty::Type target_property, | 201 int group) { |
| 204 int group) { | |
| 205 if (animation_delegate_) | 202 if (animation_delegate_) |
| 206 animation_delegate_->NotifyAnimationAborted(monotonic_time, target_property, | 203 animation_delegate_->NotifyAnimationAborted(monotonic_time, target_property, |
| 207 group); | 204 group); |
| 208 } | 205 } |
| 209 | 206 |
| 210 void AnimationPlayer::NotifyAnimationTakeover( | 207 void AnimationPlayer::OnAnimationTakeover( |
| 211 base::TimeTicks monotonic_time, | 208 base::TimeTicks monotonic_time, |
| 212 TargetProperty::Type target_property, | 209 TargetProperty::Type target_property, |
| 213 double animation_start_time, | 210 double animation_start_time, |
| 214 std::unique_ptr<AnimationCurve> curve) { | 211 std::unique_ptr<AnimationCurve> curve) { |
| 215 if (animation_delegate_) { | 212 if (animation_delegate_) { |
| 216 DCHECK(curve); | 213 DCHECK(curve); |
| 217 animation_delegate_->NotifyAnimationTakeover( | 214 animation_delegate_->NotifyAnimationTakeover( |
| 218 monotonic_time, target_property, animation_start_time, | 215 monotonic_time, target_property, animation_start_time, |
| 219 std::move(curve)); | 216 std::move(curve)); |
| 220 } | 217 } |
| 221 } | 218 } |
| 222 | 219 |
| 223 void AnimationPlayer::SetNeedsCommit() { | 220 void AnimationPlayer::SetNeedsCommit() { |
| 224 DCHECK(animation_host_); | 221 DCHECK(animation_host_); |
| 225 animation_host_->SetNeedsCommit(); | 222 animation_host_->SetNeedsCommit(); |
| 226 animation_host_->SetNeedsRebuildPropertyTrees(); | 223 animation_host_->SetNeedsRebuildPropertyTrees(); |
| 227 } | 224 } |
| 228 | 225 |
| 229 } // namespace cc | 226 } // namespace cc |
| OLD | NEW |