Index: ui/gfx/skia_util.cc |
diff --git a/ui/gfx/skia_util.cc b/ui/gfx/skia_util.cc |
index e065fd40c52f680aff1eaaa309b6b75ae09b9cbd..c23eab2b9ea829773d12052763cfa1f59774fb21 100644 |
--- a/ui/gfx/skia_util.cc |
+++ b/ui/gfx/skia_util.cc |
@@ -44,20 +44,10 @@ SkIRect RectToSkIRect(const Rect& rect) { |
return SkIRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()); |
} |
-// Produces a non-negative integer for the difference between min and max, |
-// yielding 0 if it would be negative and INT_MAX if it would overflow. |
-// This yields a length such that min+length is in range as well. |
-static int ClampLengthFromRange(int min, int max) { |
- if (min > max) |
- return 0; |
- return (base::CheckedNumeric<int>(max) - min) |
- .ValueOrDefault(std::numeric_limits<int>::max()); |
-} |
- |
Rect SkIRectToRect(const SkIRect& rect) { |
- return Rect(rect.x(), rect.y(), |
- ClampLengthFromRange(rect.left(), rect.right()), |
- ClampLengthFromRange(rect.top(), rect.bottom())); |
+ Rect result; |
+ result.SetByBounds(rect.left(), rect.top(), rect.right(), rect.bottom()); |
+ return result; |
} |
SkRect RectFToSkRect(const RectF& rect) { |