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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/LayoutPoint.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) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void clampNegativeToZero() 84 void clampNegativeToZero()
85 { 85 {
86 *this = expandedTo(zero()); 86 *this = expandedTo(zero());
87 } 87 }
88 88
89 LayoutPoint transposedPoint() const 89 LayoutPoint transposedPoint() const
90 { 90 {
91 return LayoutPoint(m_y, m_x); 91 return LayoutPoint(m_y, m_x);
92 } 92 }
93 93
94 #ifndef NDEBUG
95 String toString() const; 94 String toString() const;
96 #endif
97 95
98 private: 96 private:
99 LayoutUnit m_x, m_y; 97 LayoutUnit m_x, m_y;
100 }; 98 };
101 99
102 ALWAYS_INLINE LayoutPoint& operator+=(LayoutPoint& a, const LayoutSize& b) 100 ALWAYS_INLINE LayoutPoint& operator+=(LayoutPoint& a, const LayoutSize& b)
103 { 101 {
104 a.move(b.width(), b.height()); 102 a.move(b.width(), b.height());
105 return a; 103 return a;
106 } 104 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 inline LayoutSize toLayoutSize(const LayoutPoint& p) 235 inline LayoutSize toLayoutSize(const LayoutPoint& p)
238 { 236 {
239 return LayoutSize(p.x(), p.y()); 237 return LayoutSize(p.x(), p.y());
240 } 238 }
241 239
242 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) 240 inline LayoutPoint flooredLayoutPoint(const FloatSize& s)
243 { 241 {
244 return flooredLayoutPoint(FloatPoint(s)); 242 return flooredLayoutPoint(FloatPoint(s));
245 } 243 }
246 244
245 // Redeclared here to avoid ODR issues.
246 // See platform/testing/GeometryPrinters.h.
247 void PrintTo(const LayoutPoint&, std::ostream*);
248
247 } // namespace blink 249 } // namespace blink
248 250
249 #endif // LayoutPoint_h 251 #endif // LayoutPoint_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/IntSize.cpp ('k') | third_party/WebKit/Source/platform/geometry/LayoutPoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698