Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1256)

Unified Diff: ui/gfx/rect.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect.cc
diff --git a/ui/gfx/rect.cc b/ui/gfx/rect.cc
index b46a9d779c266308fd2243df1bd9c49283ff23da..551e6f66b3cda6260b6a754d22d1f151d5da9eb4 100644
--- a/ui/gfx/rect.cc
+++ b/ui/gfx/rect.cc
@@ -88,4 +88,22 @@ std::string Rect::ToString() const {
size().ToString().c_str());
}
+Rect IntersectRects(const Rect& a, const Rect& b) {
+ Rect result = a;
+ result.Intersect(b);
+ return result;
+}
+
+Rect UnionRects(const Rect& a, const Rect& b) {
+ Rect result = a;
+ result.Union(b);
+ return result;
+}
+
+Rect SubtractRects(const Rect& a, const Rect& b) {
+ Rect result = a;
+ result.Subtract(b);
+ return result;
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698