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

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

Issue 2195903002: Add Double{Size, Point, Rect} pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geometryPrettyPrinters2
Patch Set: Remove unnecessary String casts Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/geometry/DoublePoint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/geometry/DoublePoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698