| 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/rect.h" | 5 #include "ui/gfx/rect.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(TOOLKIT_GTK) | 9 #elif defined(TOOLKIT_GTK) |
| 10 #include <gdk/gdk.h> | 10 #include <gdk/gdk.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "ui/gfx/insets.h" | 15 #include "ui/gfx/insets.h" |
| 16 #include "ui/gfx/rect_base_impl.h" | 16 #include "ui/gfx/rect_base_impl.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 | 19 |
| 20 template class RectBase<Rect, Point, Size, Insets, int>; | 20 template class RectBase<Rect, Point, Size, Insets, Vector2d, int>; |
| 21 | 21 |
| 22 typedef class RectBase<Rect, Point, Size, Insets, int> RectBaseT; | 22 typedef class RectBase<Rect, Point, Size, Insets, Vector2d, int> RectBaseT; |
| 23 | 23 |
| 24 Rect::Rect() : RectBaseT(gfx::Point()) { | 24 Rect::Rect() : RectBaseT(gfx::Point()) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 Rect::Rect(int width, int height) | 27 Rect::Rect(int width, int height) |
| 28 : RectBaseT(gfx::Size(width, height)) { | 28 : RectBaseT(gfx::Size(width, height)) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 Rect::Rect(int x, int y, int width, int height) | 31 Rect::Rect(int x, int y, int width, int height) |
| 32 : RectBaseT(gfx::Point(x, y), gfx::Size(width, height)) { | 32 : RectBaseT(gfx::Point(x, y), gfx::Size(width, height)) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return result; | 100 return result; |
| 101 } | 101 } |
| 102 | 102 |
| 103 Rect SubtractRects(const Rect& a, const Rect& b) { | 103 Rect SubtractRects(const Rect& a, const Rect& b) { |
| 104 Rect result = a; | 104 Rect result = a; |
| 105 result.Subtract(b); | 105 result.Subtract(b); |
| 106 return result; | 106 return result; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace gfx | 109 } // namespace gfx |
| OLD | NEW |