diff options
Diffstat (limited to 'libs/hwui/utils/MathUtils.h')
-rw-r--r-- | libs/hwui/utils/MathUtils.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/utils/MathUtils.h b/libs/hwui/utils/MathUtils.h index cc8d83f10d43..62bf39ca8a7a 100644 --- a/libs/hwui/utils/MathUtils.h +++ b/libs/hwui/utils/MathUtils.h @@ -31,7 +31,9 @@ public: * Check for floats that are close enough to zero. */ inline static bool isZero(float value) { - return (value >= -NON_ZERO_EPSILON) && (value <= NON_ZERO_EPSILON); + // Using fabsf is more performant as ARM computes + // fabsf in a single instruction. + return fabsf(value) <= NON_ZERO_EPSILON; } inline static bool isOne(float value) { |