| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 BASE_GFX_SIZE_H_ | 5 #ifndef BASE_GFX_SIZE_H_ |
| 6 #define BASE_GFX_SIZE_H_ | 6 #define BASE_GFX_SIZE_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <iostream> | 10 #include <iostream> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class Size { | 23 class Size { |
| 24 public: | 24 public: |
| 25 Size() : width_(0), height_(0) {} | 25 Size() : width_(0), height_(0) {} |
| 26 Size(int width, int height); | 26 Size(int width, int height); |
| 27 | 27 |
| 28 ~Size() {} | 28 ~Size() {} |
| 29 | 29 |
| 30 int width() const { return width_; } | 30 int width() const { return width_; } |
| 31 int height() const { return height_; } | 31 int height() const { return height_; } |
| 32 | 32 |
| 33 int GetArea() const { return width_ * height_; } |
| 34 |
| 33 void SetSize(int width, int height) { | 35 void SetSize(int width, int height) { |
| 34 set_width(width); | 36 set_width(width); |
| 35 set_height(height); | 37 set_height(height); |
| 36 } | 38 } |
| 37 | 39 |
| 38 void Enlarge(int width, int height) { | 40 void Enlarge(int width, int height) { |
| 39 set_width(width_ + width); | 41 set_width(width_ + width); |
| 40 set_height(height_ + height); | 42 set_height(height_ + height); |
| 41 } | 43 } |
| 42 | 44 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 67 int height_; | 69 int height_; |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace gfx | 72 } // namespace gfx |
| 71 | 73 |
| 72 inline std::ostream& operator<<(std::ostream& out, const gfx::Size& s) { | 74 inline std::ostream& operator<<(std::ostream& out, const gfx::Size& s) { |
| 73 return out << s.width() << "x" << s.height(); | 75 return out << s.width() << "x" << s.height(); |
| 74 } | 76 } |
| 75 | 77 |
| 76 #endif // BASE_GFX_SIZE_H_ | 78 #endif // BASE_GFX_SIZE_H_ |
| OLD | NEW |