Chromium Code Reviews| Index: include/core/SkScalar.h |
| diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h |
| index 922840fd1af52bb90f43a00e920e9cc008e00da7..806829c681d7234f95f0bf2e18bb1758bea89303 100644 |
| --- a/include/core/SkScalar.h |
| +++ b/include/core/SkScalar.h |
| @@ -228,6 +228,11 @@ static inline bool SkScalarNearlyEqual(SkScalar x, SkScalar y, |
| return SkScalarAbs(x-y) <= tolerance; |
| } |
| +static inline SkScalar SkScalarNormalize(SkScalar x) |
|
reed1
2016/08/26 17:49:43
Given this name, should it trigger only when x is
|
| +{ |
| + return SkScalarNearlyZero(x) ? 0 : x; |
| +} |
| + |
| /** Linearly interpolate between A and B, based on t. |
| If t is 0, return A |
| If t is 1, return B |