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/geometry/rect_f.h" | 5 #include "ui/gfx/geometry/rect_f.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #if defined(OS_IOS) | 9 #if defined(OS_IOS) |
10 #include <CoreGraphics/CoreGraphics.h> | 10 #include <CoreGraphics/CoreGraphics.h> |
11 #elif defined(OS_MACOSX) | 11 #elif defined(OS_MACOSX) |
12 #include <ApplicationServices/ApplicationServices.h> | 12 #include <ApplicationServices/ApplicationServices.h> |
13 #endif | 13 #endif |
14 | 14 |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "build/build_config.h" |
17 #include "ui/gfx/geometry/insets_f.h" | 18 #include "ui/gfx/geometry/insets_f.h" |
18 #include "ui/gfx/geometry/safe_integer_conversions.h" | 19 #include "ui/gfx/geometry/safe_integer_conversions.h" |
19 | 20 |
20 namespace gfx { | 21 namespace gfx { |
21 | 22 |
22 static void AdjustAlongAxis(float dst_origin, | 23 static void AdjustAlongAxis(float dst_origin, |
23 float dst_size, | 24 float dst_size, |
24 float* origin, | 25 float* origin, |
25 float* size) { | 26 float* size) { |
26 *size = std::min(dst_size, *size); | 27 *size = std::min(dst_size, *size); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 254 |
254 RectF BoundingRect(const PointF& p1, const PointF& p2) { | 255 RectF BoundingRect(const PointF& p1, const PointF& p2) { |
255 float rx = std::min(p1.x(), p2.x()); | 256 float rx = std::min(p1.x(), p2.x()); |
256 float ry = std::min(p1.y(), p2.y()); | 257 float ry = std::min(p1.y(), p2.y()); |
257 float rr = std::max(p1.x(), p2.x()); | 258 float rr = std::max(p1.x(), p2.x()); |
258 float rb = std::max(p1.y(), p2.y()); | 259 float rb = std::max(p1.y(), p2.y()); |
259 return RectF(rx, ry, rr - rx, rb - ry); | 260 return RectF(rx, ry, rr - rx, rb - ry); |
260 } | 261 } |
261 | 262 |
262 } // namespace gfx | 263 } // namespace gfx |
OLD | NEW |