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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatSize.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, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2005 Nokia. All rights reserved. 3 * Copyright (C) 2005 Nokia. All rights reserved.
4 * 2008 Eric Seidel <eric@webkit.org> 4 * 2008 Eric Seidel <eric@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo ssy 128 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo ssy
129 operator CGSize() const; 129 operator CGSize() const;
130 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 130 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
131 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l ossy 131 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l ossy
132 operator NSSize() const; 132 operator NSSize() const;
133 #endif 133 #endif
134 #endif 134 #endif
135 135
136 operator SkSize() const { return SkSize::Make(m_width, m_height); } 136 operator SkSize() const { return SkSize::Make(m_width, m_height); }
137 137
138 #ifndef NDEBUG
139 String toString() const; 138 String toString() const;
140 #endif
141 139
142 private: 140 private:
143 float m_width, m_height; 141 float m_width, m_height;
144 }; 142 };
145 143
146 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) 144 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b)
147 { 145 {
148 a.setWidth(a.width() + b.width()); 146 a.setWidth(a.width() + b.width());
149 a.setHeight(a.height() + b.height()); 147 a.setHeight(a.height() + b.height());
150 return a; 148 return a;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t()))); 210 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t())));
213 } 211 }
214 212
215 // Redeclared here to avoid ODR issues. 213 // Redeclared here to avoid ODR issues.
216 // See platform/testing/GeometryPrinters.h. 214 // See platform/testing/GeometryPrinters.h.
217 void PrintTo(const FloatSize&, std::ostream*); 215 void PrintTo(const FloatSize&, std::ostream*);
218 216
219 } // namespace blink 217 } // namespace blink
220 218
221 #endif // FloatSize_h 219 #endif // FloatSize_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698