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

Side by Side Diff: ui/gfx/animation/linear_animation.h

Issue 26880010: gfx: Add FrameTime and DisplayTime classes (Closed) Base URL: http://git.chromium.org/chromium/src.git@checkHighResNow4
Patch Set: WIP Created 7 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/animation/animation_container_element.h ('k') | ui/gfx/animation/linear_animation.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 UI_GFX_ANIMATION_LINEAR_ANIMATION_H_ 5 #ifndef UI_GFX_ANIMATION_LINEAR_ANIMATION_H_
6 #define UI_GFX_ANIMATION_LINEAR_ANIMATION_H_ 6 #define UI_GFX_ANIMATION_LINEAR_ANIMATION_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "ui/gfx/animation/animation.h" 9 #include "ui/gfx/animation/animation.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void SetDuration(int duration); 43 void SetDuration(int duration);
44 44
45 protected: 45 protected:
46 // Called when the animation progresses. Subclasses override this to 46 // Called when the animation progresses. Subclasses override this to
47 // efficiently update their state. 47 // efficiently update their state.
48 virtual void AnimateToState(double state) {} 48 virtual void AnimateToState(double state) {}
49 49
50 // Invoked by the AnimationContainer when the animation is running to advance 50 // Invoked by the AnimationContainer when the animation is running to advance
51 // the animation. Use |time_now| rather than Time::Now to avoid multiple 51 // the animation. Use |time_now| rather than Time::Now to avoid multiple
52 // animations running at the same time diverging. 52 // animations running at the same time diverging.
53 virtual void Step(base::TimeTicks time_now) OVERRIDE; 53 virtual void Step(gfx::FrameTime time_now) OVERRIDE;
54 54
55 // Overriden to initialize state. 55 // Overriden to initialize state.
56 virtual void AnimationStarted() OVERRIDE; 56 virtual void AnimationStarted() OVERRIDE;
57 57
58 // Overriden to advance to the end (if End was invoked). 58 // Overriden to advance to the end (if End was invoked).
59 virtual void AnimationStopped() OVERRIDE; 59 virtual void AnimationStopped() OVERRIDE;
60 60
61 // Overriden to return true if state is not 1. 61 // Overriden to return true if state is not 1.
62 virtual bool ShouldSendCanceledFromStop() OVERRIDE; 62 virtual bool ShouldSendCanceledFromStop() OVERRIDE;
63 63
64 private: 64 private:
65 base::TimeDelta duration_; 65 base::TimeDelta duration_;
66 66
67 // Current state, on a scale from 0.0 to 1.0. 67 // Current state, on a scale from 0.0 to 1.0.
68 double state_; 68 double state_;
69 69
70 // If true, we're in end. This is used to determine if the animation should 70 // If true, we're in end. This is used to determine if the animation should
71 // be advanced to the end from AnimationStopped. 71 // be advanced to the end from AnimationStopped.
72 bool in_end_; 72 bool in_end_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(LinearAnimation); 74 DISALLOW_COPY_AND_ASSIGN(LinearAnimation);
75 }; 75 };
76 76
77 } // namespace gfx 77 } // namespace gfx
78 78
79 #endif // APP_LINEAR_ANIMATION_H_ 79 #endif // APP_LINEAR_ANIMATION_H_
OLDNEW
« no previous file with comments | « ui/gfx/animation/animation_container_element.h ('k') | ui/gfx/animation/linear_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698