diff options
author | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 22:58:26 +0000 |
---|---|---|
committer | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 22:58:26 +0000 |
commit | 64348eae94a2d07e923aaa0262b6c47947ffa3b3 (patch) | |
tree | c75d0c39b289b4a2543426bbe4461cc3e7117c46 /cc/resources/layer_tiling_data.cc | |
parent | 44ea5317cf5920949c483be09f2931ae20cf23d1 (diff) | |
download | chromium_src-64348eae94a2d07e923aaa0262b6c47947ffa3b3.zip chromium_src-64348eae94a2d07e923aaa0262b6c47947ffa3b3.tar.gz chromium_src-64348eae94a2d07e923aaa0262b6c47947ffa3b3.tar.bz2 |
[#7] Pass gfx::Size by const ref.
Any struct of size > 4 bytes should be passed by const ref.
Passing by ref for these structs is faster than passing by value,
especially when invoking function has multiple parameters and some
other scenarios mentioned in the bug.
BUG=159273
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426
Review URL: https://codereview.chromium.org/145313006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/layer_tiling_data.cc')
-rw-r--r-- | cc/resources/layer_tiling_data.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cc/resources/layer_tiling_data.cc b/cc/resources/layer_tiling_data.cc index e9caf9b..ccbb6d0 100644 --- a/cc/resources/layer_tiling_data.cc +++ b/cc/resources/layer_tiling_data.cc @@ -10,19 +10,20 @@ namespace cc { -scoped_ptr<LayerTilingData> LayerTilingData::Create(gfx::Size tile_size, +scoped_ptr<LayerTilingData> LayerTilingData::Create(const gfx::Size& tile_size, BorderTexelOption border) { return make_scoped_ptr(new LayerTilingData(tile_size, border)); } -LayerTilingData::LayerTilingData(gfx::Size tile_size, BorderTexelOption border) +LayerTilingData::LayerTilingData(const gfx::Size& tile_size, + BorderTexelOption border) : tiling_data_(tile_size, gfx::Size(), border == HAS_BORDER_TEXELS) { SetTileSize(tile_size); } LayerTilingData::~LayerTilingData() {} -void LayerTilingData::SetTileSize(gfx::Size size) { +void LayerTilingData::SetTileSize(const gfx::Size& size) { if (tile_size() == size) return; @@ -111,7 +112,7 @@ Region LayerTilingData::OpaqueRegionInContentRect( return opaque_region; } -void LayerTilingData::SetBounds(gfx::Size size) { +void LayerTilingData::SetBounds(const gfx::Size& size) { tiling_data_.SetTotalSize(size); if (size.IsEmpty()) { tiles_.clear(); |