Index: ui/gfx/rect_f.cc |
diff --git a/ui/gfx/rect_f.cc b/ui/gfx/rect_f.cc |
index 85039244789099ed8f6922e520a31469ea7d6f24..6035391cff9f129997eb3933a08892f21a766b02 100644 |
--- a/ui/gfx/rect_f.cc |
+++ b/ui/gfx/rect_f.cc |
@@ -42,4 +42,28 @@ std::string RectF::ToString() const { |
size().ToString().c_str()); |
} |
+RectF IntersectRects(const RectF& a, const RectF& b) { |
+ RectF result = a; |
+ result.Intersect(b); |
+ return result; |
+} |
+ |
+RectF UnionRects(const RectF& a, const RectF& b) { |
+ RectF result = a; |
+ result.Union(b); |
+ return result; |
+} |
+ |
+RectF SubtractRects(const RectF& a, const RectF& b) { |
+ RectF result = a; |
+ result.Subtract(b); |
+ return result; |
+} |
+ |
+RectF ScaleRect(const RectF& r, float x_scale, float y_scale) { |
+ RectF result = r; |
+ result.Scale(x_scale, y_scale); |
+ return result; |
+} |
+ |
} // namespace gfx |