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

Unified Diff: cc/input/page_scale_animation.cc

Issue 130443005: [#5] Pass gfx structs by const ref (gfx::Vector2dF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments 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/input/top_controls_manager.h » ('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 88b64d59d10b037c99fde0e87a8b3f341b98ed44..7df0244ec0907a1466bc2ab9625c147fe075d754 100644
--- a/cc/input/page_scale_animation.cc
+++ b/cc/input/page_scale_animation.cc
@@ -16,22 +16,22 @@ 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::Vector2dF NormalizeFromViewport(const gfx::Vector2dF& denormalized,
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::Vector2dF DenormalizeToViewport(const gfx::Vector2dF& normalized,
const gfx::SizeF& viewport_size) {
return gfx::ScaleVector2d(normalized,
viewport_size.width(),
viewport_size.height());
}
-gfx::Vector2dF InterpolateBetween(gfx::Vector2dF start,
- gfx::Vector2dF end,
+gfx::Vector2dF InterpolateBetween(const gfx::Vector2dF& start,
+ const gfx::Vector2dF& end,
float interp) {
return start + gfx::ScaleVector2d(end - start, interp);
}
@@ -41,7 +41,7 @@ gfx::Vector2dF InterpolateBetween(gfx::Vector2dF start,
namespace cc {
scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create(
- gfx::Vector2dF start_scroll_offset,
+ const gfx::Vector2dF& start_scroll_offset,
float start_page_scale_factor,
const gfx::SizeF& viewport_size,
const gfx::SizeF& root_layer_size,
@@ -54,7 +54,7 @@ scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create(
}
PageScaleAnimation::PageScaleAnimation(
- gfx::Vector2dF start_scroll_offset,
+ const gfx::Vector2dF& start_scroll_offset,
float start_page_scale_factor,
const gfx::SizeF& viewport_size,
const gfx::SizeF& root_layer_size,
@@ -72,7 +72,7 @@ PageScaleAnimation::PageScaleAnimation(
PageScaleAnimation::~PageScaleAnimation() {}
-void PageScaleAnimation::ZoomTo(gfx::Vector2dF target_scroll_offset,
+void PageScaleAnimation::ZoomTo(const gfx::Vector2dF& target_scroll_offset,
float target_page_scale_factor,
double duration) {
target_page_scale_factor_ = target_page_scale_factor;
@@ -92,7 +92,7 @@ void PageScaleAnimation::ZoomTo(gfx::Vector2dF target_scroll_offset,
start_anchor_ = target_anchor_;
}
-void PageScaleAnimation::ZoomWithAnchor(gfx::Vector2dF anchor,
+void PageScaleAnimation::ZoomWithAnchor(const gfx::Vector2dF& anchor,
float target_page_scale_factor,
double duration) {
start_anchor_ = anchor;
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/input/top_controls_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698