| 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/point.h" | 5 #include "ui/gfx/geometry/point.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" |
| 8 #include "build/build_config.h" |
| 9 #include "ui/gfx/geometry/point_conversions.h" |
| 10 #include "ui/gfx/geometry/point_f.h" |
| 11 |
| 7 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 8 #include <windows.h> | 13 #include <windows.h> |
| 9 #elif defined(OS_IOS) | 14 #elif defined(OS_IOS) |
| 10 #include <CoreGraphics/CoreGraphics.h> | 15 #include <CoreGraphics/CoreGraphics.h> |
| 11 #elif defined(OS_MACOSX) | 16 #elif defined(OS_MACOSX) |
| 12 #include <ApplicationServices/ApplicationServices.h> | 17 #include <ApplicationServices/ApplicationServices.h> |
| 13 #endif | 18 #endif |
| 14 | 19 |
| 15 #include "base/strings/stringprintf.h" | |
| 16 #include "ui/gfx/geometry/point_conversions.h" | |
| 17 #include "ui/gfx/geometry/point_f.h" | |
| 18 | |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 | 21 |
| 21 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 22 Point::Point(DWORD point) { | 23 Point::Point(DWORD point) { |
| 23 POINTS points = MAKEPOINTS(point); | 24 POINTS points = MAKEPOINTS(point); |
| 24 x_ = points.x; | 25 x_ = points.x; |
| 25 y_ = points.y; | 26 y_ = points.y; |
| 26 } | 27 } |
| 27 | 28 |
| 28 Point::Point(const POINT& point) : x_(point.x), y_(point.y) { | 29 Point::Point(const POINT& point) : x_(point.x), y_(point.y) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 return ToRoundedPoint(ScalePoint(gfx::PointF(point), x_scale, y_scale)); | 96 return ToRoundedPoint(ScalePoint(gfx::PointF(point), x_scale, y_scale)); |
| 96 } | 97 } |
| 97 | 98 |
| 98 Point ScaleToRoundedPoint(const Point& point, float scale) { | 99 Point ScaleToRoundedPoint(const Point& point, float scale) { |
| 99 if (scale == 1.f) | 100 if (scale == 1.f) |
| 100 return point; | 101 return point; |
| 101 return ToRoundedPoint(ScalePoint(gfx::PointF(point), scale, scale)); | 102 return ToRoundedPoint(ScalePoint(gfx::PointF(point), scale, scale)); |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace gfx | 105 } // namespace gfx |
| OLD | NEW |