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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatQuad.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: Adjust tests to work around uninteresting cross-platform differences 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 m_p1.scale(dx, dy); 145 m_p1.scale(dx, dy);
146 m_p2.scale(dx, dy); 146 m_p2.scale(dx, dy);
147 m_p3.scale(dx, dy); 147 m_p3.scale(dx, dy);
148 m_p4.scale(dx, dy); 148 m_p4.scale(dx, dy);
149 } 149 }
150 150
151 // Tests whether points are in clock-wise, or counter clock-wise order. 151 // Tests whether points are in clock-wise, or counter clock-wise order.
152 // Note that output is undefined when all points are colinear. 152 // Note that output is undefined when all points are colinear.
153 bool isCounterclockwise() const; 153 bool isCounterclockwise() const;
154 154
155 #ifndef NDEBUG
156 // Prints debugging information for this object.
157 void show() const;
158 #endif
159
160 private: 155 private:
161 FloatPoint m_p1; 156 FloatPoint m_p1;
162 FloatPoint m_p2; 157 FloatPoint m_p2;
163 FloatPoint m_p3; 158 FloatPoint m_p3;
164 FloatPoint m_p4; 159 FloatPoint m_p4;
165 }; 160 };
166 161
167 inline FloatQuad& operator+=(FloatQuad& a, const FloatSize& b) 162 inline FloatQuad& operator+=(FloatQuad& a, const FloatSize& b)
168 { 163 {
169 a.move(b); 164 a.move(b);
(...skipping 15 matching lines...) Expand all
185 } 180 }
186 181
187 inline bool operator!=(const FloatQuad& a, const FloatQuad& b) 182 inline bool operator!=(const FloatQuad& a, const FloatQuad& b)
188 { 183 {
189 return a.p1() != b.p1() || 184 return a.p1() != b.p1() ||
190 a.p2() != b.p2() || 185 a.p2() != b.p2() ||
191 a.p3() != b.p3() || 186 a.p3() != b.p3() ||
192 a.p4() != b.p4(); 187 a.p4() != b.p4();
193 } 188 }
194 189
195 190 PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, const FloatQuad&);
196 // Redeclared here to avoid ODR issues.
197 // See platform/testing/GeometryPrinters.h.
198 void PrintTo(const FloatQuad&, std::ostream*);
199 191
200 } // namespace blink 192 } // namespace blink
201 193
202 #endif // FloatQuad_h 194 #endif // FloatQuad_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698