Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: cc/CCKeyframedAnimationCurve.cpp

Issue 10940002: Add wrapper container for a vector of OwnPtr<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/CCKeyframedAnimationCurve.h ('k') | cc/CCLayerAnimationController.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 cc { 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, OwnPtrVector<Keyframe>& ke yframes)
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.
24 if (!keyframes.isEmpty() && keyframe->time() < keyframes.last()->time()) { 24 if (!keyframes.isEmpty() && keyframe->time() < keyframes.last()->time()) {
25 for (size_t i = 0; i < keyframes.size(); ++i) { 25 for (size_t i = 0; i < keyframes.size(); ++i) {
26 if (keyframe->time() < keyframes[i]->time()) { 26 if (keyframe->time() < keyframes[i]->time()) {
27 keyframes.insert(i, keyframe.release()); 27 keyframes.insert(i, keyframe.release());
28 return; 28 return;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « cc/CCKeyframedAnimationCurve.h ('k') | cc/CCLayerAnimationController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698