Index: cc/layer_tree_host_impl.h |
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h |
index c7e9c0b4c3ab90fec3f66678311091d26fb96285..d56a5504fd673b14188135bff27d98643c64bad9 100644 |
--- a/cc/layer_tree_host_impl.h |
+++ b/cc/layer_tree_host_impl.h |
@@ -9,6 +9,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/input_handler.h" |
#include "cc/output_surface_client.h" |
@@ -248,9 +249,7 @@ public: |
bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
void setHasTransparentBackground(bool transparent) { m_hasTransparentBackground = transparent; } |
- |
- bool needsAnimateLayers() const { return m_needsAnimateLayers; } |
- void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } |
+ bool needsAnimateLayers() const { return !m_animationRegistrar->active_animation_controllers().empty(); } |
bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties; } |
void setNeedsUpdateDrawProperties() { m_needsUpdateDrawProperties = true; } |
@@ -270,6 +269,8 @@ public: |
Proxy* proxy() const { return m_proxy; } |
+ AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar.get(); } |
+ |
void setDebugState(const LayerTreeDebugState& debugState) { m_debugState = debugState; } |
const LayerTreeDebugState& debugState() const { return m_debugState; } |
@@ -314,6 +315,8 @@ protected: |
// Virtual for testing. |
virtual base::TimeDelta lowFrequencyAnimationInterval() const; |
+ const AnimationRegistrar::AnimationControllerMap& activeAnimationControllers() const { return m_animationRegistrar->active_animation_controllers(); } |
+ |
LayerTreeHostImplClient* m_client; |
Proxy* m_proxy; |
@@ -369,8 +372,6 @@ private: |
SkColor m_backgroundColor; |
bool m_hasTransparentBackground; |
- // If this is true, it is necessary to traverse the layer tree ticking the animators. |
- bool m_needsAnimateLayers; |
bool m_needsUpdateDrawProperties; |
bool m_pinchGestureActive; |
gfx::Point m_previousPinchAnchor; |
@@ -400,6 +401,8 @@ private: |
size_t m_lastSentMemoryVisibleAndNearbyBytes; |
size_t m_lastSentMemoryUseBytes; |
+ scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
+ |
DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
}; |