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

Unified Diff: cc/layer_tree_host_impl.h

Issue 11348256: Use an auxiliary list of animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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
« no previous file with comments | « cc/layer_tree_host_common_unittest.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.h
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index d3c3fe867b2eb3bab8d1f3c4756d1ea20dc3c028..07d0c044924e3b2621af4eb3bf516f69ce258bc0 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/layer_sorter.h"
@@ -114,8 +115,10 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient,
public RendererClient,
public TileManagerClient,
public LayerTreeImplClient,
+ public AnimationRegistrar,
public NON_EXPORTED_BASE(WebKit::WebCompositorOutputSurfaceClient) {
typedef std::vector<LayerImpl*> LayerList;
+ typedef base::hash_set<LayerAnimationController*> AnimationControllerSet;
public:
static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerTreeHostImplClient*, Proxy*);
@@ -244,9 +247,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_activeAnimationControllers.empty(); }
void setNeedsRedraw();
@@ -336,7 +337,14 @@ private:
void dumpRenderSurfaces(std::string*, int indent, const LayerImpl*) const;
+ // AnimationRegistar implementation.
+ virtual void DidActivateAnimationController(LayerAnimationController*) OVERRIDE;
+ virtual void DidDeactivateAnimationController(LayerAnimationController*) OVERRIDE;
+ virtual void RegisterAnimationController(LayerAnimationController*) OVERRIDE;
+ virtual void UnregisterAnimationController(LayerAnimationController*) OVERRIDE;
+
scoped_ptr<OutputSurface> m_outputSurface;
+
scoped_ptr<ResourceProvider> m_resourceProvider;
scoped_ptr<Renderer> m_renderer;
scoped_ptr<TileManager> m_tileManager;
@@ -357,7 +365,6 @@ private:
bool m_hasTransparentBackground;
// If this is true, it is necessary to traverse the layer tree ticking the animators.
- bool m_needsAnimateLayers;
bool m_pinchGestureActive;
gfx::Point m_previousPinchAnchor;
@@ -382,6 +389,12 @@ private:
size_t m_cumulativeNumLayersDrawn;
+ AnimationControllerSet m_activeAnimationControllers;
+
+#if !defined(NDEBUG)
+ AnimationControllerSet m_allAnimationControllers;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
};
« no previous file with comments | « cc/layer_tree_host_common_unittest.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698