OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerAnimationController.h" | 7 #include "CCLayerAnimationController.h" |
8 | 8 |
9 #include "CCActiveAnimation.h" | 9 #include "CCActiveAnimation.h" |
10 #include "CCKeyframedAnimationCurve.h" | 10 #include "CCKeyframedAnimationCurve.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void CCLayerAnimationController::addAnimation(PassOwnPtr<CCActiveAnimation> anim
ation) | 111 void CCLayerAnimationController::addAnimation(PassOwnPtr<CCActiveAnimation> anim
ation) |
112 { | 112 { |
113 m_activeAnimations.append(animation); | 113 m_activeAnimations.append(animation); |
114 } | 114 } |
115 | 115 |
116 CCActiveAnimation* CCLayerAnimationController::getActiveAnimation(int groupId, C
CActiveAnimation::TargetProperty targetProperty) const | 116 CCActiveAnimation* CCLayerAnimationController::getActiveAnimation(int groupId, C
CActiveAnimation::TargetProperty targetProperty) const |
117 { | 117 { |
118 for (size_t i = 0; i < m_activeAnimations.size(); ++i) | 118 for (size_t i = 0; i < m_activeAnimations.size(); ++i) |
119 if (m_activeAnimations[i]->group() == groupId && m_activeAnimations[i]->
targetProperty() == targetProperty) | 119 if (m_activeAnimations[i]->group() == groupId && m_activeAnimations[i]->
targetProperty() == targetProperty) |
120 return m_activeAnimations[i].get(); | 120 return m_activeAnimations[i]; |
121 return 0; | 121 return 0; |
122 } | 122 } |
123 | 123 |
124 CCActiveAnimation* CCLayerAnimationController::getActiveAnimation(CCActiveAnimat
ion::TargetProperty targetProperty) const | 124 CCActiveAnimation* CCLayerAnimationController::getActiveAnimation(CCActiveAnimat
ion::TargetProperty targetProperty) const |
125 { | 125 { |
126 for (size_t i = 0; i < m_activeAnimations.size(); ++i) { | 126 for (size_t i = 0; i < m_activeAnimations.size(); ++i) { |
127 size_t index = m_activeAnimations.size() - i - 1; | 127 size_t index = m_activeAnimations.size() - i - 1; |
128 if (m_activeAnimations[index]->targetProperty() == targetProperty) | 128 if (m_activeAnimations[index]->targetProperty() == targetProperty) |
129 return m_activeAnimations[index].get(); | 129 return m_activeAnimations[index]; |
130 } | 130 } |
131 return 0; | 131 return 0; |
132 } | 132 } |
133 | 133 |
134 bool CCLayerAnimationController::hasActiveAnimation() const | 134 bool CCLayerAnimationController::hasActiveAnimation() const |
135 { | 135 { |
136 for (size_t i = 0; i < m_activeAnimations.size(); ++i) { | 136 for (size_t i = 0; i < m_activeAnimations.size(); ++i) { |
137 if (!m_activeAnimations[i]->isFinished()) | 137 if (!m_activeAnimations[i]->isFinished()) |
138 return true; | 138 return true; |
139 } | 139 } |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // Do nothing for sentinel value. | 398 // Do nothing for sentinel value. |
399 case CCActiveAnimation::TargetPropertyEnumSize: | 399 case CCActiveAnimation::TargetPropertyEnumSize: |
400 ASSERT_NOT_REACHED(); | 400 ASSERT_NOT_REACHED(); |
401 | 401 |
402 } | 402 } |
403 } | 403 } |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 } // namespace cc | 407 } // namespace cc |
OLD | NEW |