Chromium Code Reviews| Index: cc/animation/transform_operations_unittest.cc |
| diff --git a/cc/animation/transform_operations_unittest.cc b/cc/animation/transform_operations_unittest.cc |
| index ce7d12114ec4f360f0dad9257e6a4a286fe33e28..2f2ddca683a714523420bc2fe4ca95da43aa9987 100644 |
| --- a/cc/animation/transform_operations_unittest.cc |
| +++ b/cc/animation/transform_operations_unittest.cc |
| @@ -1219,15 +1219,39 @@ TEST(TransformOperationTest, BlendedBoundsForSkew) { |
| } |
| } |
| +TEST(TransformOperationTest, NonCommutativeRotations) { |
| + TransformOperations operations_from; |
| + operations_from.AppendRotate(1.0, 0.0, 0.0, 0.0); |
| + operations_from.AppendRotate(0.0, 1.0, 0.0, 0.0); |
| + TransformOperations operations_to; |
| + operations_to.AppendRotate(1.0, 0.0, 0.0, 45.0); |
| + operations_to.AppendRotate(0.0, 1.0, 0.0, 135.0); |
| + |
| + gfx::BoxF box(0, 0, 0, 1, 1, 1); |
| + gfx::BoxF bounds; |
| + |
| + SkMScalar min_progress = 0.0f; |
| + SkMScalar max_progress = 1.0f; |
| + EXPECT_TRUE(operations_to.BlendedBoundsForBox( |
| + box, operations_from, min_progress, max_progress, &bounds)); |
| + gfx::Transform blendedTransform = |
|
ajuma
2014/05/27 16:00:54
nit: blended_transform
awoloszyn
2014/05/27 16:08:09
Thanks! Turns out my brain was still at least part
|
| + operations_to.Blend(operations_from, max_progress); |
| + gfx::Point3F blendedPoint(0.9, 0.9, 0); |
|
ajuma
2014/05/27 16:00:54
nit: blended_point
awoloszyn
2014/05/27 16:08:09
Done.
|
| + blendedTransform.TransformPoint(&blendedPoint); |
| + gfx::BoxF expandedBounds = bounds; |
|
ajuma
2014/05/27 16:00:54
expanded_bounds
awoloszyn
2014/05/27 16:08:09
Done.
|
| + expandedBounds.ExpandTo(blendedPoint); |
| + EXPECT_EQ(bounds.ToString(), expandedBounds.ToString()); |
| +} |
| + |
| TEST(TransformOperationTest, BlendedBoundsForSequence) { |
| TransformOperations operations_from; |
| - operations_from.AppendTranslate(2.0, 4.0, -1.0); |
| - operations_from.AppendScale(-1.0, 2.0, 3.0); |
| operations_from.AppendTranslate(1.0, -5.0, 1.0); |
| + operations_from.AppendScale(-1.0, 2.0, 3.0); |
| + operations_from.AppendTranslate(2.0, 4.0, -1.0); |
| TransformOperations operations_to; |
| - operations_to.AppendTranslate(6.0, -2.0, 3.0); |
| - operations_to.AppendScale(-3.0, -2.0, 5.0); |
| operations_to.AppendTranslate(13.0, -1.0, 5.0); |
| + operations_to.AppendScale(-3.0, -2.0, 5.0); |
| + operations_to.AppendTranslate(6.0, -2.0, 3.0); |
| gfx::BoxF box(1.f, 2.f, 3.f, 4.f, 4.f, 4.f); |
| gfx::BoxF bounds; |