From 243e4f1996a61098947b5f9ad1798d6b5412ef0b Mon Sep 17 00:00:00 2001 From: "ajay.berwal@samsung.com" Date: Wed, 5 Feb 2014 09:18:42 +0000 Subject: 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 --- mojo/examples/compositor_app/compositor_host.cc | 2 +- mojo/examples/compositor_app/compositor_host.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mojo/examples') diff --git a/mojo/examples/compositor_app/compositor_host.cc b/mojo/examples/compositor_app/compositor_host.cc index 6ae3f78..d444dc4 100644 --- a/mojo/examples/compositor_app/compositor_host.cc +++ b/mojo/examples/compositor_app/compositor_host.cc @@ -105,7 +105,7 @@ void CompositorHost::Animate(double frame_begin_time) { } void CompositorHost::Layout() {} -void CompositorHost::ApplyScrollAndScale(gfx::Vector2d scroll_delta, +void CompositorHost::ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, float page_scale) {} scoped_ptr CompositorHost::CreateOutputSurface( diff --git a/mojo/examples/compositor_app/compositor_host.h b/mojo/examples/compositor_app/compositor_host.h index ba03a54..a5b470a 100644 --- a/mojo/examples/compositor_app/compositor_host.h +++ b/mojo/examples/compositor_app/compositor_host.h @@ -32,7 +32,7 @@ class CompositorHost : public cc::LayerTreeHostClient { virtual void DidBeginMainFrame() OVERRIDE; virtual void Animate(double frame_begin_time) OVERRIDE; virtual void Layout() OVERRIDE; - virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, + virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, float page_scale) OVERRIDE; virtual scoped_ptr CreateOutputSurface(bool fallback) OVERRIDE; -- cgit v1.1