OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/gfx/transform_util.h" | 5 #include "ui/gfx/transform_util.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/gfx/point.h" | 8 #include "ui/gfx/geometry/point.h" |
9 #include "ui/gfx/point3_f.h" | 9 #include "ui/gfx/geometry/point3_f.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 namespace { | 13 namespace { |
14 | 14 |
15 TEST(TransformUtilTest, GetScaleTransform) { | 15 TEST(TransformUtilTest, GetScaleTransform) { |
16 const Point kAnchor(20, 40); | 16 const Point kAnchor(20, 40); |
17 const float kScale = 0.5f; | 17 const float kScale = 0.5f; |
18 | 18 |
19 Transform scale = GetScaleTransform(kAnchor, kScale); | 19 Transform scale = GetScaleTransform(kAnchor, kScale); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 transform.Translate3d(SkDoubleToMScalar(30.5), SkDoubleToMScalar(20.0), | 171 transform.Translate3d(SkDoubleToMScalar(30.5), SkDoubleToMScalar(20.0), |
172 SkDoubleToMScalar(10.1)); | 172 SkDoubleToMScalar(10.1)); |
173 transform.SkewX(20.0); | 173 transform.SkewX(20.0); |
174 Rect viewport(1920, 1200); | 174 Rect viewport(1920, 1200); |
175 bool snapped = SnapTransform(&result, transform, viewport); | 175 bool snapped = SnapTransform(&result, transform, viewport); |
176 EXPECT_FALSE(snapped) << "Skewed viewport should not snap."; | 176 EXPECT_FALSE(snapped) << "Skewed viewport should not snap."; |
177 } | 177 } |
178 | 178 |
179 } // namespace | 179 } // namespace |
180 } // namespace gfx | 180 } // namespace gfx |
OLD | NEW |