Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/Source/platform/geometry/DoublePoint.cpp

Issue 2267183003: Switch from PrintTo to operator<< for platform printers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/DoublePoint.h ('k') | third_party/WebKit/Source/platform/geometry/DoubleRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698