| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 FloatRect FloatRect::narrowPrecision(double x, | 55 FloatRect FloatRect::narrowPrecision(double x, |
| 56 double y, | 56 double y, |
| 57 double width, | 57 double width, |
| 58 double height) { | 58 double height) { |
| 59 return FloatRect(clampTo<float>(x), clampTo<float>(y), clampTo<float>(width), | 59 return FloatRect(clampTo<float>(x), clampTo<float>(y), clampTo<float>(width), |
| 60 clampTo<float>(height)); | 60 clampTo<float>(height)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 #if ENABLE(ASSERT) | 63 #if DCHECK_IS_ON() |
| 64 bool FloatRect::mayNotHaveExactIntRectRepresentation() const { | 64 bool FloatRect::mayNotHaveExactIntRectRepresentation() const { |
| 65 static const float maxExactlyExpressible = 1 << FLT_MANT_DIG; | 65 static const float maxExactlyExpressible = 1 << FLT_MANT_DIG; |
| 66 return fabs(x()) > maxExactlyExpressible || | 66 return fabs(x()) > maxExactlyExpressible || |
| 67 fabs(y()) > maxExactlyExpressible || | 67 fabs(y()) > maxExactlyExpressible || |
| 68 fabs(width()) > maxExactlyExpressible || | 68 fabs(width()) > maxExactlyExpressible || |
| 69 fabs(height()) > maxExactlyExpressible || | 69 fabs(height()) > maxExactlyExpressible || |
| 70 fabs(maxX()) > maxExactlyExpressible || | 70 fabs(maxX()) > maxExactlyExpressible || |
| 71 fabs(maxY()) > maxExactlyExpressible; | 71 fabs(maxY()) > maxExactlyExpressible; |
| 72 } | 72 } |
| 73 #endif | 73 #endif |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 destRect.y() + (r.y() - srcRect.y()) * heightScale, | 209 destRect.y() + (r.y() - srcRect.y()) * heightScale, |
| 210 r.width() * widthScale, r.height() * heightScale); | 210 r.width() * widthScale, r.height() * heightScale); |
| 211 } | 211 } |
| 212 | 212 |
| 213 String FloatRect::toString() const { | 213 String FloatRect::toString() const { |
| 214 return String::format("%s %s", location().toString().ascii().data(), | 214 return String::format("%s %s", location().toString().ascii().data(), |
| 215 size().toString().ascii().data()); | 215 size().toString().ascii().data()); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace blink | 218 } // namespace blink |
| OLD | NEW |