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

Unified Diff: cc/base/region.h

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 | « cc/base/math_util.cc ('k') | cc/base/region.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/region.h
diff --git a/cc/base/region.h b/cc/base/region.h
index 26c1d2b19900a9280af6159bfd85e997321d9ac7..f3f5cb87ddb0554b2965f08101d90456d0df0407 100644
--- a/cc/base/region.h
+++ b/cc/base/region.h
@@ -24,10 +24,10 @@ class CC_EXPORT Region {
public:
Region();
Region(const Region& region);
- Region(gfx::Rect rect); // NOLINT(runtime/explicit)
+ Region(const gfx::Rect& rect); // NOLINT(runtime/explicit)
~Region();
- const Region& operator=(gfx::Rect rect);
+ const Region& operator=(const gfx::Rect& rect);
const Region& operator=(const Region& region);
void Swap(Region* region);
@@ -36,17 +36,17 @@ class CC_EXPORT Region {
int GetRegionComplexity() const;
bool Contains(gfx::Point point) const;
- bool Contains(gfx::Rect rect) const;
+ bool Contains(const gfx::Rect& rect) const;
bool Contains(const Region& region) const;
- bool Intersects(gfx::Rect rect) const;
+ bool Intersects(const gfx::Rect& rect) const;
bool Intersects(const Region& region) const;
- void Subtract(gfx::Rect rect);
+ void Subtract(const gfx::Rect& rect);
void Subtract(const Region& region);
- void Union(gfx::Rect rect);
+ void Union(const gfx::Rect& rect);
void Union(const Region& region);
- void Intersect(gfx::Rect rect);
+ void Intersect(const gfx::Rect& rect);
void Intersect(const Region& region);
bool Equals(const Region& other) const {
@@ -100,7 +100,7 @@ inline Region SubtractRegions(const Region& a, const Region& b) {
return result;
}
-inline Region SubtractRegions(const Region& a, gfx::Rect b) {
+inline Region SubtractRegions(const Region& a, const gfx::Rect& b) {
Region result = a;
result.Subtract(b);
return result;
@@ -112,7 +112,7 @@ inline Region IntersectRegions(const Region& a, const Region& b) {
return result;
}
-inline Region IntersectRegions(const Region& a, gfx::Rect b) {
+inline Region IntersectRegions(const Region& a, const gfx::Rect& b) {
Region result = a;
result.Intersect(b);
return result;
@@ -124,7 +124,7 @@ inline Region UnionRegions(const Region& a, const Region& b) {
return result;
}
-inline Region UnionRegions(const Region& a, gfx::Rect b) {
+inline Region UnionRegions(const Region& a, const gfx::Rect& b) {
Region result = a;
result.Union(b);
return result;
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/base/region.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698