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

Unified Diff: cc/test/CCAnimationTestCommon.cpp

Issue 11091057: [cc] Use base ptr types for cc's CSS animation classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ternary => if statement Created 8 years, 2 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/test/CCAnimationTestCommon.h ('k') | webkit/compositor_bindings/WebAnimationCurveCommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/CCAnimationTestCommon.cpp
diff --git a/cc/test/CCAnimationTestCommon.cpp b/cc/test/CCAnimationTestCommon.cpp
index 6b7801ce28b3139a6f8c585774cd56b8ef3ec94b..884b9fe5a82de0d55beb495e822f00595c4dc25a 100644
--- a/cc/test/CCAnimationTestCommon.cpp
+++ b/cc/test/CCAnimationTestCommon.cpp
@@ -19,38 +19,38 @@ namespace {
template <class Target>
void addOpacityTransition(Target& target, double duration, float startOpacity, float endOpacity, bool useTimingFunction)
{
- OwnPtr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
+ scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
if (duration > 0)
- curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, useTimingFunction ? nullptr : CCEaseTimingFunction::create()));
- curve->addKeyframe(CCFloatKeyframe::create(duration, endOpacity, nullptr));
+ curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, useTimingFunction ? scoped_ptr<CCTimingFunction>(): CCEaseTimingFunction::create()));
+ curve->addKeyframe(CCFloatKeyframe::create(duration, endOpacity, scoped_ptr<cc::CCTimingFunction>()));
- OwnPtr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.release(), 0, 0, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), 0, 0, CCActiveAnimation::Opacity));
animation->setNeedsSynchronizedStartTime(true);
- target.addAnimation(animation.release());
+ target.addAnimation(animation.Pass());
}
template <class Target>
void addAnimatedTransform(Target& target, double duration, int deltaX, int deltaY)
{
static int id = 0;
- OwnPtr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
+ scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
if (duration > 0) {
WebKit::WebTransformOperations startOperations;
startOperations.appendTranslate(deltaX, deltaY, 0);
- curve->addKeyframe(CCTransformKeyframe::create(0, startOperations, nullptr));
+ curve->addKeyframe(CCTransformKeyframe::create(0, startOperations, scoped_ptr<cc::CCTimingFunction>()));
}
WebKit::WebTransformOperations operations;
operations.appendTranslate(deltaX, deltaY, 0);
- curve->addKeyframe(CCTransformKeyframe::create(duration, operations, nullptr));
+ curve->addKeyframe(CCTransformKeyframe::create(duration, operations, scoped_ptr<cc::CCTimingFunction>()));
- OwnPtr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.release(), id++, 0, CCActiveAnimation::Transform));
+ scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), id++, 0, CCActiveAnimation::Transform));
animation->setNeedsSynchronizedStartTime(true);
- target.addAnimation(animation.release());
+ target.addAnimation(animation.Pass());
}
} // namespace
@@ -81,9 +81,9 @@ float FakeFloatAnimationCurve::getValue(double now) const
return 0;
}
-PassOwnPtr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const
+scoped_ptr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const
{
- return adoptPtr(new FakeFloatAnimationCurve);
+ return make_scoped_ptr(new FakeFloatAnimationCurve).PassAs<cc::CCAnimationCurve>();
}
FakeTransformTransition::FakeTransformTransition(double duration)
@@ -105,9 +105,9 @@ WebKit::WebTransformationMatrix FakeTransformTransition::getValue(double time) c
return WebKit::WebTransformationMatrix();
}
-PassOwnPtr<cc::CCAnimationCurve> FakeTransformTransition::clone() const
+scoped_ptr<cc::CCAnimationCurve> FakeTransformTransition::clone() const
{
- return adoptPtr(new FakeTransformTransition(*this));
+ return make_scoped_ptr(new FakeTransformTransition(*this)).PassAs<cc::CCAnimationCurve>();
}
@@ -169,9 +169,9 @@ const WebKit::WebTransformationMatrix& FakeLayerAnimationControllerClient::trans
return m_transform;
}
-PassOwnPtr<cc::CCAnimationCurve> FakeFloatTransition::clone() const
+scoped_ptr<cc::CCAnimationCurve> FakeFloatTransition::clone() const
{
- return adoptPtr(new FakeFloatTransition(*this));
+ return make_scoped_ptr(new FakeFloatTransition(*this)).PassAs<cc::CCAnimationCurve>();
}
void addOpacityTransitionToController(cc::CCLayerAnimationController& controller, double duration, float startOpacity, float endOpacity, bool useTimingFunction)
« no previous file with comments | « cc/test/CCAnimationTestCommon.h ('k') | webkit/compositor_bindings/WebAnimationCurveCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698