summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorajay.berwal@samsung.com <ajay.berwal@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-05 09:18:42 +0000
committerajay.berwal@samsung.com <ajay.berwal@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-05 09:18:42 +0000
commit243e4f1996a61098947b5f9ad1798d6b5412ef0b (patch)
tree647808bf21f492a652d54e8e15c12177ca04e824 /content/renderer
parent1e7e41e75151197f026df35b9c01c4bc63bccef0 (diff)
downloadchromium_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 'content/renderer')
-rw-r--r--content/renderer/gpu/render_widget_compositor.cc5
-rw-r--r--content/renderer/gpu/render_widget_compositor.h2
-rw-r--r--content/renderer/input/input_handler_proxy_unittest.cc2
3 files changed, 5 insertions, 4 deletions
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index e4c61f7..594c4b5 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -568,8 +568,9 @@ void RenderWidgetCompositor::Layout() {
widget_->webwidget()->layout();
}
-void RenderWidgetCompositor::ApplyScrollAndScale(gfx::Vector2d scroll_delta,
- float page_scale) {
+void RenderWidgetCompositor::ApplyScrollAndScale(
+ const gfx::Vector2d& scroll_delta,
+ float page_scale) {
widget_->webwidget()->applyScrollAndScale(scroll_delta, page_scale);
}
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h
index 3f9fa49..1db10c3 100644
--- a/content/renderer/gpu/render_widget_compositor.h
+++ b/content/renderer/gpu/render_widget_compositor.h
@@ -119,7 +119,7 @@ class RenderWidgetCompositor : public blink::WebLayerTreeView,
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<cc::OutputSurface> CreateOutputSurface(bool fallback)
OVERRIDE;
diff --git a/content/renderer/input/input_handler_proxy_unittest.cc b/content/renderer/input/input_handler_proxy_unittest.cc
index c5bf5b4..4a63128 100644
--- a/content/renderer/input/input_handler_proxy_unittest.cc
+++ b/content/renderer/input/input_handler_proxy_unittest.cc
@@ -62,7 +62,7 @@ class MockInputHandler : public cc::InputHandler {
virtual void BindToClient(cc::InputHandlerClient* client) OVERRIDE {}
- virtual void StartPageScaleAnimation(gfx::Vector2d target_offset,
+ virtual void StartPageScaleAnimation(const gfx::Vector2d& target_offset,
bool anchor_point,
float page_scale,
base::TimeDelta duration) OVERRIDE {}