| OLD | NEW |
| 1 | 1 |
| 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 #ifndef DoublePoint_h | 5 #ifndef DoublePoint_h |
| 6 #define DoublePoint_h | 6 #define DoublePoint_h |
| 7 | 7 |
| 8 #include "platform/geometry/DoubleSize.h" | 8 #include "platform/geometry/DoubleSize.h" |
| 9 #include "platform/geometry/FloatPoint.h" | 9 #include "platform/geometry/FloatPoint.h" |
| 10 #include "platform/geometry/IntPoint.h" | 10 #include "platform/geometry/IntPoint.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 { | 92 { |
| 93 m_x *= sx; | 93 m_x *= sx; |
| 94 m_y *= sy; | 94 m_y *= sy; |
| 95 } | 95 } |
| 96 | 96 |
| 97 DoublePoint scaledBy(float scale) const | 97 DoublePoint scaledBy(float scale) const |
| 98 { | 98 { |
| 99 return DoublePoint(m_x * scale, m_y * scale); | 99 return DoublePoint(m_x * scale, m_y * scale); |
| 100 } | 100 } |
| 101 | 101 |
| 102 #ifndef NDEBUG | |
| 103 String toString() const; | 102 String toString() const; |
| 104 #endif | |
| 105 | 103 |
| 106 private: | 104 private: |
| 107 double m_x, m_y; | 105 double m_x, m_y; |
| 108 }; | 106 }; |
| 109 | 107 |
| 110 inline bool operator==(const DoublePoint& a, const DoublePoint& b) | 108 inline bool operator==(const DoublePoint& a, const DoublePoint& b) |
| 111 { | 109 { |
| 112 return a.x() == b.x() && a.y() == b.y(); | 110 return a.x() == b.x() && a.y() == b.y(); |
| 113 } | 111 } |
| 114 | 112 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 inline FloatPoint toFloatPoint(const DoublePoint& a) | 167 inline FloatPoint toFloatPoint(const DoublePoint& a) |
| 170 { | 168 { |
| 171 return FloatPoint(a.x(), a.y()); | 169 return FloatPoint(a.x(), a.y()); |
| 172 } | 170 } |
| 173 | 171 |
| 174 inline DoubleSize toDoubleSize(const DoublePoint& a) | 172 inline DoubleSize toDoubleSize(const DoublePoint& a) |
| 175 { | 173 { |
| 176 return DoubleSize(a.x(), a.y()); | 174 return DoubleSize(a.x(), a.y()); |
| 177 } | 175 } |
| 178 | 176 |
| 177 // Redeclared here to avoid ODR issues. |
| 178 // See platform/testing/GeometryPrinters.h. |
| 179 void PrintTo(const DoublePoint&, std::ostream*); |
| 180 |
| 179 } // namespace blink | 181 } // namespace blink |
| 180 | 182 |
| 181 #endif | 183 #endif |
| OLD | NEW |