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 "CCKeyframedAnimationCurve.h" | 7 #include "CCKeyframedAnimationCurve.h" |
8 | 8 |
9 #include <wtf/OwnPtr.h> | 9 #include <wtf/OwnPtr.h> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 return; | 28 return; |
29 } | 29 } |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 keyframes.append(keyframe.release()); | 33 keyframes.append(keyframe.release()); |
34 } | 34 } |
35 | 35 |
36 PassOwnPtr<CCTimingFunction> cloneTimingFunction(const CCTimingFunction* timingF
unction) | 36 PassOwnPtr<CCTimingFunction> cloneTimingFunction(const CCTimingFunction* timingF
unction) |
37 { | 37 { |
38 ASSERT(timingFunction); | 38 DCHECK(timingFunction); |
39 OwnPtr<CCAnimationCurve> curve(timingFunction->clone()); | 39 OwnPtr<CCAnimationCurve> curve(timingFunction->clone()); |
40 return adoptPtr(static_cast<CCTimingFunction*>(curve.leakPtr())); | 40 return adoptPtr(static_cast<CCTimingFunction*>(curve.leakPtr())); |
41 } | 41 } |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 CCKeyframe::CCKeyframe(double time, PassOwnPtr<CCTimingFunction> timingFunction) | 45 CCKeyframe::CCKeyframe(double time, PassOwnPtr<CCTimingFunction> timingFunction) |
46 : m_time(time) | 46 : m_time(time) |
47 , m_timingFunction(timingFunction) | 47 , m_timingFunction(timingFunction) |
48 { | 48 { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 double progress = (t - m_keyframes[i]->time()) / (m_keyframes[i+1]->time() -
m_keyframes[i]->time()); | 213 double progress = (t - m_keyframes[i]->time()) / (m_keyframes[i+1]->time() -
m_keyframes[i]->time()); |
214 | 214 |
215 if (m_keyframes[i]->timingFunction()) | 215 if (m_keyframes[i]->timingFunction()) |
216 progress = m_keyframes[i]->timingFunction()->getValue(progress); | 216 progress = m_keyframes[i]->timingFunction()->getValue(progress); |
217 | 217 |
218 return m_keyframes[i+1]->value().blend(m_keyframes[i]->value(), progress); | 218 return m_keyframes[i+1]->value().blend(m_keyframes[i]->value(), progress); |
219 } | 219 } |
220 | 220 |
221 } // namespace cc | 221 } // namespace cc |
OLD | NEW |