| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | |
| 140 #endif | |
| 141 | |
| 142 private: | 138 private: |
| 143 float m_width, m_height; | 139 float m_width, m_height; |
| 144 }; | 140 }; |
| 145 | 141 |
| 146 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) | 142 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) |
| 147 { | 143 { |
| 148 a.setWidth(a.width() + b.width()); | 144 a.setWidth(a.width() + b.width()); |
| 149 a.setHeight(a.height() + b.height()); | 145 a.setHeight(a.height() + b.height()); |
| 150 return a; | 146 return a; |
| 151 } | 147 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 inline IntSize expandedIntSize(const FloatSize& p) | 201 inline IntSize expandedIntSize(const FloatSize& p) |
| 206 { | 202 { |
| 207 return IntSize(clampTo<int>(ceilf(p.width())), clampTo<int>(ceilf(p.height()
))); | 203 return IntSize(clampTo<int>(ceilf(p.width())), clampTo<int>(ceilf(p.height()
))); |
| 208 } | 204 } |
| 209 | 205 |
| 210 inline IntPoint flooredIntPoint(const FloatSize& p) | 206 inline IntPoint flooredIntPoint(const FloatSize& p) |
| 211 { | 207 { |
| 212 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh
t()))); | 208 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh
t()))); |
| 213 } | 209 } |
| 214 | 210 |
| 215 // Redeclared here to avoid ODR issues. | 211 PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, const FloatSize&); |
| 216 // See platform/testing/GeometryPrinters.h. | |
| 217 void PrintTo(const FloatSize&, std::ostream*); | |
| 218 | 212 |
| 219 } // namespace blink | 213 } // namespace blink |
| 220 | 214 |
| 221 #endif // FloatSize_h | 215 #endif // FloatSize_h |
| OLD | NEW |