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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatRect.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, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2005 Nokia. All rights reserved. 3 * Copyright (C) 2005 Nokia. 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 182 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
183 FloatRect(const NSRect&); 183 FloatRect(const NSRect&);
184 operator NSRect() const; 184 operator NSRect() const;
185 #endif 185 #endif
186 #endif 186 #endif
187 187
188 operator SkRect() const { return SkRect::MakeXYWH(x(), y(), width(), height( )); } 188 operator SkRect() const { return SkRect::MakeXYWH(x(), y(), width(), height( )); }
189 operator gfx::RectF() const; 189 operator gfx::RectF() const;
190 190
191 #if ENABLE(ASSERT) 191 #if ENABLE(ASSERT)
192 // Prints the rect to the screen.
193 void show() const;
194 bool mayNotHaveExactIntRectRepresentation() const; 192 bool mayNotHaveExactIntRectRepresentation() const;
195 #endif 193 #endif
196 194
197 #ifndef NDEBUG
198 String toString() const; 195 String toString() const;
199 #endif
200 196
201 private: 197 private:
202 FloatPoint m_location; 198 FloatPoint m_location;
203 FloatSize m_size; 199 FloatSize m_size;
204 200
205 void setLocationAndSizeFromEdges(float left, float top, float right, float b ottom) 201 void setLocationAndSizeFromEdges(float left, float top, float right, float b ottom)
206 { 202 {
207 m_location.set(left, top); 203 m_location.set(left, top);
208 m_size.setWidth(right - left); 204 m_size.setWidth(right - left);
209 m_size.setHeight(bottom - top); 205 m_size.setHeight(bottom - top);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // Map supplied rect from srcRect to an equivalent rect in destRect. 257 // Map supplied rect from srcRect to an equivalent rect in destRect.
262 PLATFORM_EXPORT FloatRect mapRect(const FloatRect&, const FloatRect& srcRect, co nst FloatRect& destRect); 258 PLATFORM_EXPORT FloatRect mapRect(const FloatRect&, const FloatRect& srcRect, co nst FloatRect& destRect);
263 259
264 // Redeclared here to avoid ODR issues. 260 // Redeclared here to avoid ODR issues.
265 // See platform/testing/GeometryPrinters.h. 261 // See platform/testing/GeometryPrinters.h.
266 void PrintTo(const FloatRect&, std::ostream*); 262 void PrintTo(const FloatRect&, std::ostream*);
267 263
268 } // namespace blink 264 } // namespace blink
269 265
270 #endif 266 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698