OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "ui/gfx/transform.h" | 8 #include "ui/gfx/transform.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
11 #include <ostream> | 11 #include <ostream> |
12 #include <limits> | 12 #include <limits> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "ui/gfx/box_f.h" | 17 #include "ui/gfx/geometry/box_f.h" |
18 #include "ui/gfx/point.h" | 18 #include "ui/gfx/geometry/point.h" |
19 #include "ui/gfx/point3_f.h" | 19 #include "ui/gfx/geometry/point3_f.h" |
20 #include "ui/gfx/quad_f.h" | 20 #include "ui/gfx/geometry/quad_f.h" |
21 #include "ui/gfx/transform_util.h" | 21 #include "ui/gfx/transform_util.h" |
22 #include "ui/gfx/vector3d_f.h" | 22 #include "ui/gfx/vector3d_f.h" |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 #define EXPECT_ROW1_EQ(a, b, c, d, transform) \ | 28 #define EXPECT_ROW1_EQ(a, b, c, d, transform) \ |
29 EXPECT_FLOAT_EQ((a), (transform).matrix().get(0, 0)); \ | 29 EXPECT_FLOAT_EQ((a), (transform).matrix().get(0, 0)); \ |
30 EXPECT_FLOAT_EQ((b), (transform).matrix().get(0, 1)); \ | 30 EXPECT_FLOAT_EQ((b), (transform).matrix().get(0, 1)); \ |
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 EXPECT_EQ(expected.ToString(), box.ToString()); | 2649 EXPECT_EQ(expected.ToString(), box.ToString()); |
2650 | 2650 |
2651 Transform singular; | 2651 Transform singular; |
2652 singular.Scale3d(0.f, 0.f, 0.f); | 2652 singular.Scale3d(0.f, 0.f, 0.f); |
2653 EXPECT_FALSE(singular.TransformBoxReverse(&box)); | 2653 EXPECT_FALSE(singular.TransformBoxReverse(&box)); |
2654 } | 2654 } |
2655 | 2655 |
2656 } // namespace | 2656 } // namespace |
2657 | 2657 |
2658 } // namespace gfx | 2658 } // namespace gfx |
OLD | NEW |