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

Unified Diff: cc/keyframed_animation_curve.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/layer_animation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/keyframed_animation_curve.cc
diff --git a/cc/keyframed_animation_curve.cc b/cc/keyframed_animation_curve.cc
index 9cf0ef37e14343565988e9e3a755d7e82453c2b7..ef03357a26a30e96238c0a947a8c32f0787214d2 100644
--- a/cc/keyframed_animation_curve.cc
+++ b/cc/keyframed_animation_curve.cc
@@ -15,16 +15,16 @@ void insertKeyframe(scoped_ptr<Keyframe> keyframe, ScopedPtrVector<Keyframe>& ke
{
// Usually, the keyframes will be added in order, so this loop would be unnecessary and
// we should skip it if possible.
- if (!keyframes.isEmpty() && keyframe->time() < keyframes.last()->time()) {
+ if (!keyframes.empty() && keyframe->time() < keyframes.back()->time()) {
for (size_t i = 0; i < keyframes.size(); ++i) {
if (keyframe->time() < keyframes[i]->time()) {
- keyframes.insert(i, keyframe.Pass());
+ keyframes.insert(keyframes.begin() + i, keyframe.Pass());
return;
}
}
}
- keyframes.append(keyframe.Pass());
+ keyframes.push_back(keyframe.Pass());
}
scoped_ptr<TimingFunction> cloneTimingFunction(const TimingFunction* timingFunction)
@@ -132,7 +132,7 @@ void KeyframedFloatAnimationCurve::addKeyframe(scoped_ptr<FloatKeyframe> keyfram
double KeyframedFloatAnimationCurve::duration() const
{
- return m_keyframes.last()->time() - m_keyframes.first()->time();
+ return m_keyframes.back()->time() - m_keyframes.front()->time();
}
scoped_ptr<AnimationCurve> KeyframedFloatAnimationCurve::clone() const
@@ -145,11 +145,11 @@ scoped_ptr<AnimationCurve> KeyframedFloatAnimationCurve::clone() const
float KeyframedFloatAnimationCurve::getValue(double t) const
{
- if (t <= m_keyframes.first()->time())
- return m_keyframes.first()->value();
+ if (t <= m_keyframes.front()->time())
+ return m_keyframes.front()->value();
- if (t >= m_keyframes.last()->time())
- return m_keyframes.last()->value();
+ if (t >= m_keyframes.back()->time())
+ return m_keyframes.back()->value();
size_t i = 0;
for (; i < m_keyframes.size() - 1; ++i) {
@@ -185,7 +185,7 @@ void KeyframedTransformAnimationCurve::addKeyframe(scoped_ptr<TransformKeyframe>
double KeyframedTransformAnimationCurve::duration() const
{
- return m_keyframes.last()->time() - m_keyframes.first()->time();
+ return m_keyframes.back()->time() - m_keyframes.front()->time();
}
scoped_ptr<AnimationCurve> KeyframedTransformAnimationCurve::clone() const
@@ -198,11 +198,11 @@ scoped_ptr<AnimationCurve> KeyframedTransformAnimationCurve::clone() const
WebTransformationMatrix KeyframedTransformAnimationCurve::getValue(double t) const
{
- if (t <= m_keyframes.first()->time())
- return m_keyframes.first()->value().apply();
+ if (t <= m_keyframes.front()->time())
+ return m_keyframes.front()->value().apply();
- if (t >= m_keyframes.last()->time())
- return m_keyframes.last()->value().apply();
+ if (t >= m_keyframes.back()->time())
+ return m_keyframes.back()->value().apply();
size_t i = 0;
for (; i < m_keyframes.size() - 1; ++i) {
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698