OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_GEOMETRY_H_ | 5 #ifndef CC_GEOMETRY_H_ |
6 #define CC_GEOMETRY_H_ | 6 #define CC_GEOMETRY_H_ |
7 | 7 |
8 #include "ui/gfx/size.h" | 8 #include "ui/gfx/size.h" |
9 #include "ui/gfx/vector2d_f.h" | 9 #include "ui/gfx/vector2d_f.h" |
10 #include <cmath> | 10 #include <cmath> |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 inline gfx::Size ClampSizeFromAbove(gfx::Size s, gfx::Size other) { | 14 inline gfx::Size ClampSizeFromAbove(gfx::Size s, gfx::Size other) { |
15 return gfx::Size(s.width() < other.width() ? s.width() : other.width(), | 15 return gfx::Size(s.width() < other.width() ? s.width() : other.width(), |
16 s.height() < other.height() ? s.height() : other.height()); | 16 s.height() < other.height() ? s.height() : other.height()); |
17 } | 17 } |
18 | 18 |
19 } // namespace cc | 19 } // namespace cc |
20 | 20 |
21 #endif // CC_GEOMETRY_H_ | 21 #endif // CC_GEOMETRY_H_ |
OLD | NEW |