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

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

Issue 2191233002: Add platform/geometry pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fewer redundant spaces, more toString tests 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 /* 1 /*
2 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org> 2 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric@webkit.org> 4 2005 Eric Seidel <eric@webkit.org>
5 2010 Zoltan Herczeg <zherczeg@webkit.org> 5 2010 Zoltan Herczeg <zherczeg@webkit.org>
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return result; 125 return result;
126 } 126 }
127 127
128 float lengthSquared() const { return this->dot(*this); } 128 float lengthSquared() const { return this->dot(*this); }
129 float length() const { return sqrtf(lengthSquared()); } 129 float length() const { return sqrtf(lengthSquared()); }
130 130
131 float distanceTo(const FloatPoint3D& a) const; 131 float distanceTo(const FloatPoint3D& a) const;
132 132
133 operator SkPoint3() const { return SkPoint3::Make(m_x, m_y, m_z); } 133 operator SkPoint3() const { return SkPoint3::Make(m_x, m_y, m_z); }
134 134
135 String toString() const;
136
135 private: 137 private:
136 float m_x; 138 float m_x;
137 float m_y; 139 float m_y;
138 float m_z; 140 float m_z;
139 }; 141 };
140 142
141 inline FloatPoint3D& operator +=(FloatPoint3D& a, const FloatPoint3D& b) 143 inline FloatPoint3D& operator +=(FloatPoint3D& a, const FloatPoint3D& b)
142 { 144 {
143 a.move(b.x(), b.y(), b.z()); 145 a.move(b.x(), b.y(), b.z());
144 return a; 146 return a;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return (*this - a).length(); 193 return (*this - a).length();
192 } 194 }
193 195
194 // Redeclared here to avoid ODR issues. 196 // Redeclared here to avoid ODR issues.
195 // See platform/testing/GeometryPrinters.h. 197 // See platform/testing/GeometryPrinters.h.
196 void PrintTo(const FloatPoint3D&, std::ostream*); 198 void PrintTo(const FloatPoint3D&, std::ostream*);
197 199
198 } // namespace blink 200 } // namespace blink
199 201
200 #endif // FloatPoint3D_h 202 #endif // FloatPoint3D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698