OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef LayoutPoint_h | 31 #ifndef LayoutPoint_h |
32 #define LayoutPoint_h | 32 #define LayoutPoint_h |
33 | 33 |
34 #include "platform/geometry/DoublePoint.h" | 34 #include "platform/geometry/DoublePoint.h" |
35 #include "platform/geometry/FloatPoint.h" | 35 #include "platform/geometry/FloatPoint.h" |
36 #include "platform/geometry/LayoutSize.h" | 36 #include "platform/geometry/LayoutSize.h" |
37 #include "wtf/MathExtras.h" | 37 #include "wtf/MathExtras.h" |
| 38 #include <algorithm> |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class LayoutPoint { | 42 class LayoutPoint { |
42 public: | 43 public: |
43 LayoutPoint() { } | 44 LayoutPoint() { } |
44 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } | 45 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } |
45 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } | 46 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } |
46 explicit LayoutPoint(const FloatPoint& point) : m_x(point.x()), m_y(point.y(
)) { } | 47 explicit LayoutPoint(const FloatPoint& point) : m_x(point.x()), m_y(point.y(
)) { } |
47 explicit LayoutPoint(const DoublePoint& point) : m_x(point.x()), m_y(point.y
()) { } | 48 explicit LayoutPoint(const DoublePoint& point) : m_x(point.x()), m_y(point.y
()) { } |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 232 |
232 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) | 233 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) |
233 { | 234 { |
234 return flooredLayoutPoint(FloatPoint(s)); | 235 return flooredLayoutPoint(FloatPoint(s)); |
235 } | 236 } |
236 | 237 |
237 | 238 |
238 } // namespace blink | 239 } // namespace blink |
239 | 240 |
240 #endif // LayoutPoint_h | 241 #endif // LayoutPoint_h |
OLD | NEW |