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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/IntSize.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) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserve d. 2 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserve d.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 operator CGSize() const; 126 operator CGSize() const;
127 127
128 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 128 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
129 explicit IntSize(const NSSize &); // don't do this implicitly since it's los sy 129 explicit IntSize(const NSSize &); // don't do this implicitly since it's los sy
130 operator NSSize() const; 130 operator NSSize() const;
131 #endif 131 #endif
132 #endif 132 #endif
133 133
134 operator gfx::Size() const; 134 operator gfx::Size() const;
135 135
136 #ifndef NDEBUG
137 String toString() const; 136 String toString() const;
138 #endif
139 137
140 private: 138 private:
141 int m_width, m_height; 139 int m_width, m_height;
142 }; 140 };
143 141
144 inline IntSize& operator+=(IntSize& a, const IntSize& b) 142 inline IntSize& operator+=(IntSize& a, const IntSize& b)
145 { 143 {
146 a.setWidth(a.width() + b.width()); 144 a.setWidth(a.width() + b.width());
147 a.setHeight(a.height() + b.height()); 145 a.setHeight(a.height() + b.height());
148 return a; 146 return a;
(...skipping 24 matching lines...) Expand all
173 inline bool operator==(const IntSize& a, const IntSize& b) 171 inline bool operator==(const IntSize& a, const IntSize& b)
174 { 172 {
175 return a.width() == b.width() && a.height() == b.height(); 173 return a.width() == b.width() && a.height() == b.height();
176 } 174 }
177 175
178 inline bool operator!=(const IntSize& a, const IntSize& b) 176 inline bool operator!=(const IntSize& a, const IntSize& b)
179 { 177 {
180 return a.width() != b.width() || a.height() != b.height(); 178 return a.width() != b.width() || a.height() != b.height();
181 } 179 }
182 180
181 // Redeclared here to avoid ODR issues.
182 // See platform/testing/GeometryPrinters.h.
183 void PrintTo(const IntSize&, std::ostream*);
184
183 } // namespace blink 185 } // namespace blink
184 186
185 #endif // IntSize_h 187 #endif // IntSize_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/IntRectTest.cpp ('k') | third_party/WebKit/Source/platform/geometry/IntSize.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698