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 |
11 using WebKit::WebTransformationMatrix; | 11 using WebKit::WebTransformationMatrix; |
12 | 12 |
13 namespace WebCore { | 13 namespace cc { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 template <class Keyframe> | 17 template <class Keyframe> |
18 void insertKeyframe(PassOwnPtr<Keyframe> popKeyframe, Vector<OwnPtr<Keyframe> >&
keyframes) | 18 void insertKeyframe(PassOwnPtr<Keyframe> popKeyframe, Vector<OwnPtr<Keyframe> >&
keyframes) |
19 { | 19 { |
20 OwnPtr<Keyframe> keyframe = popKeyframe; | 20 OwnPtr<Keyframe> keyframe = popKeyframe; |
21 | 21 |
22 // Usually, the keyframes will be added in order, so this loop would be unne
cessary and | 22 // Usually, the keyframes will be added in order, so this loop would be unne
cessary and |
23 // we should skip it if possible. | 23 // we should skip it if possible. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
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 WebCore | 221 } // namespace cc |
OLD | NEW |