| Index: Source/platform/LayoutUnit.h
|
| diff --git a/Source/platform/LayoutUnit.h b/Source/platform/LayoutUnit.h
|
| index e931ced19ca4048a14c083c604a00dbc55007c30..4f677d1dd60f97ad79948760415d97bdbe7cf79e 100644
|
| --- a/Source/platform/LayoutUnit.h
|
| +++ b/Source/platform/LayoutUnit.h
|
| @@ -220,21 +220,14 @@ private:
|
| return ::fabs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
|
| }
|
|
|
| - inline void setValue(int value)
|
| + ALWAYS_INLINE void setValue(int value)
|
| {
|
| - if (value > intMaxForLayoutUnit)
|
| - m_value = std::numeric_limits<int>::max();
|
| - else if (value < intMinForLayoutUnit)
|
| - m_value = std::numeric_limits<int>::min();
|
| - else
|
| - m_value = value * kFixedPointDenominator;
|
| + m_value = saturatedSet(value, kLayoutUnitFractionalBits);
|
| }
|
| +
|
| inline void setValue(unsigned value)
|
| {
|
| - if (value >= static_cast<unsigned>(intMaxForLayoutUnit))
|
| - m_value = std::numeric_limits<int>::max();
|
| - else
|
| - m_value = value * kFixedPointDenominator;
|
| + m_value = saturatedSet(value, kLayoutUnitFractionalBits);
|
| }
|
|
|
| int m_value;
|
|
|