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

Unified Diff: cc/animation/layer_animation_controller.h

Issue 13465014: LayerTreeHost::SetAnimationEvents should use AnimationRegistrar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: cc/animation/layer_animation_controller.h
diff --git a/cc/animation/layer_animation_controller.h b/cc/animation/layer_animation_controller.h
index 866377f2eb9158771c200f5b752b38c12d73d128..e501dcda74fdb3ea9b2b1d895d4157591429c204 100644
--- a/cc/animation/layer_animation_controller.h
+++ b/cc/animation/layer_animation_controller.h
@@ -17,6 +17,10 @@
#include "cc/base/scoped_ptr_vector.h"
#include "ui/gfx/transform.h"
+namespace WebKit {
+class WebAnimationDelegate;
+}
+
namespace gfx { class Transform; }
namespace cc {
@@ -27,8 +31,7 @@ class KeyframeValueList;
class LayerAnimationValueObserver;
class CC_EXPORT LayerAnimationController
- : public base::RefCounted<LayerAnimationController>,
- public LayerAnimationEventObserver {
+ : public base::RefCounted<LayerAnimationController> {
public:
static scoped_refptr<LayerAnimationController> Create(int id);
@@ -49,6 +52,10 @@ class CC_EXPORT LayerAnimationController
virtual void PushAnimationUpdatesTo(
LayerAnimationController* controller_impl);
+ // Transfers ownership of all animations to other_controller, replacing
Ian Vollick 2013/04/04 18:38:58 I think it would really help if you explained how
ajuma 2013/04/05 14:38:18 Done.
+ // any animations currently owned by other_controller.
+ void TransferAnimationsTo(LayerAnimationController* other_controller);
+
void Animate(double monotonic_time);
void AccumulatePropertyUpdates(double monotonic_time,
AnimationEventsVector* events);
@@ -75,11 +82,6 @@ class CC_EXPORT LayerAnimationController
// the future.
bool IsAnimatingProperty(Animation::TargetProperty target_property) const;
- // This is called in response to an animation being started on the impl
- // thread. This function updates the corresponding main thread animation's
- // start time.
- virtual void OnAnimationStarted(const AnimationEvent& event) OVERRIDE;
-
// If a sync is forced, then the next time animation updates are pushed to the
// impl thread, all animations will be transferred.
void set_force_sync() { force_sync_ = true; }
@@ -87,8 +89,21 @@ class CC_EXPORT LayerAnimationController
void SetAnimationRegistrar(AnimationRegistrar* registrar);
AnimationRegistrar* animation_registrar() { return registrar_; }
- void AddObserver(LayerAnimationValueObserver* observer);
- void RemoveObserver(LayerAnimationValueObserver* observer);
+ void NotifyAnimationStarted(const AnimationEvent& event,
+ double wall_clock_time);
+ void NotifyAnimationFinished(const AnimationEvent& event,
+ double wall_clock_time);
+ void NotifyAnimationPropertyUpdate(const AnimationEvent& event);
+
+ void AddValueObserver(LayerAnimationValueObserver* observer);
+ void RemoveValueObserver(LayerAnimationValueObserver* observer);
+
+ void AddEventObserver(LayerAnimationEventObserver* observer);
+ void RemoveEventObserver(LayerAnimationEventObserver* observer);
+
+ void set_layer_animation_delegate(WebKit::WebAnimationDelegate* delegate) {
+ layer_animation_delegate_ = delegate;
+ }
protected:
friend class base::RefCounted<LayerAnimationController>;
@@ -144,7 +159,10 @@ class CC_EXPORT LayerAnimationController
double last_tick_time_;
- ObserverList<LayerAnimationValueObserver> observers_;
+ ObserverList<LayerAnimationValueObserver> value_observers_;
+ ObserverList<LayerAnimationEventObserver> event_observers_;
+
+ WebKit::WebAnimationDelegate* layer_animation_delegate_;
DISALLOW_COPY_AND_ASSIGN(LayerAnimationController);
};

Powered by Google App Engine
This is Rietveld 408576698