summaryrefslogtreecommitdiffstats
path: root/cc/animation/animation.h
diff options
context:
space:
mode:
authorajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 18:17:34 +0000
committerajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 18:17:34 +0000
commitb33348f4524c917d65e9ebb4d1cc6acc9b82bb39 (patch)
treed22d6c0331f2932d021629b79257c55b554a3232 /cc/animation/animation.h
parent25df7ada51fd9b262daba11f7d308e97e08e4651 (diff)
downloadchromium_src-b33348f4524c917d65e9ebb4d1cc6acc9b82bb39.zip
chromium_src-b33348f4524c917d65e9ebb4d1cc6acc9b82bb39.tar.gz
chromium_src-b33348f4524c917d65e9ebb4d1cc6acc9b82bb39.tar.bz2
cc: Animations committed together should start together
This change makes newly-committed animations wait for tree activation before they're able to affect the active tree, and makes newly-deleted animations wait for tree activation before they no longer affect the active tree. This is accomplished by tracking whether each animation affects active observers, inactive (pending) observers, or both. As a result, animations committed together will start together, after the next activation. BUG=225643 Review URL: https://codereview.chromium.org/259043004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation/animation.h')
-rw-r--r--cc/animation/animation.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/cc/animation/animation.h b/cc/animation/animation.h
index 3cfc8bb..ecc48b5 100644
--- a/cc/animation/animation.h
+++ b/cc/animation/animation.h
@@ -126,6 +126,16 @@ class CC_EXPORT Animation {
void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; }
bool is_impl_only() const { return is_impl_only_; }
+ void set_affects_active_observers(bool affects_active_observers) {
+ affects_active_observers_ = affects_active_observers;
+ }
+ bool affects_active_observers() const { return affects_active_observers_; }
+
+ void set_affects_pending_observers(bool affects_pending_observers) {
+ affects_pending_observers_ = affects_pending_observers;
+ }
+ bool affects_pending_observers() const { return affects_pending_observers_; }
+
private:
Animation(scoped_ptr<AnimationCurve> curve,
int animation_id,
@@ -182,6 +192,20 @@ class CC_EXPORT Animation {
bool is_impl_only_;
+ // When pushed from a main-thread controller to a compositor-thread
+ // controller, an animation will initially only affect pending observers
+ // (corresponding to layers in the pending tree). Animations that only
+ // affect pending observers are able to reach the Starting state and tick
+ // pending observers, but cannot proceed any further and do not tick active
+ // observers. After activation, such animations affect both kinds of observers
+ // and are able to proceed past the Starting state. When the removal of
+ // an animation is pushed from a main-thread controller to a
+ // compositor-thread controller, this initially only makes the animation
+ // stop affecting pending observers. After activation, such animations no
+ // longer affect any observers, and are deleted.
+ bool affects_active_observers_;
+ bool affects_pending_observers_;
+
DISALLOW_COPY_AND_ASSIGN(Animation);
};