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

Unified Diff: cc/page_scale_animation.cc

Issue 11293193: ui: Add non-member Vector2dScale() and Vector3dScale() methods to create scaled vectors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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/layer_tree_host_impl_unittest.cc ('k') | ui/gfx/vector2d_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/page_scale_animation.cc
diff --git a/cc/page_scale_animation.cc b/cc/page_scale_animation.cc
index 877cacb96f501f3996ed4409a08a72c9abc522f1..719a403eed7a53da84d7d215c9a6aa105ac9725f 100644
--- a/cc/page_scale_animation.cc
+++ b/cc/page_scale_animation.cc
@@ -22,16 +22,12 @@ gfx::PointF toPointF(const gfx::Vector2dF& vector)
// between 0 and 1, representing the percentage position within the viewport.
gfx::Vector2dF normalizeFromViewport(const gfx::Vector2dF& denormalized, const gfx::SizeF& viewportSize)
{
- gfx::Vector2dF normalized(denormalized);
- normalized.Scale(1 / viewportSize.width(), 1 / viewportSize.height());
- return normalized;
+ return gfx::ScaleVector2d(denormalized, 1 / viewportSize.width(), 1 / viewportSize.height());
}
gfx::Vector2dF denormalizeToViewport(const gfx::Vector2dF& normalized, const gfx::SizeF& viewportSize)
{
- gfx::Vector2dF denormalized(normalized);
- denormalized.Scale(viewportSize.width(), viewportSize.height());
- return denormalized;
+ return gfx::ScaleVector2d(normalized, viewportSize.width(), viewportSize.height());
}
gfx::Vector2dF interpolateBetween(const gfx::Vector2dF& start, const gfx::Vector2dF end, float interp)
@@ -183,8 +179,7 @@ gfx::Vector2dF PageScaleAnimation::scrollOffsetAt(float interp) const
gfx::Vector2dF PageScaleAnimation::anchorAt(float interp) const
{
// Interpolate from start to target anchor in absolute space.
- gfx::Vector2dF delta = m_targetAnchor - m_startAnchor;
- delta.Scale(interp);
+ gfx::Vector2dF delta = gfx::ScaleVector2d(m_targetAnchor - m_startAnchor, interp);
return m_startAnchor + delta;
}
« no previous file with comments | « cc/layer_tree_host_impl_unittest.cc ('k') | ui/gfx/vector2d_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698