OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_COLLECTION_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_COLLECTION_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/time/time.h" |
| 14 #include "ui/compositor/compositor_export.h" |
| 15 |
| 16 namespace base { |
| 17 class TimeTicks; |
| 18 } |
| 19 |
| 20 namespace ui { |
| 21 |
| 22 class LayerAnimator; |
| 23 |
| 24 // A collection of LayerAnimators that should be updated at each animation step |
| 25 // in the compositor. |
| 26 class COMPOSITOR_EXPORT LayerAnimatorCollection { |
| 27 public: |
| 28 static LayerAnimatorCollection* GetInstance(); |
| 29 |
| 30 void StartAnimator(scoped_refptr<LayerAnimator> animator); |
| 31 void StopAnimator(scoped_refptr<LayerAnimator> animator); |
| 32 |
| 33 bool HasActiveAnimators() const; |
| 34 |
| 35 void Progress(base::TimeTicks now); |
| 36 |
| 37 base::TimeTicks last_tick_time() const { return last_tick_time_; } |
| 38 |
| 39 private: |
| 40 friend struct base::DefaultLazyInstanceTraits<LayerAnimatorCollection>; |
| 41 |
| 42 LayerAnimatorCollection(); |
| 43 ~LayerAnimatorCollection(); |
| 44 |
| 45 base::TimeTicks last_tick_time_; |
| 46 |
| 47 std::set<scoped_refptr<LayerAnimator> > animators_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(LayerAnimatorCollection); |
| 50 }; |
| 51 |
| 52 } // namespace ui |
| 53 |
| 54 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_COLLECTION_H_ |
OLD | NEW |