Index: ui/compositor/layer_animator_collection.h |
diff --git a/ui/compositor/layer_animator_collection.h b/ui/compositor/layer_animator_collection.h |
index 2789eda3cb4fbdb9e7427714a307ce786253cc56..ecfda71819097b26ca4623dbd1d5fc350351b094 100644 |
--- a/ui/compositor/layer_animator_collection.h |
+++ b/ui/compositor/layer_animator_collection.h |
@@ -10,6 +10,7 @@ |
#include "base/callback.h" |
#include "base/memory/ref_counted.h" |
#include "base/time/time.h" |
+#include "ui/compositor/animation_frame_task.h" |
#include "ui/compositor/compositor_export.h" |
namespace base { |
@@ -20,33 +21,28 @@ namespace ui { |
class LayerAnimator; |
-class COMPOSITOR_EXPORT LayerAnimatorCollectionDelegate { |
- public: |
- virtual ~LayerAnimatorCollectionDelegate() {} |
- |
- virtual void ScheduleAnimationForLayerCollection() = 0; |
-}; |
- |
// A collection of LayerAnimators that should be updated at each animation step |
// in the compositor. |
-class COMPOSITOR_EXPORT LayerAnimatorCollection { |
+class COMPOSITOR_EXPORT LayerAnimatorCollection : public AnimationFrameTask { |
public: |
- explicit LayerAnimatorCollection(LayerAnimatorCollectionDelegate* delegate); |
- ~LayerAnimatorCollection(); |
+ explicit LayerAnimatorCollection(AnimationFrameTaskProvider* provider); |
+ virtual ~LayerAnimatorCollection(); |
void StartAnimator(scoped_refptr<LayerAnimator> animator); |
void StopAnimator(scoped_refptr<LayerAnimator> animator); |
bool HasActiveAnimators() const; |
- void Progress(base::TimeTicks now); |
+ // AnimationFrameTask: |
+ virtual AnimationFrameTaskStatus Progress(base::TimeTicks now) OVERRIDE; |
base::TimeTicks last_tick_time() const { return last_tick_time_; } |
private: |
- LayerAnimatorCollectionDelegate* delegate_; |
+ AnimationFrameTaskProvider* provider_; |
base::TimeTicks last_tick_time_; |
std::set<scoped_refptr<LayerAnimator> > animators_; |
+ scoped_ptr<ScopedAnimationFrameTask> raf_callback_; |
DISALLOW_COPY_AND_ASSIGN(LayerAnimatorCollection); |
}; |