| 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.h" | 5 #include "ui/gfx/geometry/rect.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #elif defined(OS_IOS) |
| 12 #include <CoreGraphics/CoreGraphics.h> |
| 13 #elif defined(OS_MACOSX) |
| 14 #include <ApplicationServices/ApplicationServices.h> |
| 11 #endif | 15 #endif |
| 12 | 16 |
| 13 #include "base/logging.h" | 17 #include "base/logging.h" |
| 14 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 15 #include "ui/gfx/geometry/insets.h" | 19 #include "ui/gfx/geometry/insets.h" |
| 16 | 20 |
| 17 namespace gfx { | 21 namespace gfx { |
| 18 | 22 |
| 19 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 20 Rect::Rect(const RECT& r) | 24 Rect::Rect(const RECT& r) |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 276 |
| 273 Rect BoundingRect(const Point& p1, const Point& p2) { | 277 Rect BoundingRect(const Point& p1, const Point& p2) { |
| 274 int rx = std::min(p1.x(), p2.x()); | 278 int rx = std::min(p1.x(), p2.x()); |
| 275 int ry = std::min(p1.y(), p2.y()); | 279 int ry = std::min(p1.y(), p2.y()); |
| 276 int rr = std::max(p1.x(), p2.x()); | 280 int rr = std::max(p1.x(), p2.x()); |
| 277 int rb = std::max(p1.y(), p2.y()); | 281 int rb = std::max(p1.y(), p2.y()); |
| 278 return Rect(rx, ry, rr - rx, rb - ry); | 282 return Rect(rx, ry, rr - rx, rb - ry); |
| 279 } | 283 } |
| 280 | 284 |
| 281 } // namespace gfx | 285 } // namespace gfx |
| OLD | NEW |