| 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/FloatPoint.h" | 34 #include "platform/geometry/FloatPoint.h" |
| 35 #include "platform/geometry/LayoutSize.h" | 35 #include "platform/geometry/LayoutSize.h" |
| 36 #include "wtf/MathExtras.h" | 36 #include "wtf/MathExtras.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace blink { |
| 39 | 39 |
| 40 class LayoutPoint { | 40 class LayoutPoint { |
| 41 public: | 41 public: |
| 42 LayoutPoint() { } | 42 LayoutPoint() { } |
| 43 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } | 43 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } |
| 44 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } | 44 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } |
| 45 explicit LayoutPoint(const FloatPoint& size) : m_x(size.x()), m_y(size.y())
{ } | 45 explicit LayoutPoint(const FloatPoint& size) : m_x(size.x()), m_y(size.y())
{ } |
| 46 explicit LayoutPoint(const LayoutSize& size) : m_x(size.width()), m_y(size.h
eight()) { } | 46 explicit LayoutPoint(const LayoutSize& size) : m_x(size.width()), m_y(size.h
eight()) { } |
| 47 | 47 |
| 48 static LayoutPoint zero() { return LayoutPoint(); } | 48 static LayoutPoint zero() { return LayoutPoint(); } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 { | 192 { |
| 193 return LayoutSize(p.x(), p.y()); | 193 return LayoutSize(p.x(), p.y()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) | 196 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) |
| 197 { | 197 { |
| 198 return flooredLayoutPoint(FloatPoint(s)); | 198 return flooredLayoutPoint(FloatPoint(s)); |
| 199 } | 199 } |
| 200 | 200 |
| 201 | 201 |
| 202 } // namespace WebCore | 202 } // namespace blink |
| 203 | 203 |
| 204 #endif // LayoutPoint_h | 204 #endif // LayoutPoint_h |
| OLD | NEW |