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

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

Issue 12965007: Fix cpplint errors in cc/(animation|input|layers|trees|test)/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/animation/transform_operations_unittest.cc ('k') | cc/input/pinch_zoom_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 "ui/gfx/point_f.h" 10 #include "ui/gfx/point_f.h"
(...skipping 17 matching lines...) Expand all
28 viewport_size.width(), 28 viewport_size.width(),
29 viewport_size.height()); 29 viewport_size.height());
30 } 30 }
31 31
32 gfx::Vector2dF InterpolateBetween(gfx::Vector2dF start, 32 gfx::Vector2dF InterpolateBetween(gfx::Vector2dF start,
33 gfx::Vector2dF end, 33 gfx::Vector2dF end,
34 float interp) { 34 float interp) {
35 return start + gfx::ScaleVector2d(end - start, interp); 35 return start + gfx::ScaleVector2d(end - start, interp);
36 } 36 }
37 37
38 } 38 } // namespace
39 39
40 namespace cc { 40 namespace cc {
41 41
42 scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create( 42 scoped_ptr<PageScaleAnimation> PageScaleAnimation::Create(
43 gfx::Vector2dF start_scroll_offset, 43 gfx::Vector2dF start_scroll_offset,
44 float start_page_scale_factor, 44 float start_page_scale_factor,
45 gfx::SizeF viewport_size, 45 gfx::SizeF viewport_size,
46 gfx::SizeF root_layer_size, 46 gfx::SizeF root_layer_size,
47 double start_time) { 47 double start_time) {
48 return make_scoped_ptr(new PageScaleAnimation(start_scroll_offset, 48 return make_scoped_ptr(new PageScaleAnimation(start_scroll_offset,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // Linearly interpolate the magnitude in log scale. 217 // Linearly interpolate the magnitude in log scale.
218 float diff = target_page_scale_factor_ / start_page_scale_factor_; 218 float diff = target_page_scale_factor_ / start_page_scale_factor_;
219 float log_diff = log(diff); 219 float log_diff = log(diff);
220 log_diff *= interp; 220 log_diff *= interp;
221 diff = exp(log_diff); 221 diff = exp(log_diff);
222 return start_page_scale_factor_ * diff; 222 return start_page_scale_factor_ * diff;
223 } 223 }
224 224
225 } // namespace cc 225 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/transform_operations_unittest.cc ('k') | cc/input/pinch_zoom_scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698