summaryrefslogtreecommitdiffstats
path: root/cc/animation/keyframed_animation_curve_unittest.cc
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-10-15 15:52:16 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-15 22:52:36 +0000
commit968153f336dfc187cdea3267c68caf07e8be6e6f (patch)
treebc4288d1acdbdb010a3a39742db631606b44304f /cc/animation/keyframed_animation_curve_unittest.cc
parentc762fb764c6812cc662b125ae69d3421064b1c45 (diff)
downloadchromium_src-968153f336dfc187cdea3267c68caf07e8be6e6f.zip
chromium_src-968153f336dfc187cdea3267c68caf07e8be6e6f.tar.gz
chromium_src-968153f336dfc187cdea3267c68caf07e8be6e6f.tar.bz2
cc: Change scoped_ptr<T>() to nullptr.
R=enne Review URL: https://codereview.chromium.org/657103003 Cr-Commit-Position: refs/heads/master@{#299782}
Diffstat (limited to 'cc/animation/keyframed_animation_curve_unittest.cc')
-rw-r--r--cc/animation/keyframed_animation_curve_unittest.cc204
1 files changed, 68 insertions, 136 deletions
diff --git a/cc/animation/keyframed_animation_curve_unittest.cc b/cc/animation/keyframed_animation_curve_unittest.cc
index 7a82fa2..32bc141 100644
--- a/cc/animation/keyframed_animation_curve_unittest.cc
+++ b/cc/animation/keyframed_animation_curve_unittest.cc
@@ -29,8 +29,7 @@ TEST(KeyframedAnimationCurveTest, OneColorKeyFrame) {
SkColor color = SkColorSetARGB(255, 255, 255, 255);
scoped_ptr<KeyframedColorAnimationCurve> curve(
KeyframedColorAnimationCurve::Create());
- curve->AddKeyframe(
- ColorKeyframe::Create(0.0, color, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(ColorKeyframe::Create(0.0, color, nullptr));
EXPECT_SKCOLOR_EQ(color, curve->GetValue(-1.f));
EXPECT_SKCOLOR_EQ(color, curve->GetValue(0.f));
@@ -46,10 +45,8 @@ TEST(KeyframedAnimationCurveTest, TwoColorKeyFrame) {
SkColor color_midpoint = gfx::Tween::ColorValueBetween(0.5, color_a, color_b);
scoped_ptr<KeyframedColorAnimationCurve> curve(
KeyframedColorAnimationCurve::Create());
- curve->AddKeyframe(
- ColorKeyframe::Create(0.0, color_a, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(1.0, color_b, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(ColorKeyframe::Create(0.0, color_a, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(1.0, color_b, nullptr));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(-1.f));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(0.f));
@@ -69,12 +66,9 @@ TEST(KeyframedAnimationCurveTest, ThreeColorKeyFrame) {
gfx::Tween::ColorValueBetween(0.5, color_b, color_c);
scoped_ptr<KeyframedColorAnimationCurve> curve(
KeyframedColorAnimationCurve::Create());
- curve->AddKeyframe(
- ColorKeyframe::Create(0.0, color_a, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(1.0, color_b, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(2.0, color_c, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(ColorKeyframe::Create(0.0, color_a, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(1.0, color_b, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(2.0, color_c, nullptr));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(-1.f));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(0.f));
@@ -92,14 +86,10 @@ TEST(KeyframedAnimationCurveTest, RepeatedColorKeyFrame) {
scoped_ptr<KeyframedColorAnimationCurve> curve(
KeyframedColorAnimationCurve::Create());
- curve->AddKeyframe(
- ColorKeyframe::Create(0.0, color_a, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(1.0, color_a, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(1.0, color_b, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- ColorKeyframe::Create(2.0, color_b, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(ColorKeyframe::Create(0.0, color_a, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(1.0, color_a, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(1.0, color_b, nullptr));
+ curve->AddKeyframe(ColorKeyframe::Create(2.0, color_b, nullptr));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(-1.f));
EXPECT_SKCOLOR_EQ(color_a, curve->GetValue(0.f));
@@ -120,8 +110,7 @@ TEST(KeyframedAnimationCurveTest, RepeatedColorKeyFrame) {
TEST(KeyframedAnimationCurveTest, OneFloatKeyframe) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 2.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 2.f, nullptr));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(-1.f));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(0.f));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(0.5f));
@@ -133,10 +122,8 @@ TEST(KeyframedAnimationCurveTest, OneFloatKeyframe) {
TEST(KeyframedAnimationCurveTest, TwoFloatKeyframe) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 2.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 4.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 2.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 4.f, nullptr));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(-1.f));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(0.f));
EXPECT_FLOAT_EQ(3.f, curve->GetValue(0.5f));
@@ -148,12 +135,9 @@ TEST(KeyframedAnimationCurveTest, TwoFloatKeyframe) {
TEST(KeyframedAnimationCurveTest, ThreeFloatKeyframe) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 2.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 4.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(2.0, 8.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 2.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 4.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(2.0, 8.f, nullptr));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(-1.f));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(0.f));
EXPECT_FLOAT_EQ(3.f, curve->GetValue(0.5f));
@@ -167,14 +151,10 @@ TEST(KeyframedAnimationCurveTest, ThreeFloatKeyframe) {
TEST(KeyframedAnimationCurveTest, RepeatedFloatKeyTimes) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 4.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 4.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 6.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(2.0, 6.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 4.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 4.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 6.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(2.0, 6.f, nullptr));
EXPECT_FLOAT_EQ(4.f, curve->GetValue(-1.f));
EXPECT_FLOAT_EQ(4.f, curve->GetValue(0.f));
@@ -195,8 +175,7 @@ TEST(KeyframedAnimationCurveTest, OneTransformKeyframe) {
KeyframedTransformAnimationCurve::Create());
TransformOperations operations;
operations.AppendTranslate(2.f, 0.f, 0.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(0.f, operations, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.f, operations, nullptr));
ExpectTranslateX(2.f, curve->GetValue(-1.f));
ExpectTranslateX(2.f, curve->GetValue(0.f));
@@ -214,10 +193,8 @@ TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe) {
TransformOperations operations2;
operations2.AppendTranslate(4.f, 0.f, 0.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(1.f, operations2, nullptr));
ExpectTranslateX(2.f, curve->GetValue(-1.f));
ExpectTranslateX(2.f, curve->GetValue(0.f));
ExpectTranslateX(3.f, curve->GetValue(0.5f));
@@ -235,12 +212,9 @@ TEST(KeyframedAnimationCurveTest, ThreeTransformKeyframe) {
operations2.AppendTranslate(4.f, 0.f, 0.f);
TransformOperations operations3;
operations3.AppendTranslate(8.f, 0.f, 0.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 2.f, operations3, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(1.f, operations2, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(2.f, operations3, nullptr));
ExpectTranslateX(2.f, curve->GetValue(-1.f));
ExpectTranslateX(2.f, curve->GetValue(0.f));
ExpectTranslateX(3.f, curve->GetValue(0.5f));
@@ -264,14 +238,10 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes) {
operations3.AppendTranslate(6.f, 0.f, 0.f);
TransformOperations operations4;
operations4.AppendTranslate(6.f, 0.f, 0.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.f, operations3, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(TransformKeyframe::Create(
- 2.f, operations4, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(1.f, operations2, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(1.f, operations3, nullptr));
+ curve->AddKeyframe(TransformKeyframe::Create(2.f, operations4, nullptr));
ExpectTranslateX(4.f, curve->GetValue(-1.f));
ExpectTranslateX(4.f, curve->GetValue(0.f));
@@ -293,8 +263,7 @@ TEST(KeyframedAnimationCurveTest, OneFilterKeyframe) {
KeyframedFilterAnimationCurve::Create());
FilterOperations operations;
operations.Append(FilterOperation::CreateBrightnessFilter(2.f));
- curve->AddKeyframe(
- FilterKeyframe::Create(0.f, operations, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FilterKeyframe::Create(0.f, operations, nullptr));
ExpectBrightness(2.f, curve->GetValue(-1.f));
ExpectBrightness(2.f, curve->GetValue(0.f));
@@ -312,10 +281,8 @@ TEST(KeyframedAnimationCurveTest, TwoFilterKeyframe) {
FilterOperations operations2;
operations2.Append(FilterOperation::CreateBrightnessFilter(4.f));
- curve->AddKeyframe(FilterKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FilterKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(1.f, operations2, nullptr));
ExpectBrightness(2.f, curve->GetValue(-1.f));
ExpectBrightness(2.f, curve->GetValue(0.f));
ExpectBrightness(3.f, curve->GetValue(0.5f));
@@ -333,12 +300,9 @@ TEST(KeyframedAnimationCurveTest, ThreeFilterKeyframe) {
operations2.Append(FilterOperation::CreateBrightnessFilter(4.f));
FilterOperations operations3;
operations3.Append(FilterOperation::CreateBrightnessFilter(8.f));
- curve->AddKeyframe(FilterKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 2.f, operations3, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FilterKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(1.f, operations2, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(2.f, operations3, nullptr));
ExpectBrightness(2.f, curve->GetValue(-1.f));
ExpectBrightness(2.f, curve->GetValue(0.f));
ExpectBrightness(3.f, curve->GetValue(0.5f));
@@ -362,14 +326,10 @@ TEST(KeyframedAnimationCurveTest, RepeatedFilterKeyTimes) {
operations3.Append(FilterOperation::CreateBrightnessFilter(6.f));
FilterOperations operations4;
operations4.Append(FilterOperation::CreateBrightnessFilter(6.f));
- curve->AddKeyframe(FilterKeyframe::Create(
- 0.f, operations1, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 1.f, operations2, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 1.f, operations3, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(FilterKeyframe::Create(
- 2.f, operations4, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FilterKeyframe::Create(0.f, operations1, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(1.f, operations2, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(1.f, operations3, nullptr));
+ curve->AddKeyframe(FilterKeyframe::Create(2.f, operations4, nullptr));
ExpectBrightness(4.f, curve->GetValue(-1.f));
ExpectBrightness(4.f, curve->GetValue(0.f));
@@ -391,12 +351,9 @@ TEST(KeyframedAnimationCurveTest, RepeatedFilterKeyTimes) {
TEST(KeyframedAnimationCurveTest, UnsortedKeyframes) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(2.0, 8.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 2.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 4.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(2.0, 8.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 2.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 4.f, nullptr));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(-1.f));
EXPECT_FLOAT_EQ(2.f, curve->GetValue(0.f));
EXPECT_FLOAT_EQ(3.f, curve->GetValue(0.5f));
@@ -412,8 +369,7 @@ TEST(KeyframedAnimationCurveTest, CubicBezierTimingFunction) {
KeyframedFloatAnimationCurve::Create());
curve->AddKeyframe(FloatKeyframe::Create(
0.0, 0.f, CubicBezierTimingFunction::Create(0.25f, 0.f, 0.75f, 1.f)));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 1.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 1.f, nullptr));
EXPECT_FLOAT_EQ(0.f, curve->GetValue(0.f));
EXPECT_LT(0.f, curve->GetValue(0.25f));
@@ -430,11 +386,9 @@ TEST(KeyframedAnimationCurveTest, AnimatedBounds) {
KeyframedTransformAnimationCurve::Create());
TransformOperations operations1;
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.0, operations1, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.0, operations1, nullptr));
operations1.AppendTranslate(2.0, 3.0, -1.0);
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.5, operations1, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.5, operations1, nullptr));
TransformOperations operations2;
operations2.AppendTranslate(4.0, 1.0, 2.0);
curve->AddKeyframe(TransformKeyframe::Create(
@@ -454,27 +408,23 @@ TEST(KeyframedAnimationCurveTest, AffectsScale) {
KeyframedTransformAnimationCurve::Create());
TransformOperations operations1;
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.0, operations1, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.0, operations1, nullptr));
operations1.AppendTranslate(2.0, 3.0, -1.0);
TransformOperations operations2;
operations2.AppendTranslate(4.0, 1.0, 2.0);
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.0, operations2, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(1.0, operations2, nullptr));
EXPECT_FALSE(curve->AffectsScale());
TransformOperations operations3;
operations3.AppendScale(2.f, 2.f, 2.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 2.0, operations3, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(2.0, operations3, nullptr));
EXPECT_TRUE(curve->AffectsScale());
TransformOperations operations4;
operations3.AppendTranslate(2.f, 2.f, 2.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 3.0, operations4, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(3.0, operations4, nullptr));
EXPECT_TRUE(curve->AffectsScale());
}
@@ -485,27 +435,23 @@ TEST(KeyframedAnimationCurveTest, IsTranslation) {
KeyframedTransformAnimationCurve::Create());
TransformOperations operations1;
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.0, operations1, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.0, operations1, nullptr));
operations1.AppendTranslate(2.0, 3.0, -1.0);
TransformOperations operations2;
operations2.AppendTranslate(4.0, 1.0, 2.0);
- curve->AddKeyframe(TransformKeyframe::Create(
- 1.0, operations2, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(1.0, operations2, nullptr));
EXPECT_TRUE(curve->IsTranslation());
TransformOperations operations3;
operations3.AppendScale(2.f, 2.f, 2.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 2.0, operations3, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(2.0, operations3, nullptr));
EXPECT_FALSE(curve->IsTranslation());
TransformOperations operations4;
operations3.AppendTranslate(2.f, 2.f, 2.f);
- curve->AddKeyframe(TransformKeyframe::Create(
- 3.0, operations4, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(3.0, operations4, nullptr));
EXPECT_FALSE(curve->IsTranslation());
}
@@ -516,8 +462,7 @@ TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
KeyframedTransformAnimationCurve::Create());
TransformOperations operations1;
- curve->AddKeyframe(TransformKeyframe::Create(
- 0.0, operations1, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(TransformKeyframe::Create(0.0, operations1, nullptr));
operations1.AppendScale(2.f, -3.f, 1.f);
curve->AddKeyframe(TransformKeyframe::Create(
1.0, operations1, EaseTimingFunction::Create()));
@@ -565,10 +510,8 @@ TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
TEST(KeyframedAnimationCurveTest, CurveTiming) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 0.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 1.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 0.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 1.f, nullptr));
curve->SetTimingFunction(
CubicBezierTimingFunction::Create(0.75f, 0.f, 0.25f, 1.f).Pass());
EXPECT_FLOAT_EQ(0.f, curve->GetValue(-1.f));
@@ -589,8 +532,7 @@ TEST(KeyframedAnimationCurveTest, CurveAndKeyframeTiming) {
0.0,
0.f,
CubicBezierTimingFunction::Create(0.35f, 0.f, 0.65f, 1.f).Pass()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 1.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 1.f, nullptr));
// Curve timing function producing outputs outside of range [0,1].
curve->SetTimingFunction(
CubicBezierTimingFunction::Create(0.5f, -0.5f, 0.5f, 1.5f).Pass());
@@ -610,16 +552,11 @@ TEST(KeyframedAnimationCurveTest, CurveAndKeyframeTiming) {
TEST(KeyframedAnimationCurveTest, CurveTimingMultipleKeyframes) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 0.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 1.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(2.0, 3.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(3.0, 6.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(4.0, 9.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 0.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 1.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(2.0, 3.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(3.0, 6.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(4.0, 9.f, nullptr));
curve->SetTimingFunction(
CubicBezierTimingFunction::Create(0.5f, 0.f, 0.5f, 1.f).Pass());
EXPECT_FLOAT_EQ(0.f, curve->GetValue(-1.f));
@@ -637,16 +574,11 @@ TEST(KeyframedAnimationCurveTest, CurveTimingMultipleKeyframes) {
TEST(KeyframedAnimationCurveTest, CurveTimingOvershootMultipeKeyframes) {
scoped_ptr<KeyframedFloatAnimationCurve> curve(
KeyframedFloatAnimationCurve::Create());
- curve->AddKeyframe(
- FloatKeyframe::Create(0.0, 0.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(1.0, 1.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(2.0, 3.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(3.0, 6.f, scoped_ptr<TimingFunction>()));
- curve->AddKeyframe(
- FloatKeyframe::Create(4.0, 9.f, scoped_ptr<TimingFunction>()));
+ curve->AddKeyframe(FloatKeyframe::Create(0.0, 0.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(1.0, 1.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(2.0, 3.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(3.0, 6.f, nullptr));
+ curve->AddKeyframe(FloatKeyframe::Create(4.0, 9.f, nullptr));
// Curve timing function producing outputs outside of range [0,1].
curve->SetTimingFunction(
CubicBezierTimingFunction::Create(0.5f, -0.5f, 0.5f, 1.5f).Pass());