OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/test/geometry_test_utils.h" | 5 #include "cc/test/geometry_test_utils.h" |
6 | 6 |
7 #include <public/WebTransformationMatrix.h> | 7 #include <public/WebTransformationMatrix.h> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/transform.h" | 10 #include "ui/gfx/transform.h" |
11 | 11 |
12 namespace WebKitTests { | 12 namespace cc { |
13 | 13 |
14 // NOTE: even though transform data types use double precision, we only check | 14 // NOTE: even though transform data types use double precision, we only check |
15 // for equality within single-precision error bounds because many transforms | 15 // for equality within single-precision error bounds because many transforms |
16 // originate from single-precision data types such as quads/rects/etc. | 16 // originate from single-precision data types such as quads/rects/etc. |
17 | 17 |
18 void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
d, | 18 void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
d, |
19 const WebKit::WebTransformationMatrix& actual) | 19 const WebKit::WebTransformationMatrix& actual) |
20 { | 20 { |
21 EXPECT_FLOAT_EQ((expected).m11(), (actual).m11()); | 21 EXPECT_FLOAT_EQ((expected).m11(), (actual).m11()); |
22 EXPECT_FLOAT_EQ((expected).m12(), (actual).m12()); | 22 EXPECT_FLOAT_EQ((expected).m12(), (actual).m12()); |
(...skipping 27 matching lines...) Expand all Loading... |
50 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 2), (actual).matrix().getDo
uble(0, 2)); | 50 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 2), (actual).matrix().getDo
uble(0, 2)); |
51 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 2), (actual).matrix().getDo
uble(1, 2)); | 51 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 2), (actual).matrix().getDo
uble(1, 2)); |
52 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 2), (actual).matrix().getDo
uble(2, 2)); | 52 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 2), (actual).matrix().getDo
uble(2, 2)); |
53 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 2), (actual).matrix().getDo
uble(3, 2)); | 53 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 2), (actual).matrix().getDo
uble(3, 2)); |
54 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 3), (actual).matrix().getDo
uble(0, 3)); | 54 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 3), (actual).matrix().getDo
uble(0, 3)); |
55 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 3), (actual).matrix().getDo
uble(1, 3)); | 55 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 3), (actual).matrix().getDo
uble(1, 3)); |
56 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 3), (actual).matrix().getDo
uble(2, 3)); | 56 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 3), (actual).matrix().getDo
uble(2, 3)); |
57 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 3), (actual).matrix().getDo
uble(3, 3)); | 57 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 3), (actual).matrix().getDo
uble(3, 3)); |
58 } | 58 } |
59 | 59 |
60 } // namespace WebKitTests | 60 } // namespace cc |
OLD | NEW |