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

Unified Diff: cc/base/region.cc

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: Created 7 years 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
« cc/PRESUBMIT.py ('K') | « cc/base/region.h ('k') | cc/resources/tile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/region.cc
diff --git a/cc/base/region.cc b/cc/base/region.cc
index 1cda32d3ba2d01d53235b474246a32fa95713b72..45e70f0a42364af5956ae9900d2e76887df42103 100644
--- a/cc/base/region.cc
+++ b/cc/base/region.cc
@@ -14,14 +14,14 @@ Region::Region(const Region& region)
: skregion_(region.skregion_) {
}
-Region::Region(gfx::Rect rect)
+Region::Region(const gfx::Rect& rect)
: skregion_(gfx::RectToSkIRect(rect)) {
}
Region::~Region() {
}
-const Region& Region::operator=(gfx::Rect rect) {
+const Region& Region::operator=(const gfx::Rect& rect) {
skregion_ = SkRegion(gfx::RectToSkIRect(rect));
return *this;
}
@@ -51,7 +51,7 @@ bool Region::Contains(gfx::Point point) const {
return skregion_.contains(point.x(), point.y());
}
-bool Region::Contains(gfx::Rect rect) const {
+bool Region::Contains(const gfx::Rect& rect) const {
if (rect.IsEmpty())
return true;
return skregion_.contains(gfx::RectToSkIRect(rect));
@@ -63,7 +63,7 @@ bool Region::Contains(const Region& region) const {
return skregion_.contains(region.skregion_);
}
-bool Region::Intersects(gfx::Rect rect) const {
+bool Region::Intersects(const gfx::Rect& rect) const {
return skregion_.intersects(gfx::RectToSkIRect(rect));
}
« cc/PRESUBMIT.py ('K') | « cc/base/region.h ('k') | cc/resources/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698