| Index: cc/test/geometry_test_utils.cc
|
| diff --git a/cc/test/geometry_test_utils.cc b/cc/test/geometry_test_utils.cc
|
| index 68afd4b0e5e64191153369b3c4446daa530d1323..0d5df9430e392536ebbd3faa7d8926f5950dd325 100644
|
| --- a/cc/test/geometry_test_utils.cc
|
| +++ b/cc/test/geometry_test_utils.cc
|
| @@ -4,11 +4,17 @@
|
|
|
| #include "cc/test/geometry_test_utils.h"
|
|
|
| -#include "testing/gtest/include/gtest/gtest.h"
|
| #include <public/WebTransformationMatrix.h>
|
|
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +#include "ui/gfx/transform.h"
|
| +
|
| namespace WebKitTests {
|
|
|
| +// NOTE: even though transform data types use double precision, we only check
|
| +// for equality within single-precision error bounds because many transforms
|
| +// originate from single-precision data types such as quads/rects/etc.
|
| +
|
| void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expected,
|
| const WebKit::WebTransformationMatrix& actual)
|
| {
|
| @@ -30,4 +36,25 @@ void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
|
| EXPECT_FLOAT_EQ((expected).m44(), (actual).m44());
|
| }
|
|
|
| +void ExpectTransformationMatrixEq(const gfx::Transform& expected,
|
| + const gfx::Transform& actual)
|
| +{
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 0), (actual).matrix().getDouble(0, 0));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 0), (actual).matrix().getDouble(1, 0));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 0), (actual).matrix().getDouble(2, 0));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 0), (actual).matrix().getDouble(3, 0));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 1), (actual).matrix().getDouble(0, 1));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 1), (actual).matrix().getDouble(1, 1));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 1), (actual).matrix().getDouble(2, 1));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 1), (actual).matrix().getDouble(3, 1));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 2), (actual).matrix().getDouble(0, 2));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 2), (actual).matrix().getDouble(1, 2));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 2), (actual).matrix().getDouble(2, 2));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 2), (actual).matrix().getDouble(3, 2));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 3), (actual).matrix().getDouble(0, 3));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 3), (actual).matrix().getDouble(1, 3));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 3), (actual).matrix().getDouble(2, 3));
|
| + EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 3), (actual).matrix().getDouble(3, 3));
|
| +}
|
| +
|
| } // namespace WebKitTests
|
|
|