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

Side by Side Diff: cc/animation/scroll_offset_animation_curve.h

Issue 95763002: cc: Support animating scroll offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ 5 #ifndef CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_
6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ 6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/animation/animation_curve.h" 9 #include "cc/animation/animation_curve.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 class TimingFunction; 14 class TimingFunction;
15 15
16 class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { 16 class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve {
17 public: 17 public:
18 static scoped_ptr<ScrollOffsetAnimationCurve> Create( 18 static scoped_ptr<ScrollOffsetAnimationCurve> Create(
19 gfx::Vector2dF target_value, 19 gfx::Vector2dF target_value,
20 scoped_ptr<TimingFunction> timing_function); 20 scoped_ptr<TimingFunction> timing_function);
21 21
22 virtual ~ScrollOffsetAnimationCurve(); 22 virtual ~ScrollOffsetAnimationCurve();
23 23
24 void set_duration(double duration) { duration_ = duration; } 24 void SetInitialValue(gfx::Vector2dF initial_value);
25 25 gfx::Vector2dF GetValue(double t) const;
26 void set_initial_value(gfx::Vector2dF initial_value) {
27 initial_value_ = initial_value;
28 }
29
30 virtual gfx::Vector2dF GetValue(double t) const;
31 26
32 // AnimationCurve implementation 27 // AnimationCurve implementation
33 virtual double Duration() const OVERRIDE; 28 virtual double Duration() const OVERRIDE;
34 virtual CurveType Type() const OVERRIDE; 29 virtual CurveType Type() const OVERRIDE;
35 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; 30 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
36 31
37 private: 32 private:
38 ScrollOffsetAnimationCurve(gfx::Vector2dF target_value, 33 ScrollOffsetAnimationCurve(gfx::Vector2dF target_value,
39 scoped_ptr <TimingFunction> timing_function); 34 scoped_ptr <TimingFunction> timing_function);
40 35
41 gfx::Vector2dF initial_value_; 36 gfx::Vector2dF initial_value_;
42 gfx::Vector2dF target_value_; 37 gfx::Vector2dF target_value_;
43 double duration_; 38 double duration_;
44 39
45 scoped_ptr<TimingFunction> timing_function_; 40 scoped_ptr<TimingFunction> timing_function_;
46 41
47 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); 42 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve);
48 }; 43 };
49 44
50 } // namespace cc 45 } // namespace cc
51 46
52 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ 47 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698