diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 17:21:03 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 16:25:15 +0000 |
commit | c551f43206405019121bd2b2c93714319a0a3300 (patch) | |
tree | 1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/cc/base/math_util.cc | |
parent | 7961cea6d1041e3e454dae6a1da660b453efd238 (diff) |
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/base/math_util.cc')
-rw-r--r-- | chromium/cc/base/math_util.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chromium/cc/base/math_util.cc b/chromium/cc/base/math_util.cc index a484a243514..0e072b98d39 100644 --- a/chromium/cc/base/math_util.cc +++ b/chromium/cc/base/math_util.cc @@ -11,6 +11,7 @@ #include <xmmintrin.h> #endif +#include "base/numerics/ranges.h" #include "base/trace_event/traced_value.h" #include "base/values.h" #include "ui/gfx/geometry/angle_conversions.h" @@ -161,8 +162,7 @@ static inline bool IsNearlyTheSame(float f, float g) { // for the base of the scale too. static const float epsilon_scale = 0.00001f; return std::abs(f - g) < - epsilon_scale * - std::max(std::max(std::abs(f), std::abs(g)), epsilon_scale); + epsilon_scale * std::max({std::abs(f), std::abs(g), epsilon_scale}); } static inline bool IsNearlyTheSame(const gfx::PointF& lhs, @@ -613,7 +613,7 @@ float MathUtil::SmallestAngleBetweenVectors(const gfx::Vector2dF& v1, const gfx::Vector2dF& v2) { double dot_product = gfx::DotProduct(v1, v2) / v1.Length() / v2.Length(); // Clamp to compensate for rounding errors. - dot_product = std::max(-1.0, std::min(1.0, dot_product)); + dot_product = base::ClampToRange(dot_product, -1.0, 1.0); return static_cast<float>(gfx::RadToDeg(std::acos(dot_product))); } |