| 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_events.h" | 10 #include "cc/animation/animation_events.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } else if (!is_ticking_ && (was_ticking || force)) { | 323 } else if (!is_ticking_ && (was_ticking || force)) { |
| 324 RemoveFromTicking(); | 324 RemoveFromTicking(); |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 void AnimationPlayer::RemoveFromTicking() { | 329 void AnimationPlayer::RemoveFromTicking() { |
| 330 DCHECK(animation_host_); | 330 DCHECK(animation_host_); |
| 331 // Resetting last_tick_time_ here ensures that calling ::UpdateState | 331 // Resetting last_tick_time_ here ensures that calling ::UpdateState |
| 332 // before ::Animate doesn't start an animation. | 332 // before ::Animate doesn't start an animation. |
| 333 is_ticking_ = false; |
| 333 last_tick_time_ = base::TimeTicks(); | 334 last_tick_time_ = base::TimeTicks(); |
| 334 animation_host_->RemoveFromTicking(this); | 335 animation_host_->RemoveFromTicking(this); |
| 335 } | 336 } |
| 336 | 337 |
| 337 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) { | 338 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) { |
| 338 DCHECK(!event.is_impl_only); | 339 DCHECK(!event.is_impl_only); |
| 339 | 340 |
| 340 for (size_t i = 0; i < animations_.size(); ++i) { | 341 for (size_t i = 0; i < animations_.size(); ++i) { |
| 341 if (animations_[i]->group() == event.group_id && | 342 if (animations_[i]->group() == event.group_id && |
| 342 animations_[i]->target_property() == event.target_property && | 343 animations_[i]->target_property() == event.target_property && |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 if (current_impl) | 1196 if (current_impl) |
| 1196 animations_[i]->PushPropertiesTo(current_impl); | 1197 animations_[i]->PushPropertiesTo(current_impl); |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 animation_player_impl->scroll_offset_animation_was_interrupted_ = | 1200 animation_player_impl->scroll_offset_animation_was_interrupted_ = |
| 1200 scroll_offset_animation_was_interrupted_; | 1201 scroll_offset_animation_was_interrupted_; |
| 1201 scroll_offset_animation_was_interrupted_ = false; | 1202 scroll_offset_animation_was_interrupted_ = false; |
| 1202 } | 1203 } |
| 1203 | 1204 |
| 1204 } // namespace cc | 1205 } // namespace cc |
| OLD | NEW |