| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 inline LayoutPoint ceiledLayoutPoint(const FloatPoint& p) { | 198 inline LayoutPoint ceiledLayoutPoint(const FloatPoint& p) { |
| 199 return LayoutPoint(LayoutUnit::fromFloatCeil(p.x()), | 199 return LayoutPoint(LayoutUnit::fromFloatCeil(p.x()), |
| 200 LayoutUnit::fromFloatCeil(p.y())); | 200 LayoutUnit::fromFloatCeil(p.y())); |
| 201 } | 201 } |
| 202 | 202 |
| 203 inline IntSize pixelSnappedIntSize(const LayoutSize& s, const LayoutPoint& p) { | 203 inline IntSize pixelSnappedIntSize(const LayoutSize& s, const LayoutPoint& p) { |
| 204 return IntSize(snapSizeToPixel(s.width(), p.x()), | 204 return IntSize(snapSizeToPixel(s.width(), p.x()), |
| 205 snapSizeToPixel(s.height(), p.y())); | 205 snapSizeToPixel(s.height(), p.y())); |
| 206 } | 206 } |
| 207 | 207 |
| 208 inline LayoutPoint roundedLayoutPoint(const FloatPoint& p) { | |
| 209 return LayoutPoint(p); | |
| 210 } | |
| 211 | |
| 212 inline IntSize roundedIntSize(const LayoutPoint& p) { | 208 inline IntSize roundedIntSize(const LayoutPoint& p) { |
| 213 return IntSize(p.x().round(), p.y().round()); | 209 return IntSize(p.x().round(), p.y().round()); |
| 214 } | 210 } |
| 215 | 211 |
| 216 inline LayoutSize toLayoutSize(const LayoutPoint& p) { | 212 inline LayoutSize toLayoutSize(const LayoutPoint& p) { |
| 217 return LayoutSize(p.x(), p.y()); | 213 return LayoutSize(p.x(), p.y()); |
| 218 } | 214 } |
| 219 | 215 |
| 220 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) { | 216 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) { |
| 221 return flooredLayoutPoint(FloatPoint(s)); | 217 return flooredLayoutPoint(FloatPoint(s)); |
| 222 } | 218 } |
| 223 | 219 |
| 224 // Redeclared here to avoid ODR issues. | 220 // Redeclared here to avoid ODR issues. |
| 225 // See platform/testing/GeometryPrinters.h. | 221 // See platform/testing/GeometryPrinters.h. |
| 226 void PrintTo(const LayoutPoint&, std::ostream*); | 222 void PrintTo(const LayoutPoint&, std::ostream*); |
| 227 | 223 |
| 228 } // namespace blink | 224 } // namespace blink |
| 229 | 225 |
| 230 #endif // LayoutPoint_h | 226 #endif // LayoutPoint_h |
| OLD | NEW |