summaryrefslogtreecommitdiffstats
path: root/cc/quads/render_pass_draw_quad.cc
diff options
context:
space:
mode:
authorprashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 20:05:06 +0000
committerprashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 20:05:06 +0000
commit0023fc78d056556b353ee17f03760bec8c1fee49 (patch)
tree009367358a1c44b08f3142f63b087d936206ba44 /cc/quads/render_pass_draw_quad.cc
parent37df32bd517577ac6ad20c6d76b236265caeacaf (diff)
downloadchromium_src-0023fc78d056556b353ee17f03760bec8c1fee49.zip
chromium_src-0023fc78d056556b353ee17f03760bec8c1fee49.tar.gz
chromium_src-0023fc78d056556b353ee17f03760bec8c1fee49.tar.bz2
Pass gfx::Rect and gfx::RectF by const ref.
Avoid unneccessary copy of structures gfx::Rect & gfx::RectF 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 by value creates unneccessary overhead which should be avoided. BUG=159273 Review URL: https://codereview.chromium.org/93663004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244224 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/quads/render_pass_draw_quad.cc')
-rw-r--r--cc/quads/render_pass_draw_quad.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/cc/quads/render_pass_draw_quad.cc b/cc/quads/render_pass_draw_quad.cc
index af8cd8c..b26eaf9 100644
--- a/cc/quads/render_pass_draw_quad.cc
+++ b/cc/quads/render_pass_draw_quad.cc
@@ -36,12 +36,12 @@ scoped_ptr<RenderPassDrawQuad> RenderPassDrawQuad::Copy(
void RenderPassDrawQuad::SetNew(
const SharedQuadState* shared_quad_state,
- gfx::Rect rect,
+ const gfx::Rect& rect,
RenderPass::Id render_pass_id,
bool is_replica,
ResourceProvider::ResourceId mask_resource_id,
- gfx::Rect contents_changed_since_last_frame,
- gfx::RectF mask_uv_rect,
+ const gfx::Rect& contents_changed_since_last_frame,
+ const gfx::RectF& mask_uv_rect,
const FilterOperations& filters,
const FilterOperations& background_filters) {
DCHECK_GT(render_pass_id.layer_id, 0);
@@ -58,15 +58,15 @@ void RenderPassDrawQuad::SetNew(
void RenderPassDrawQuad::SetAll(
const SharedQuadState* shared_quad_state,
- gfx::Rect rect,
- gfx::Rect opaque_rect,
- gfx::Rect visible_rect,
+ const gfx::Rect& rect,
+ const gfx::Rect& opaque_rect,
+ const gfx::Rect& visible_rect,
bool needs_blending,
RenderPass::Id render_pass_id,
bool is_replica,
ResourceProvider::ResourceId mask_resource_id,
- gfx::Rect contents_changed_since_last_frame,
- gfx::RectF mask_uv_rect,
+ const gfx::Rect& contents_changed_since_last_frame,
+ const gfx::RectF& mask_uv_rect,
const FilterOperations& filters,
const FilterOperations& background_filters) {
DCHECK_GT(render_pass_id.layer_id, 0);