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

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

Issue 2710593003: cc: Fix const value pattern by replacing it by non-const or reference. (Closed)
Patch Set: update rebase Created 3 years, 10 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/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #ifndef CC_INPUT_PAGE_SCALE_ANIMATION_H_ 5 #ifndef CC_INPUT_PAGE_SCALE_ANIMATION_H_
6 #define CC_INPUT_PAGE_SCALE_ANIMATION_H_ 6 #define CC_INPUT_PAGE_SCALE_ANIMATION_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 #include "ui/gfx/geometry/cubic_bezier.h" 13 #include "ui/gfx/geometry/cubic_bezier.h"
14 #include "ui/gfx/geometry/size_f.h" 14 #include "ui/gfx/geometry/size_f.h"
15 #include "ui/gfx/geometry/vector2d.h" 15 #include "ui/gfx/geometry/vector2d.h"
16 #include "ui/gfx/geometry/vector2d_f.h" 16 #include "ui/gfx/geometry/vector2d_f.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 // Used in the CC to pass around a scale animation that hasn't yet been 20 // Used in the CC to pass around a scale animation that hasn't yet been
21 // initialized. 21 // initialized.
22 struct PendingPageScaleAnimation { 22 struct PendingPageScaleAnimation {
23 PendingPageScaleAnimation( 23 PendingPageScaleAnimation(const gfx::Vector2d& target_offset,
24 const gfx::Vector2d _target_offset, 24 bool use_anchor,
25 bool _use_anchor, 25 float scale,
26 float _scale, 26 const base::TimeDelta& duration)
27 const base::TimeDelta& _duration) 27 : target_offset(target_offset),
28 : target_offset(_target_offset), 28 use_anchor(use_anchor),
29 use_anchor(_use_anchor), 29 scale(scale),
30 scale(_scale), 30 duration(duration) {}
31 duration(_duration) {}
32 gfx::Vector2d target_offset; 31 gfx::Vector2d target_offset;
33 bool use_anchor; 32 bool use_anchor;
34 float scale; 33 float scale;
35 base::TimeDelta duration; 34 base::TimeDelta duration;
36 }; 35 };
37 36
38 // A small helper class that does the math for zoom animations, primarily for 37 // A small helper class that does the math for zoom animations, primarily for
39 // double-tap zoom. Initialize it with starting and ending scroll/page scale 38 // double-tap zoom. Initialize it with starting and ending scroll/page scale
40 // positions and an animation length time, then call ...AtTime() at every frame 39 // positions and an animation length time, then call ...AtTime() at every frame
41 // to obtain the current interpolated position. The supplied timing function 40 // to obtain the current interpolated position. The supplied timing function
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 base::TimeDelta duration_; 123 base::TimeDelta duration_;
125 124
126 const gfx::CubicBezier timing_function_; 125 const gfx::CubicBezier timing_function_;
127 126
128 DISALLOW_COPY_AND_ASSIGN(PageScaleAnimation); 127 DISALLOW_COPY_AND_ASSIGN(PageScaleAnimation);
129 }; 128 };
130 129
131 } // namespace cc 130 } // namespace cc
132 131
133 #endif // CC_INPUT_PAGE_SCALE_ANIMATION_H_ 132 #endif // CC_INPUT_PAGE_SCALE_ANIMATION_H_
OLDNEW
« no previous file with comments | « cc/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698