diff options
author | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-28 06:37:17 +0000 |
---|---|---|
committer | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-28 06:37:17 +0000 |
commit | c93cbb62f684183e0e5689a9fa35619daac10f7b (patch) | |
tree | 8002e049a31ad5cad79f63d19fe1f79b68b8ae2f /cc/resources/picture_layer_tiling_unittest.cc | |
parent | 22a9610ffaed4d7690463d2f6f710d46c206c70f (diff) | |
download | chromium_src-c93cbb62f684183e0e5689a9fa35619daac10f7b.zip chromium_src-c93cbb62f684183e0e5689a9fa35619daac10f7b.tar.gz chromium_src-c93cbb62f684183e0e5689a9fa35619daac10f7b.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
Review URL: https://codereview.chromium.org/145313006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture_layer_tiling_unittest.cc')
-rw-r--r-- | cc/resources/picture_layer_tiling_unittest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc index 002e9aad..83dc4aa 100644 --- a/cc/resources/picture_layer_tiling_unittest.cc +++ b/cc/resources/picture_layer_tiling_unittest.cc @@ -18,7 +18,7 @@ namespace { static gfx::Rect ViewportInLayerSpace( const gfx::Transform& transform, - gfx::Size device_viewport) { + const gfx::Size& device_viewport) { gfx::Transform inverse; if (!transform.GetInverse(&inverse)) @@ -37,7 +37,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { static scoped_ptr<TestablePictureLayerTiling> Create( float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) { return make_scoped_ptr(new TestablePictureLayerTiling( contents_scale, @@ -47,7 +47,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { protected: TestablePictureLayerTiling(float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) : PictureLayerTiling(contents_scale, layer_bounds, client) { } }; @@ -57,9 +57,9 @@ class PictureLayerTilingIteratorTest : public testing::Test { PictureLayerTilingIteratorTest() {} virtual ~PictureLayerTilingIteratorTest() {} - void Initialize(gfx::Size tile_size, + void Initialize(const gfx::Size& tile_size, float contents_scale, - gfx::Size layer_bounds) { + const gfx::Size& layer_bounds) { client_.SetTileSize(tile_size); tiling_ = TestablePictureLayerTiling::Create(contents_scale, layer_bounds, |