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

Unified Diff: ui/gfx/rect.h

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: 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/image/image_skia_operations.cc ('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.h
diff --git a/ui/gfx/rect.h b/ui/gfx/rect.h
index 2eab239d4bc76d948c93b86606622841fe778b39..432d77c2f671e708fdb90a0f734b1b86dd789ab4 100644
--- a/ui/gfx/rect.h
+++ b/ui/gfx/rect.h
@@ -75,6 +75,24 @@ inline bool operator!=(const Rect& lhs, const Rect& rhs) {
return !(lhs == rhs);
}
+inline Rect Intersection(const Rect& a, const Rect& b) {
sky 2012/10/25 23:31:53 I think we need more descriptive names otherwise w
danakj 2012/10/26 00:16:04 Sure, though I thought the same and enne@ convince
+ Rect result = a;
+ result.Intersect(b);
+ return result;
+}
+
+inline Rect Union(const Rect& a, const Rect& b) {
+ Rect result = a;
+ result.Union(b);
+ return result;
+}
+
+inline Rect Subtraction(const Rect& a, const Rect& b) {
+ Rect result = a;
+ result.Subtract(b);
+ return result;
+}
+
#if !defined(COMPILER_MSVC)
extern template class RectBase<Rect, Point, Size, Insets, int>;
#endif
« no previous file with comments | « ui/gfx/image/image_skia_operations.cc ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698