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

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: 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) 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 13 matching lines...) Expand all
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef IntSize_h 27 #ifndef IntSize_h
28 #define IntSize_h 28 #define IntSize_h
29 29
30 #include "platform/PlatformExport.h" 30 #include "platform/PlatformExport.h"
31 #include "public/platform/WebCommon.h" 31 #include "public/platform/WebCommon.h"
32 #include "wtf/Allocator.h" 32 #include "wtf/Allocator.h"
33 #include "wtf/Forward.h" 33 #include "wtf/Forward.h"
34 #include <iosfwd>
34 35
35 #if OS(MACOSX) 36 #if OS(MACOSX)
36 typedef struct CGSize CGSize; 37 typedef struct CGSize CGSize;
37 38
38 #ifdef __OBJC__ 39 #ifdef __OBJC__
39 #import <Foundation/Foundation.h> 40 #import <Foundation/Foundation.h>
40 #endif 41 #endif
41 #endif 42 #endif
42 43
43 namespace gfx { 44 namespace gfx {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 operator CGSize() const; 127 operator CGSize() const;
127 128
128 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 129 #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 130 explicit IntSize(const NSSize &); // don't do this implicitly since it's los sy
130 operator NSSize() const; 131 operator NSSize() const;
131 #endif 132 #endif
132 #endif 133 #endif
133 134
134 operator gfx::Size() const; 135 operator gfx::Size() const;
135 136
136 #ifndef NDEBUG
137 String toString() const;
138 #endif
139
140 private: 137 private:
141 int m_width, m_height; 138 int m_width, m_height;
142 }; 139 };
143 140
144 inline IntSize& operator+=(IntSize& a, const IntSize& b) 141 inline IntSize& operator+=(IntSize& a, const IntSize& b)
145 { 142 {
146 a.setWidth(a.width() + b.width()); 143 a.setWidth(a.width() + b.width());
147 a.setHeight(a.height() + b.height()); 144 a.setHeight(a.height() + b.height());
148 return a; 145 return a;
149 } 146 }
(...skipping 23 matching lines...) Expand all
173 inline bool operator==(const IntSize& a, const IntSize& b) 170 inline bool operator==(const IntSize& a, const IntSize& b)
174 { 171 {
175 return a.width() == b.width() && a.height() == b.height(); 172 return a.width() == b.width() && a.height() == b.height();
176 } 173 }
177 174
178 inline bool operator!=(const IntSize& a, const IntSize& b) 175 inline bool operator!=(const IntSize& a, const IntSize& b)
179 { 176 {
180 return a.width() != b.width() || a.height() != b.height(); 177 return a.width() != b.width() || a.height() != b.height();
181 } 178 }
182 179
180 PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, const IntSize&);
181
183 } // namespace blink 182 } // namespace blink
184 183
185 #endif // IntSize_h 184 #endif // IntSize_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698