| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef LayoutRect_h | 31 #ifndef LayoutRect_h |
| 32 #define LayoutRect_h | 32 #define LayoutRect_h |
| 33 | 33 |
| 34 #include "platform/geometry/IntRect.h" | 34 #include "platform/geometry/IntRect.h" |
| 35 #include "platform/geometry/LayoutPoint.h" | 35 #include "platform/geometry/LayoutPoint.h" |
| 36 #include "platform/geometry/LayoutRectOutsets.h" | 36 #include "platform/geometry/LayoutRectOutsets.h" |
| 37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 38 #include <iosfwd> |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 class FloatRect; | 42 class FloatRect; |
| 42 class DoubleRect; | 43 class DoubleRect; |
| 43 | 44 |
| 44 class PLATFORM_EXPORT LayoutRect { | 45 class PLATFORM_EXPORT LayoutRect { |
| 45 public: | 46 public: |
| 46 LayoutRect() { } | 47 LayoutRect() { } |
| 47 LayoutRect(const LayoutPoint& location, const LayoutSize& size) | 48 LayoutRect(const LayoutPoint& location, const LayoutSize& size) |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 inline IntRect pixelSnappedIntRectFromEdges(LayoutUnit left, LayoutUnit top, Lay
outUnit right, LayoutUnit bottom) | 245 inline IntRect pixelSnappedIntRectFromEdges(LayoutUnit left, LayoutUnit top, Lay
outUnit right, LayoutUnit bottom) |
| 245 { | 246 { |
| 246 return IntRect(left.round(), top.round(), snapSizeToPixel(right - left, left
), snapSizeToPixel(bottom - top, top)); | 247 return IntRect(left.round(), top.round(), snapSizeToPixel(right - left, left
), snapSizeToPixel(bottom - top, top)); |
| 247 } | 248 } |
| 248 | 249 |
| 249 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) | 250 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) |
| 250 { | 251 { |
| 251 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location
)); | 252 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location
)); |
| 252 } | 253 } |
| 253 | 254 |
| 255 // Redeclared here to avoid ODR issues. |
| 256 // See platform/testing/GeometryPrinters.h. |
| 257 void PrintTo(const LayoutRect&, std::ostream*); |
| 258 |
| 254 } // namespace blink | 259 } // namespace blink |
| 255 | 260 |
| 256 #endif // LayoutRect_h | 261 #endif // LayoutRect_h |
| OLD | NEW |