diff options
author | ajay.berwal@samsung.com <ajay.berwal@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 09:18:42 +0000 |
---|---|---|
committer | ajay.berwal@samsung.com <ajay.berwal@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 09:18:42 +0000 |
commit | 243e4f1996a61098947b5f9ad1798d6b5412ef0b (patch) | |
tree | 647808bf21f492a652d54e8e15c12177ca04e824 /cc/output | |
parent | 1e7e41e75151197f026df35b9c01c4bc63bccef0 (diff) | |
download | chromium_src-243e4f1996a61098947b5f9ad1798d6b5412ef0b.zip chromium_src-243e4f1996a61098947b5f9ad1798d6b5412ef0b.tar.gz chromium_src-243e4f1996a61098947b5f9ad1798d6b5412ef0b.tar.bz2 |
Pass gfx structs by const ref (gfx::Vector2d)
Avoid unneccessary copy of structures gfx::Vector2d
by passing them by const ref rather than value.
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.
Pass gfx structs by const ref (gfx::Vector2d)
BUG=159273
Review URL: https://codereview.chromium.org/132163009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output')
-rw-r--r-- | cc/output/direct_renderer.cc | 2 | ||||
-rw-r--r-- | cc/output/direct_renderer.h | 2 | ||||
-rw-r--r-- | cc/output/software_output_device.cc | 4 | ||||
-rw-r--r-- | cc/output/software_output_device.h | 3 |
4 files changed, 5 insertions, 6 deletions
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index 06e2afb..5cb3d4d 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc @@ -139,7 +139,7 @@ DirectRenderer::~DirectRenderer() {} bool DirectRenderer::CanReadPixels() const { return true; } void DirectRenderer::SetEnlargePassTextureAmountForTesting( - gfx::Vector2d amount) { + const gfx::Vector2d& amount) { enlarge_pass_texture_amount_ = amount; } diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h index 08b75a1..451c7d7 100644 --- a/cc/output/direct_renderer.h +++ b/cc/output/direct_renderer.h @@ -59,7 +59,7 @@ class CC_EXPORT DirectRenderer : public Renderer { bool disable_picture_quad_image_filtering; }; - void SetEnlargePassTextureAmountForTesting(gfx::Vector2d amount); + void SetEnlargePassTextureAmountForTesting(const gfx::Vector2d& amount); protected: DirectRenderer(RendererClient* client, diff --git a/cc/output/software_output_device.cc b/cc/output/software_output_device.cc index 9730f7d..d066f4c 100644 --- a/cc/output/software_output_device.cc +++ b/cc/output/software_output_device.cc @@ -48,8 +48,8 @@ void SoftwareOutputDevice::CopyToBitmap( bitmap.extractSubset(output, gfx::RectToSkIRect(rect)); } -void SoftwareOutputDevice::Scroll( - gfx::Vector2d delta, const gfx::Rect& clip_rect) { +void SoftwareOutputDevice::Scroll(const gfx::Vector2d& delta, + const gfx::Rect& clip_rect) { NOTIMPLEMENTED(); } diff --git a/cc/output/software_output_device.h b/cc/output/software_output_device.h index 827210e..f03e964 100644 --- a/cc/output/software_output_device.h +++ b/cc/output/software_output_device.h @@ -55,8 +55,7 @@ class CC_EXPORT SoftwareOutputDevice { // Blit the pixel content of the SoftwareOutputDevice by |delta| with the // write clipped to |clip_rect|. - virtual void Scroll(gfx::Vector2d delta, - const gfx::Rect& clip_rect); + virtual void Scroll(const gfx::Vector2d& delta, const gfx::Rect& clip_rect); // Discard the backing buffer in the surface provided by this instance. virtual void DiscardBackbuffer() {} |