Chromium Code Reviews| Index: Source/platform/LayoutUnit.h |
| diff --git a/Source/platform/LayoutUnit.h b/Source/platform/LayoutUnit.h |
| index 4f677d1dd60f97ad79948760415d97bdbe7cf79e..10f43d5c658a0040c619cb7630e3122abf16ca6d 100644 |
| --- a/Source/platform/LayoutUnit.h |
| +++ b/Source/platform/LayoutUnit.h |
| @@ -222,12 +222,24 @@ private: |
| ALWAYS_INLINE void setValue(int value) |
| { |
| - m_value = saturatedSet(value, kLayoutUnitFractionalBits); |
| + // The inner function needs to be implemented as a template to |
| + // maintain a common interface for both C++ and ARM versions. The first |
| + // parameter specifies how many bits we saturate to (for ARM). |
| + m_value = saturatedSetSigned< |
| + 32 - kLayoutUnitFractionalBits, |
|
eseidel
2014/07/22 15:40:21
nit: We don't wrap to 80c in blink. I'd probably
|
| + kLayoutUnitFractionalBits>(value); |
| } |
| - inline void setValue(unsigned value) |
| + ALWAYS_INLINE void setValue(unsigned value) |
| { |
| - m_value = saturatedSet(value, kLayoutUnitFractionalBits); |
| + // The inner function needs to be implemented as a template to |
| + // maintain a common interface for both C++ and ARM versions. The first |
| + // parameter specifies how many bits we saturate to (for ARM). This is |
| + // one bit less than the signed version due to the ARM instructions for |
| + // unsigned saturation. |
| + m_value = saturatedSetUnsigned< |
| + 31 - kLayoutUnitFractionalBits, |
| + kLayoutUnitFractionalBits>(value); |
| } |
| int m_value; |