| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |