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 27 matching lines...) Expand all Loading... | |
38 #include "wtf/MathExtras.h" | 38 #include "wtf/MathExtras.h" |
39 #include <algorithm> | 39 #include <algorithm> |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class LayoutPoint { | 43 class LayoutPoint { |
44 DISALLOW_NEW(); | 44 DISALLOW_NEW(); |
45 public: | 45 public: |
46 LayoutPoint() { } | 46 LayoutPoint() { } |
47 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } | 47 LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } |
48 LayoutPoint(int x, int y) : m_x(LayoutUnit(x)), m_y(LayoutUnit(y)) { } | |
eae
2016/02/12 01:14:59
This has many of the same problems, I assume it is
| |
48 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } | 49 LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } |
49 explicit LayoutPoint(const FloatPoint& point) : m_x(point.x()), m_y(point.y( )) { } | 50 explicit LayoutPoint(const FloatPoint& point) : m_x(point.x()), m_y(point.y( )) { } |
50 explicit LayoutPoint(const DoublePoint& point) : m_x(point.x()), m_y(point.y ()) { } | 51 explicit LayoutPoint(const DoublePoint& point) : m_x(point.x()), m_y(point.y ()) { } |
51 explicit LayoutPoint(const LayoutSize& size) : m_x(size.width()), m_y(size.h eight()) { } | 52 explicit LayoutPoint(const LayoutSize& size) : m_x(size.width()), m_y(size.h eight()) { } |
52 | 53 |
53 static LayoutPoint zero() { return LayoutPoint(); } | 54 static LayoutPoint zero() { return LayoutPoint(); } |
54 | 55 |
55 LayoutUnit x() const { return m_x; } | 56 LayoutUnit x() const { return m_x; } |
56 LayoutUnit y() const { return m_y; } | 57 LayoutUnit y() const { return m_y; } |
57 | 58 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 | 236 |
236 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) | 237 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) |
237 { | 238 { |
238 return flooredLayoutPoint(FloatPoint(s)); | 239 return flooredLayoutPoint(FloatPoint(s)); |
239 } | 240 } |
240 | 241 |
241 | 242 |
242 } // namespace blink | 243 } // namespace blink |
243 | 244 |
244 #endif // LayoutPoint_h | 245 #endif // LayoutPoint_h |
OLD | NEW |