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 #ifndef UI_GFX_SIZE_H_ | 5 #ifndef UI_GFX_SIZE_H_ |
6 #define UI_GFX_SIZE_H_ | 6 #define UI_GFX_SIZE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 SIZE ToSIZE() const; | 41 SIZE ToSIZE() const; |
42 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
43 CGSize ToCGSize() const; | 43 CGSize ToCGSize() const; |
44 #endif | 44 #endif |
45 | 45 |
46 SizeF ToSizeF() const { | 46 SizeF ToSizeF() const { |
47 return SizeF(width(), height()); | 47 return SizeF(width(), height()); |
48 } | 48 } |
49 | 49 |
| 50 SizeF Scale(float scale) const WARN_UNUSED_RESULT { |
| 51 return Scale(scale, scale); |
| 52 } |
| 53 |
| 54 SizeF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT { |
| 55 return SizeF(width() * x_scale, height() * y_scale); |
| 56 } |
| 57 |
50 std::string ToString() const; | 58 std::string ToString() const; |
51 }; | 59 }; |
52 | 60 |
53 #if !defined(COMPILER_MSVC) | 61 #if !defined(COMPILER_MSVC) |
54 extern template class SizeBase<Size, int>; | 62 extern template class SizeBase<Size, int>; |
55 #endif | 63 #endif |
56 | 64 |
57 } // namespace gfx | 65 } // namespace gfx |
58 | 66 |
59 #endif // UI_GFX_SIZE_H_ | 67 #endif // UI_GFX_SIZE_H_ |
OLD | NEW |