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_conversions.h" | 5 #include "ui/gfx/rect_conversions.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include <cmath> | 8 #include <cmath> |
8 | 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "ui/gfx/safe_integer_conversions.h" | 11 #include "ui/gfx/safe_integer_conversions.h" |
11 | 12 |
12 namespace gfx { | 13 namespace gfx { |
13 | 14 |
14 Rect ToEnclosingRect(const RectF& rect) { | 15 Rect ToEnclosingRect(const RectF& rect) { |
15 int min_x = ToFlooredInt(rect.x()); | 16 int min_x = ToFlooredInt(rect.x()); |
16 int min_y = ToFlooredInt(rect.y()); | 17 int min_y = ToFlooredInt(rect.y()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 73 |
73 Rect ToFlooredRectDeprecated(const RectF& rect) { | 74 Rect ToFlooredRectDeprecated(const RectF& rect) { |
74 return Rect(ToFlooredInt(rect.x()), | 75 return Rect(ToFlooredInt(rect.x()), |
75 ToFlooredInt(rect.y()), | 76 ToFlooredInt(rect.y()), |
76 ToFlooredInt(rect.width()), | 77 ToFlooredInt(rect.width()), |
77 ToFlooredInt(rect.height())); | 78 ToFlooredInt(rect.height())); |
78 } | 79 } |
79 | 80 |
80 } // namespace gfx | 81 } // namespace gfx |
81 | 82 |
OLD | NEW |