| 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 "cc/keyframed_animation_curve.h" | 5 #include "cc/animation/keyframed_animation_curve.h" |
| 6 | 6 |
| 7 namespace cc { | 7 namespace cc { |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| 11 template <class Keyframe> | 11 template <class Keyframe> |
| 12 void InsertKeyframe(scoped_ptr<Keyframe> keyframe, | 12 void InsertKeyframe(scoped_ptr<Keyframe> keyframe, |
| 13 ScopedPtrVector<Keyframe>& keyframes) { | 13 ScopedPtrVector<Keyframe>& keyframes) { |
| 14 // Usually, the keyframes will be added in order, so this loop would be | 14 // Usually, the keyframes will be added in order, so this loop would be |
| 15 // unnecessary and we should skip it if possible. | 15 // unnecessary and we should skip it if possible. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 double progress = (t - keyframes_[i]->Time()) / | 191 double progress = (t - keyframes_[i]->Time()) / |
| 192 (keyframes_[i+1]->Time() - keyframes_[i]->Time()); | 192 (keyframes_[i+1]->Time() - keyframes_[i]->Time()); |
| 193 | 193 |
| 194 if (keyframes_[i]->timing_function()) | 194 if (keyframes_[i]->timing_function()) |
| 195 progress = keyframes_[i]->timing_function()->GetValue(progress); | 195 progress = keyframes_[i]->timing_function()->GetValue(progress); |
| 196 | 196 |
| 197 return keyframes_[i+1]->Value().Blend(keyframes_[i]->Value(), progress); | 197 return keyframes_[i+1]->Value().Blend(keyframes_[i]->Value(), progress); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace cc | 200 } // namespace cc |
| OLD | NEW |