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

Unified Diff: cc/animation/animation.h

Issue 579863004: CC: Add fill mode to compositor animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/animation/animation.cc » ('j') | cc/animation/animation.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation.h
diff --git a/cc/animation/animation.h b/cc/animation/animation.h
index aac6d7be6938d6c09067a7064ff7eb3c6400c412..d6c1941ea9bff758cf1ed1a1544210a495cc8758 100644
--- a/cc/animation/animation.h
+++ b/cc/animation/animation.h
@@ -51,6 +51,13 @@ class CC_EXPORT Animation {
enum Direction { Normal, Reverse, Alternate, AlternateReverse };
+ enum FillMode {
+ FillModeNone,
+ FillModeForwards,
+ FillModeBackwards,
+ FillModeBoth
+ };
+
static scoped_ptr<Animation> Create(scoped_ptr<AnimationCurve> curve,
int animation_id,
int group_id,
@@ -89,6 +96,9 @@ class CC_EXPORT Animation {
Direction direction() { return direction_; }
void set_direction(Direction direction) { direction_ = direction; }
+ FillMode fill_mode() { return fill_mode_; }
+ void set_fill_mode(FillMode fill_mode) { fill_mode_ = fill_mode; }
+
double playback_rate() { return playback_rate_; }
void set_playback_rate(double playback_rate) {
playback_rate_ = playback_rate;
@@ -101,6 +111,8 @@ class CC_EXPORT Animation {
run_state_ == WaitingForDeletion;
}
+ bool NoEffectBeforeAnimation(base::TimeTicks monotonic_time) const;
+
AnimationCurve* curve() { return curve_.get(); }
const AnimationCurve* curve() const { return curve_.get(); }
@@ -152,6 +164,8 @@ class CC_EXPORT Animation {
int group_id,
TargetProperty target_property);
+ double ConvertToActiveTime(base::TimeTicks monotonic_time) const;
+
scoped_ptr<AnimationCurve> curve_;
// IDs are not necessarily unique.
@@ -170,6 +184,7 @@ class CC_EXPORT Animation {
base::TimeTicks start_time_;
Direction direction_;
double playback_rate_;
+ FillMode fill_mode_;
// 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
« no previous file with comments | « no previous file | cc/animation/animation.cc » ('j') | cc/animation/animation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698