Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: cc/input/page_scale_animation.cc

Issue 139173004: [#3] Pass gfx structs by const ref (gfx::SizeF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT and fixed build error for Android platform! Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/page_scale_animation.cc
diff --git a/cc/input/page_scale_animation.cc b/cc/input/page_scale_animation.cc
index 2b7d84c1f54c6fa570b5a6d7d4fff3cdd21877d7..88b64d59d10b037c99fde0e87a8b3f341b98ed44 100644
--- a/cc/input/page_scale_animation.cc
+++ b/cc/input/page_scale_animation.cc
@@ -17,14 +17,14 @@ namespace {
// This takes a viewport-relative vector and returns a vector whose values are
// between 0 and 1, representing the percentage position within the viewport.
gfx::Vector2dF NormalizeFromViewport(gfx::Vector2dF denormalized,
- gfx::SizeF viewport_size) {
+ const gfx::SizeF& viewport_size) {
return gfx::ScaleVector2d(denormalized,
1.f / viewport_size.width(),
1.f / viewport_size.height());
}
gfx::Vector2dF DenormalizeToViewport(gfx::Vector2dF normalized,
- gfx::SizeF viewport_size) {
+ const gfx::SizeF& viewport_size) {
return gfx::ScaleVector2d(normalized,
viewport_size.width(),
viewport_size.height());
@@ -43,8 +43,8 @@ namespace cc {
scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create(
gfx::Vector2dF start_scroll_offset,
float start_page_scale_factor,
- gfx::SizeF viewport_size,
- gfx::SizeF root_layer_size,
+ const gfx::SizeF& viewport_size,
+ const gfx::SizeF& root_layer_size,
scoped_ptr<TimingFunction> timing_function) {
return make_scoped_ptr(new PageScaleAnimation(start_scroll_offset,
start_page_scale_factor,
@@ -56,8 +56,8 @@ scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create(
PageScaleAnimation::PageScaleAnimation(
gfx::Vector2dF start_scroll_offset,
float start_page_scale_factor,
- gfx::SizeF viewport_size,
- gfx::SizeF root_layer_size,
+ const gfx::SizeF& viewport_size,
+ const gfx::SizeF& root_layer_size,
scoped_ptr<TimingFunction> timing_function)
: start_page_scale_factor_(start_page_scale_factor),
target_page_scale_factor_(0.f),
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698