| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/geometry/DoublePoint.h" | 5 #include "platform/geometry/DoublePoint.h" |
| 6 #include "platform/geometry/FloatSize.h" | 6 #include "platform/geometry/FloatSize.h" |
| 7 #include "platform/geometry/LayoutPoint.h" | 7 #include "platform/geometry/LayoutPoint.h" |
| 8 #include "wtf/text/WTFString.h" | 8 #include "wtf/text/WTFString.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 DoublePoint::DoublePoint(const LayoutPoint& p) | 12 DoublePoint::DoublePoint(const LayoutPoint& p) |
| 13 : m_x(p.x().toDouble()) | 13 : m_x(p.x().toDouble()) |
| 14 , m_y(p.y().toDouble()) | 14 , m_y(p.y().toDouble()) |
| 15 { | 15 { |
| 16 } | 16 } |
| 17 | 17 |
| 18 DoublePoint::DoublePoint(const FloatSize& size) | 18 DoublePoint::DoublePoint(const FloatSize& size) |
| 19 : m_x(size.width()), m_y(size.height()) | 19 : m_x(size.width()), m_y(size.height()) |
| 20 { | 20 { |
| 21 } | 21 } |
| 22 | 22 |
| 23 String DoublePoint::toString() const | 23 String DoublePoint::toString() const |
| 24 { | 24 { |
| 25 return String::format("%lg,%lg", x(), y()); | 25 return String::format("%lg,%lg", x(), y()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 std::ostream& operator<<(std::ostream& ostream, const DoublePoint& point) |
| 29 { |
| 30 return ostream << point.toString(); |
| 31 } |
| 32 |
| 28 } // namespace blink | 33 } // namespace blink |
| OLD | NEW |