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-05-01 19:25:35 +0000
committera.renevier@samsung.com <a.renevier@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 19:25:35 +0000
commit753af8970fc08d7e8377822b3eb309e303b4087b (patch)
tree752762d3545f7f5560ef7c602d59ec42924fdca7 /cc/animation/animation.h
parent56fa88601bb49fba7d998c51efb6f5c7ed8d4ea7 (diff)
downloadchromium_src-753af8970fc08d7e8377822b3eb309e303b4087b.zip
chromium_src-753af8970fc08d7e8377822b3eb309e303b4087b.tar.gz
chromium_src-753af8970fc08d7e8377822b3eb309e303b4087b.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/227733004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267606 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 ecc48b5..e4476ff 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 {
@@ -158,7 +156,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