| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ | 5 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ |
| 6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ | 6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" |
| 9 |
| 8 namespace gfx { | 10 namespace gfx { |
| 9 class Transform; | 11 class Transform; |
| 10 } | 12 } |
| 11 | 13 |
| 12 namespace cc { | 14 namespace cc { |
| 13 | 15 |
| 14 // These are macros instead of functions so that we get useful line numbers | 16 // These are macros instead of functions so that we get useful line numbers |
| 15 // where a test failed. | 17 // where a test failed. |
| 16 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ | 18 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ |
| 17 do { \ | 19 do { \ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54337 | 91 // and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54337 |
| 90 void ExpectTransformationMatrixEq(const gfx::Transform& expected, | 92 void ExpectTransformationMatrixEq(const gfx::Transform& expected, |
| 91 const gfx::Transform& actual); | 93 const gfx::Transform& actual); |
| 92 | 94 |
| 93 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ | 95 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ |
| 94 do { \ | 96 do { \ |
| 95 SCOPED_TRACE(""); \ | 97 SCOPED_TRACE(""); \ |
| 96 ExpectTransformationMatrixEq(expected, actual); \ | 98 ExpectTransformationMatrixEq(expected, actual); \ |
| 97 } while (false) | 99 } while (false) |
| 98 | 100 |
| 101 void ExpectTransformationMatrixNear(const gfx::Transform& expected, |
| 102 const gfx::Transform& actual, |
| 103 float abs_error); |
| 104 |
| 105 #define EXPECT_TRANSFORMATION_MATRIX_NEAR(expected, actual, abs_error) \ |
| 106 do { \ |
| 107 SCOPED_TRACE(""); \ |
| 108 ExpectTransformationMatrixNear(expected, actual, abs_error); \ |
| 109 } while (false) |
| 110 |
| 99 // Should be used in test code only, for convenience. Production code should use | 111 // Should be used in test code only, for convenience. Production code should use |
| 100 // the gfx::Transform::GetInverse() API. | 112 // the gfx::Transform::GetInverse() API. |
| 101 gfx::Transform Inverse(const gfx::Transform& transform); | 113 gfx::Transform Inverse(const gfx::Transform& transform); |
| 102 | 114 |
| 103 } // namespace cc | 115 } // namespace cc |
| 104 | 116 |
| 105 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ | 117 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ |
| OLD | NEW |