Chromium Code Reviews| Index: cc/layer_tree_host.h |
| diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h |
| index c140b31da21635175b86a2af5fa22821654a8db0..85b869af28bf9612d61189569d291c767aec9021 100644 |
| --- a/cc/layer_tree_host.h |
| +++ b/cc/layer_tree_host.h |
| @@ -14,6 +14,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/time.h" |
| #include "cc/animation_events.h" |
| +#include "cc/animation_registrar.h" |
| #include "cc/cc_export.h" |
| #include "cc/graphics_context.h" |
| #include "cc/layer_tree_host_client.h" |
| @@ -36,6 +37,15 @@ struct hash<WebKit::WebGraphicsContext3D*> { |
| } |
| }; |
| } // namespace BASE_HASH_NAMESPACE |
| + |
| +namespace BASE_HASH_NAMESPACE { |
| +template<> |
| +struct hash<cc::LayerAnimationController*> { |
| + size_t operator()(cc::LayerAnimationController* ptr) const { |
| + return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| + } |
| +}; |
| +} // namespace BASE_HASH_NAMESPACE |
| #endif // COMPILER |
| namespace cc { |
| @@ -99,7 +109,8 @@ struct CC_EXPORT RendererCapabilities { |
| int maxTextureSize; |
| }; |
| -class CC_EXPORT LayerTreeHost : public RateLimiterClient { |
| +class CC_EXPORT LayerTreeHost : public RateLimiterClient, |
| + public AnimationRegistrar { |
| public: |
| static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTreeSettings&, scoped_ptr<Thread> implThread); |
| virtual ~LayerTreeHost(); |
| @@ -175,7 +186,6 @@ public: |
| bool commitRequested() const; |
| void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime); |
| - virtual void didAddAnimation(); |
| Layer* rootLayer() { return m_rootLayer.get(); } |
| const Layer* rootLayer() const { return m_rootLayer.get(); } |
| @@ -232,8 +242,13 @@ protected: |
| LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| bool initialize(scoped_ptr<Thread> implThread); |
| + // AnimationRegistar implementation. |
|
nduca
2012/12/04 05:40:26
so, walk me through the benefit of this being LTH
|
| + virtual void Register(LayerAnimationController*) OVERRIDE; |
| + virtual void Unregister(LayerAnimationController*) OVERRIDE; |
| + |
| private: |
| typedef std::vector<scoped_refptr<Layer> > LayerList; |
| + typedef base::hash_set<LayerAnimationController*> AnimationControllerSet; |
| void initializeRenderer(); |
| @@ -256,7 +271,6 @@ private: |
| void createHUDLayerIfNeeded(); |
| bool m_animating; |
| - bool m_needsAnimateLayers; |
| base::CancelableClosure m_prepaintCallback; |
| @@ -301,6 +315,8 @@ private: |
| static bool s_needsFilterContext; |
| + AnimationControllerSet m_activeAnimationControllers; |
| + |
| DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| }; |