| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 bool success = | 816 bool success = |
| 817 transform_animation_curve->AnimatedBoundsForBox(box, &animation_bounds); | 817 transform_animation_curve->AnimatedBoundsForBox(box, &animation_bounds); |
| 818 if (!success) | 818 if (!success) |
| 819 return false; | 819 return false; |
| 820 bounds->Union(animation_bounds); | 820 bounds->Union(animation_bounds); |
| 821 } | 821 } |
| 822 | 822 |
| 823 return true; | 823 return true; |
| 824 } | 824 } |
| 825 | 825 |
| 826 bool AnimationPlayer::HasAnimationThatAffectsScale() const { | |
| 827 for (size_t i = 0; i < animations_.size(); ++i) { | |
| 828 if (animations_[i]->is_finished() || | |
| 829 animations_[i]->target_property() != TargetProperty::TRANSFORM) | |
| 830 continue; | |
| 831 | |
| 832 const TransformAnimationCurve* transform_animation_curve = | |
| 833 animations_[i]->curve()->ToTransformAnimationCurve(); | |
| 834 if (transform_animation_curve->AffectsScale()) | |
| 835 return true; | |
| 836 } | |
| 837 | |
| 838 return false; | |
| 839 } | |
| 840 | |
| 841 bool AnimationPlayer::HasOnlyTranslationTransforms( | 826 bool AnimationPlayer::HasOnlyTranslationTransforms( |
| 842 ElementListType list_type) const { | 827 ElementListType list_type) const { |
| 843 for (size_t i = 0; i < animations_.size(); ++i) { | 828 for (size_t i = 0; i < animations_.size(); ++i) { |
| 844 if (animations_[i]->is_finished() || | 829 if (animations_[i]->is_finished() || |
| 845 animations_[i]->target_property() != TargetProperty::TRANSFORM) | 830 animations_[i]->target_property() != TargetProperty::TRANSFORM) |
| 846 continue; | 831 continue; |
| 847 | 832 |
| 848 if ((list_type == ElementListType::ACTIVE && | 833 if ((list_type == ElementListType::ACTIVE && |
| 849 !animations_[i]->affects_active_elements()) || | 834 !animations_[i]->affects_active_elements()) || |
| 850 (list_type == ElementListType::PENDING && | 835 (list_type == ElementListType::PENDING && |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 AnimationPlayer* animation_player_impl) { | 1125 AnimationPlayer* animation_player_impl) { |
| 1141 for (size_t i = 0; i < animations_.size(); ++i) { | 1126 for (size_t i = 0; i < animations_.size(); ++i) { |
| 1142 Animation* current_impl = | 1127 Animation* current_impl = |
| 1143 animation_player_impl->GetAnimationById(animations_[i]->id()); | 1128 animation_player_impl->GetAnimationById(animations_[i]->id()); |
| 1144 if (current_impl) | 1129 if (current_impl) |
| 1145 animations_[i]->PushPropertiesTo(current_impl); | 1130 animations_[i]->PushPropertiesTo(current_impl); |
| 1146 } | 1131 } |
| 1147 } | 1132 } |
| 1148 | 1133 |
| 1149 } // namespace cc | 1134 } // namespace cc |
| OLD | NEW |