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

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

Issue 641643004: Reapply the non-MathExtras parts of (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/platform/geometry/FloatPoint.h ('k') | Source/platform/geometry/IntRect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return a.width() == b.width() && a.height() == b.height(); 169 return a.width() == b.width() && a.height() == b.height();
170 } 170 }
171 171
172 inline bool operator!=(const FloatSize& a, const FloatSize& b) 172 inline bool operator!=(const FloatSize& a, const FloatSize& b)
173 { 173 {
174 return a.width() != b.width() || a.height() != b.height(); 174 return a.width() != b.width() || a.height() != b.height();
175 } 175 }
176 176
177 inline IntSize roundedIntSize(const FloatSize& p) 177 inline IntSize roundedIntSize(const FloatSize& p)
178 { 178 {
179 return IntSize(clampToInteger(roundf(p.width())), clampToInteger(roundf(p.he ight()))); 179 return IntSize(clampTo<int>(roundf(p.width())), clampTo<int>(roundf(p.height ())));
180 } 180 }
181 181
182 inline IntSize flooredIntSize(const FloatSize& p) 182 inline IntSize flooredIntSize(const FloatSize& p)
183 { 183 {
184 return IntSize(clampToInteger(floorf(p.width())), clampToInteger(floorf(p.he ight()))); 184 return IntSize(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.height ())));
185 } 185 }
186 186
187 inline IntSize expandedIntSize(const FloatSize& p) 187 inline IntSize expandedIntSize(const FloatSize& p)
188 { 188 {
189 return IntSize(clampToInteger(ceilf(p.width())), clampToInteger(ceilf(p.heig ht()))); 189 return IntSize(clampTo<int>(ceilf(p.width())), clampTo<int>(ceilf(p.height() )));
190 } 190 }
191 191
192 inline IntPoint flooredIntPoint(const FloatSize& p) 192 inline IntPoint flooredIntPoint(const FloatSize& p)
193 { 193 {
194 return IntPoint(clampToInteger(floorf(p.width())), clampToInteger(floorf(p.h eight()))); 194 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t())));
195 } 195 }
196 196
197 } // namespace blink 197 } // namespace blink
198 198
199 #endif // FloatSize_h 199 #endif // FloatSize_h
OLDNEW
« no previous file with comments | « Source/platform/geometry/FloatPoint.h ('k') | Source/platform/geometry/IntRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698