summaryrefslogtreecommitdiffstats
path: root/cc/animation/animation.h
diff options
context:
space:
mode:
authora.renevier@samsung.com <a.renevier@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 20:22:22 +0000
committera.renevier@samsung.com <a.renevier@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 20:22:22 +0000
commit978f5355315d66fb245b45bf3a9b146b847c712e (patch)
tree063f5aa252e777fcfc0b47e6b990a445cf353df0 /cc/animation/animation.h
parent157552a5a5749f237699c7311f236a3e02e03d14 (diff)
downloadchromium_src-978f5355315d66fb245b45bf3a9b146b847c712e.zip
chromium_src-978f5355315d66fb245b45bf3a9b146b847c712e.tar.gz
chromium_src-978f5355315d66fb245b45bf3a9b146b847c712e.tar.bz2
Handle direction control in compositor Animations
This patch is the compositor side. The blink side is handled in issue #178263006 Handle reverse animations in the compositor. Currently, compositor only understand alternate direction. And in order to reverse an animation, it needs to be passed a reversed timing function. This patch introduces a Direction enum parameter in animation. BUG=348071 Review URL: https://codereview.chromium.org/180153010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260628 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation/animation.h')
-rw-r--r--cc/animation/animation.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/cc/animation/animation.h b/cc/animation/animation.h
index f996c38..56f1ff7 100644
--- a/cc/animation/animation.h
+++ b/cc/animation/animation.h
@@ -48,6 +48,8 @@ class CC_EXPORT Animation {
TargetPropertyEnumSize
};
+ enum Direction { Normal, Reverse, Alternate, AlternateReverse };
+
static scoped_ptr<Animation> Create(scoped_ptr<AnimationCurve> curve,
int animation_id,
int group_id,
@@ -78,12 +80,8 @@ class CC_EXPORT Animation {
void Suspend(double monotonic_time);
void Resume(double monotonic_time);
- // If alternates_direction is true, on odd numbered iterations we reverse the
- // curve.
- bool alternates_direction() const { return alternates_direction_; }
- void set_alternates_direction(bool alternates) {
- alternates_direction_ = alternates;
- }
+ Direction direction() { return direction_; }
+ void set_direction(Direction direction) { direction_ = direction; }
bool IsFinishedAt(double monotonic_time) const;
bool is_finished() const {
@@ -150,7 +148,7 @@ class CC_EXPORT Animation {
RunState run_state_;
int iterations_;
double start_time_;
- bool alternates_direction_;
+ Direction direction_;
// The time offset effectively pushes the start of the animation back in time.
// This is used for resuming paused animations -- an animation is added with a