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

Unified Diff: cc/animation/keyframed_animation_curve_unittest.cc

Issue 642983003: cc: Make PictureLayerImpl use a better choice for animated raster scale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: animationscale: fixes Created 6 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
Index: cc/animation/keyframed_animation_curve_unittest.cc
diff --git a/cc/animation/keyframed_animation_curve_unittest.cc b/cc/animation/keyframed_animation_curve_unittest.cc
index 9ce1fdbac014c1a2f89f742441b7467f648e31b2..0476cd85c5eeb84698098742cfdfd4198e829244 100644
--- a/cc/animation/keyframed_animation_curve_unittest.cc
+++ b/cc/animation/keyframed_animation_curve_unittest.cc
@@ -523,7 +523,7 @@ TEST(KeyframedAnimationCurveTest, MaximumScale) {
1.0, operations1, EaseTimingFunction::Create()));
float maximum_scale = 0.f;
- EXPECT_TRUE(curve->MaximumScale(&maximum_scale));
+ EXPECT_TRUE(curve->MaximumTargetScale(&maximum_scale));
EXPECT_EQ(3.f, maximum_scale);
TransformOperations operations2;
@@ -531,7 +531,7 @@ TEST(KeyframedAnimationCurveTest, MaximumScale) {
curve->AddKeyframe(TransformKeyframe::Create(
2.0, operations2, EaseTimingFunction::Create()));
- EXPECT_TRUE(curve->MaximumScale(&maximum_scale));
+ EXPECT_TRUE(curve->MaximumTargetScale(&maximum_scale));
EXPECT_EQ(6.f, maximum_scale);
TransformOperations operations3;
@@ -539,7 +539,21 @@ TEST(KeyframedAnimationCurveTest, MaximumScale) {
curve->AddKeyframe(TransformKeyframe::Create(
3.0, operations3, EaseTimingFunction::Create()));
- EXPECT_FALSE(curve->MaximumScale(&maximum_scale));
+ EXPECT_FALSE(curve->MaximumTargetScale(&maximum_scale));
+
+ // The original scale is not used in computing the max.
+ scoped_ptr<KeyframedTransformAnimationCurve> curve2(
+ KeyframedTransformAnimationCurve::Create());
+
+ TransformOperations operations4;
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ 0.0, operations4, EaseTimingFunction::Create()));
+ operations4.AppendScale(0.5f, 0.3f, -0.8f);
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ 1.0, operations4, EaseTimingFunction::Create()));
+
+ EXPECT_TRUE(curve2->MaximumTargetScale(&maximum_scale));
+ EXPECT_EQ(0.8f, maximum_scale);
}
// Tests that an animation with a curve timing function works as expected.

Powered by Google App Engine
This is Rietveld 408576698