| 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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 std::remove_if(animations_.begin(), animations_.end(), | 1028 std::remove_if(animations_.begin(), animations_.end(), |
| 1029 [](const std::unique_ptr<Animation>& animation) { | 1029 [](const std::unique_ptr<Animation>& animation) { |
| 1030 return animation->run_state() == | 1030 return animation->run_state() == |
| 1031 Animation::WAITING_FOR_DELETION; | 1031 Animation::WAITING_FOR_DELETION; |
| 1032 }), | 1032 }), |
| 1033 animations_.end()); | 1033 animations_.end()); |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 void AnimationPlayer::PushNewAnimationsToImplThread( | 1036 void AnimationPlayer::PushNewAnimationsToImplThread( |
| 1037 AnimationPlayer* animation_player_impl) const { | 1037 AnimationPlayer* animation_player_impl) const { |
| 1038 // Any new animations owned by the main thread's ElementAnimations are cloned | 1038 // Any new animations owned by the main thread's AnimationPlayer are cloned |
| 1039 // and added to the impl thread's ElementAnimations. | 1039 // and added to the impl thread's AnimationPlayer. |
| 1040 for (size_t i = 0; i < animations_.size(); ++i) { | 1040 for (size_t i = 0; i < animations_.size(); ++i) { |
| 1041 // If the animation is already running on the impl thread, there is no | 1041 // If the animation is already running on the impl thread, there is no |
| 1042 // need to copy it over. | 1042 // need to copy it over. |
| 1043 if (animation_player_impl->GetAnimationById(animations_[i]->id())) | 1043 if (animation_player_impl->GetAnimationById(animations_[i]->id())) |
| 1044 continue; | 1044 continue; |
| 1045 | 1045 |
| 1046 if (animations_[i]->target_property() == TargetProperty::SCROLL_OFFSET && | 1046 if (animations_[i]->target_property() == TargetProperty::SCROLL_OFFSET && |
| 1047 !animations_[i] | 1047 !animations_[i] |
| 1048 ->curve() | 1048 ->curve() |
| 1049 ->ToScrollOffsetAnimationCurve() | 1049 ->ToScrollOffsetAnimationCurve() |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 AnimationPlayer* animation_player_impl) { | 1114 AnimationPlayer* animation_player_impl) { |
| 1115 for (size_t i = 0; i < animations_.size(); ++i) { | 1115 for (size_t i = 0; i < animations_.size(); ++i) { |
| 1116 Animation* current_impl = | 1116 Animation* current_impl = |
| 1117 animation_player_impl->GetAnimationById(animations_[i]->id()); | 1117 animation_player_impl->GetAnimationById(animations_[i]->id()); |
| 1118 if (current_impl) | 1118 if (current_impl) |
| 1119 animations_[i]->PushPropertiesTo(current_impl); | 1119 animations_[i]->PushPropertiesTo(current_impl); |
| 1120 } | 1120 } |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 } // namespace cc | 1123 } // namespace cc |
| OLD | NEW |