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

Unified Diff: cc/animation/transform_operations_unittest.cc

Issue 1194073007: Fix for bug where composited rotate3d should SLERP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected checks in ShareSameAxis Created 5 years, 6 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/transform_operations_unittest.cc
diff --git a/cc/animation/transform_operations_unittest.cc b/cc/animation/transform_operations_unittest.cc
index c5fb3c6b8160027c9e0672823a2e91c35b323b75..a5cf7ec96197a499f4c32f0542298bdd5d364b00 100644
--- a/cc/animation/transform_operations_unittest.cc
+++ b/cc/animation/transform_operations_unittest.cc
@@ -441,6 +441,42 @@ TEST(TransformOperationTest, LargeRotationsWithDifferentAxes) {
expected, operations_to.Blend(operations_from, progress));
}
+TEST(TransformOperationTest, RotationWithSlerpFromZeroDeg) {
+ TransformOperations operations_from;
+ operations_from.AppendRotate(0, 0, 1, 0);
+
+ TransformOperations operations_to;
+ operations_to.AppendRotate(0, 1, 0, 450);
+
+ SkMScalar progress = 0.5f;
+ gfx::Transform matrix_from;
+ matrix_from.RotateAbout(gfx::Vector3dF(0, 0, 1), 0);
+
+ gfx::Transform matrix_to;
+ matrix_to.RotateAbout(gfx::Vector3dF(0, 1, 0), 90);
+
+ gfx::Transform expected = matrix_to;
+ expected.Blend(matrix_from, progress);
+
+ EXPECT_TRANSFORMATION_MATRIX_EQ(
+ expected, operations_to.Blend(operations_from, progress));
+}
+
+TEST(TransformOperationTest, RotationWithoutSlerpFromZeroDeg) {
+ TransformOperations operations_from;
+ operations_from.AppendRotate(0, 0, 1, 0);
+
+ TransformOperations operations_to;
+ operations_to.AppendRotate(0, 0, 1, 450);
+
+ SkMScalar progress = 0.5f;
+ gfx::Transform expected;
+ expected.RotateAbout(gfx::Vector3dF(0, 0, 1), 225);
+
+ EXPECT_TRANSFORMATION_MATRIX_EQ(
+ expected, operations_to.Blend(operations_from, progress));
+}
+
TEST(TransformOperationTest, BlendRotationFromIdentity) {
ScopedVector<TransformOperations> identity_operations;
GetIdentityOperations(&identity_operations);
« cc/animation/transform_operations.cc ('K') | « cc/animation/transform_operations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698