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

Unified Diff: cc/base/tiling_data.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: 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/tiling_data.h ('k') | cc/debug/debug_rect_history.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/tiling_data.cc
diff --git a/cc/base/tiling_data.cc b/cc/base/tiling_data.cc
index 1045d89adddbf137636909a6198d5d5751107281..9cdf02765f754fbb46ecbae5d0729a97d5babd02 100644
--- a/cc/base/tiling_data.cc
+++ b/cc/base/tiling_data.cc
@@ -272,7 +272,8 @@ TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data)
index_y_(-1) {
}
-TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect)
+TilingData::Iterator::Iterator(const TilingData* tiling_data,
+ const gfx::Rect& tiling_rect)
: BaseIterator(tiling_data),
left_(-1),
right_(-1),
@@ -282,6 +283,7 @@ TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect)
return;
}
+ gfx::Rect rect(tiling_rect);
rect.Intersect(gfx::Rect(tiling_data_->total_size()));
index_x_ = tiling_data_->FirstBorderTileXIndexFromSrcCoord(rect.x());
index_y_ = tiling_data_->FirstBorderTileYIndexFromSrcCoord(rect.y());
@@ -313,8 +315,8 @@ TilingData::Iterator& TilingData::Iterator::operator++() {
TilingData::DifferenceIterator::DifferenceIterator(
const TilingData* tiling_data,
- gfx::Rect consider,
- gfx::Rect ignore)
+ const gfx::Rect& consider_rect,
+ const gfx::Rect& ignore_rect)
: BaseIterator(tiling_data),
consider_left_(-1),
consider_top_(-1),
@@ -330,6 +332,8 @@ TilingData::DifferenceIterator::DifferenceIterator(
}
gfx::Rect bounds(tiling_data_->total_size());
+ gfx::Rect consider(consider_rect);
+ gfx::Rect ignore(ignore_rect);
consider.Intersect(bounds);
ignore.Intersect(bounds);
if (consider.IsEmpty()) {
« no previous file with comments | « cc/base/tiling_data.h ('k') | cc/debug/debug_rect_history.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698