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

Unified Diff: cc/layer_tree_host.h

Issue 11348256: Use an auxiliary list of animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added registration/unregistration 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_impl.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host.h
diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h
index 8f3087ce6f2fe7182468084cebd29e4ad2e1ce8c..30fc47b8b8e9ed4e58dc51693b39d64b8ac39a3c 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 {
@@ -112,7 +122,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();
@@ -189,7 +200,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(); }
@@ -246,8 +256,15 @@ protected:
LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&);
bool initialize(scoped_ptr<Thread> implThread);
+ // AnimationRegistar implementation.
+ virtual void ActivateAnimationController(LayerAnimationController*) OVERRIDE;
+ virtual void DeactivateAnimationController(LayerAnimationController*) OVERRIDE;
nduca 2012/12/05 20:15:56 DidActivate, DidDeactivate. Written as Activate, i
+ virtual void RegisterAnimationController(LayerAnimationController*) OVERRIDE;
+ virtual void UnregisterAnimationController(LayerAnimationController*) OVERRIDE;
+
private:
typedef std::vector<scoped_refptr<Layer> > LayerList;
+ typedef base::hash_set<LayerAnimationController*> AnimationControllerSet;
void initializeRenderer();
@@ -268,7 +285,6 @@ private:
void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base::Time wallClockTime);
bool m_animating;
- bool m_needsAnimateLayers;
bool m_needsFullTreeSync;
base::CancelableClosure m_prepaintCallback;
@@ -315,6 +331,12 @@ private:
static bool s_needsFilterContext;
+ AnimationControllerSet m_activeAnimationControllers;
+
+#if !defined(NDEBUG)
+ AnimationControllerSet m_allAnimationControllers;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
};
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698