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

Side by Side Diff: Source/platform/geometry/FloatSize.h

Issue 1285413007: Unify geometry test printers in a test support target. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PrintTo instead of operator<< Created 5 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 | Annotate | Revision Log
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 13 matching lines...) Expand all
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef FloatSize_h 28 #ifndef FloatSize_h
29 #define FloatSize_h 29 #define FloatSize_h
30 30
31 #include "platform/geometry/IntPoint.h" 31 #include "platform/geometry/IntPoint.h"
32 #include "third_party/skia/include/core/SkSize.h" 32 #include "third_party/skia/include/core/SkSize.h"
33 #include "wtf/MathExtras.h" 33 #include "wtf/MathExtras.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 blink { 44 namespace blink {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 inline IntSize expandedIntSize(const FloatSize& p) 198 inline IntSize expandedIntSize(const FloatSize& p)
198 { 199 {
199 return IntSize(clampTo<int>(ceilf(p.width())), clampTo<int>(ceilf(p.height() ))); 200 return IntSize(clampTo<int>(ceilf(p.width())), clampTo<int>(ceilf(p.height() )));
200 } 201 }
201 202
202 inline IntPoint flooredIntPoint(const FloatSize& p) 203 inline IntPoint flooredIntPoint(const FloatSize& p)
203 { 204 {
204 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t()))); 205 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t())));
205 } 206 }
206 207
208 // Redeclared here to avoid ODR issues.
209 // See platform/testing/GeometryPrinters.h.
210 void PrintTo(const FloatSize&, std::ostream*);
211
207 } // namespace blink 212 } // namespace blink
208 213
209 #endif // FloatSize_h 214 #endif // FloatSize_h
OLDNEW
« no previous file with comments | « Source/platform/geometry/FloatRoundedRectTest.cpp ('k') | Source/platform/geometry/LayoutRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698