| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/transforms/TransformationMatrix.h" | 6 #include "platform/transforms/TransformationMatrix.h" |
| 7 | 7 |
| 8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
| 9 | 9 |
| 10 using namespace blink; | 10 namespace blink { |
| 11 namespace { | |
| 12 | 11 |
| 13 TEST(TransformationMatrixTest, NonInvertableBlendTest) | 12 TEST(TransformationMatrixTest, NonInvertableBlendTest) |
| 14 { | 13 { |
| 15 TransformationMatrix from; | 14 TransformationMatrix from; |
| 16 TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0,
0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05); | 15 TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0,
0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05); |
| 17 TransformationMatrix result; | 16 TransformationMatrix result; |
| 18 | 17 |
| 19 result = to; | 18 result = to; |
| 20 result.blend(from, 0.25); | 19 result.blend(from, 0.25); |
| 21 EXPECT_TRUE(result == from); | 20 EXPECT_TRUE(result == from); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 52 } | 51 } |
| 53 | 52 |
| 54 TEST(TransformationMatrixTest, To2DTranslation) | 53 TEST(TransformationMatrixTest, To2DTranslation) |
| 55 { | 54 { |
| 56 TransformationMatrix matrix; | 55 TransformationMatrix matrix; |
| 57 EXPECT_EQ(FloatSize(), matrix.to2DTranslation()); | 56 EXPECT_EQ(FloatSize(), matrix.to2DTranslation()); |
| 58 matrix.translate(30, -40); | 57 matrix.translate(30, -40); |
| 59 EXPECT_EQ(FloatSize(30, -40), matrix.to2DTranslation()); | 58 EXPECT_EQ(FloatSize(30, -40), matrix.to2DTranslation()); |
| 60 } | 59 } |
| 61 | 60 |
| 62 } // namespace | 61 } // namespace blink |
| OLD | NEW |