Index: ui/gfx/geometry/vector2d.cc |
diff --git a/ui/gfx/geometry/vector2d.cc b/ui/gfx/geometry/vector2d.cc |
index aec4d28b9b0fec0f0cdebe65f9462ac68466f4f3..2b4875c39cb4a9905f2ed0699fcb9164ee8fe2d6 100644 |
--- a/ui/gfx/geometry/vector2d.cc |
+++ b/ui/gfx/geometry/vector2d.cc |
@@ -6,8 +6,8 @@ |
#include <cmath> |
+#include "base/numerics/saturated_arithmetic.h" |
#include "base/strings/stringprintf.h" |
-#include "ui/gfx/geometry/safe_integer_conversions.h" |
namespace gfx { |
@@ -16,13 +16,13 @@ bool Vector2d::IsZero() const { |
} |
void Vector2d::Add(const Vector2d& other) { |
- x_ = SafeAdd(other.x_, x_); |
- y_ = SafeAdd(other.y_, y_); |
+ x_ = base::SaturatedAddition(other.x_, x_); |
+ y_ = base::SaturatedAddition(other.y_, y_); |
} |
void Vector2d::Subtract(const Vector2d& other) { |
- x_ = SafeSubtract(x_, other.x_); |
- y_ = SafeSubtract(y_, other.y_); |
+ x_ = base::SaturatedSubtraction(x_, other.x_); |
+ y_ = base::SaturatedSubtraction(y_, other.y_); |
} |
int64_t Vector2d::LengthSquared() const { |