summaryrefslogtreecommitdiffstats
path: root/cc/test/test_texture.cc
diff options
context:
space:
mode:
authorprashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-29 22:58:26 +0000
committerprashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-29 22:58:26 +0000
commit64348eae94a2d07e923aaa0262b6c47947ffa3b3 (patch)
treec75d0c39b289b4a2543426bbe4461cc3e7117c46 /cc/test/test_texture.cc
parent44ea5317cf5920949c483be09f2931ae20cf23d1 (diff)
downloadchromium_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/test/test_texture.cc')
-rw-r--r--cc/test/test_texture.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/test/test_texture.cc b/cc/test/test_texture.cc
index 0f4f07c..8addc79 100644
--- a/cc/test/test_texture.cc
+++ b/cc/test/test_texture.cc
@@ -9,7 +9,7 @@
namespace cc {
-size_t TextureSizeBytes(gfx::Size size, ResourceFormat format) {
+size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format) {
unsigned int components_per_pixel = 4;
unsigned int bytes_per_component = 1;
return size.width() * size.height() * components_per_pixel *
@@ -28,7 +28,7 @@ TestTexture::TestTexture() : format(RGBA_8888) {
TestTexture::~TestTexture() {}
-void TestTexture::Reallocate(gfx::Size size, ResourceFormat format) {
+void TestTexture::Reallocate(const gfx::Size& size, ResourceFormat format) {
this->size = size;
this->format = format;
this->data.reset(new uint8_t[TextureSizeBytes(size, format)]);