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

Side by Side Diff: cc/input/page_scale_animation.cc

Issue 660333004: cc cleanup: Update paths to geometry headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/input/scrollbar.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/input/page_scale_animation.h" 5 #include "cc/input/page_scale_animation.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/animation/timing_function.h" 10 #include "cc/animation/timing_function.h"
11 #include "ui/gfx/point_f.h" 11 #include "ui/gfx/geometry/point_f.h"
12 #include "ui/gfx/rect_f.h" 12 #include "ui/gfx/geometry/rect_f.h"
13 #include "ui/gfx/vector2d_conversions.h" 13 #include "ui/gfx/geometry/vector2d_conversions.h"
14 14
15 namespace { 15 namespace {
16 16
17 // This takes a viewport-relative vector and returns a vector whose values are 17 // This takes a viewport-relative vector and returns a vector whose values are
18 // between 0 and 1, representing the percentage position within the viewport. 18 // between 0 and 1, representing the percentage position within the viewport.
19 gfx::Vector2dF NormalizeFromViewport(const gfx::Vector2dF& denormalized, 19 gfx::Vector2dF NormalizeFromViewport(const gfx::Vector2dF& denormalized,
20 const gfx::SizeF& viewport_size) { 20 const gfx::SizeF& viewport_size) {
21 return gfx::ScaleVector2d(denormalized, 21 return gfx::ScaleVector2d(denormalized,
22 1.f / viewport_size.width(), 22 1.f / viewport_size.width(),
23 1.f / viewport_size.height()); 23 1.f / viewport_size.height());
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 // Linearly interpolate the magnitude in log scale. 237 // Linearly interpolate the magnitude in log scale.
238 float diff = target_page_scale_factor_ / start_page_scale_factor_; 238 float diff = target_page_scale_factor_ / start_page_scale_factor_;
239 float log_diff = log(diff); 239 float log_diff = log(diff);
240 log_diff *= interp; 240 log_diff *= interp;
241 diff = exp(log_diff); 241 diff = exp(log_diff);
242 return start_page_scale_factor_ * diff; 242 return start_page_scale_factor_ * diff;
243 } 243 }
244 244
245 } // namespace cc 245 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/input/scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698