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

Side by Side Diff: cc/animation_registrar.h

Issue 11443004: Maintain global lists 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/animation_registrar.cc » ('j') | cc/animation_registrar.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 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 CC_ANIMATION_REGISTRAR_H_
6 #define CC_ANIMATION_REGISTRAR_H_
7
8 #include "base/hash_tables.h"
9 #include "cc/cc_export.h"
10
11 namespace cc {
12 class LayerAnimationController;
13 } // namespace cc
14
15 #if defined(COMPILER_GCC)
16 namespace BASE_HASH_NAMESPACE {
17 template<>
18 struct hash<cc::LayerAnimationController*> {
19 size_t operator()(cc::LayerAnimationController* ptr) const {
20 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
21 }
22 };
23 } // namespace BASE_HASH_NAMESPACE
24 #endif // COMPILER
25
26 namespace cc {
27
28 class CC_EXPORT AnimationRegistrar {
29 public:
30 typedef base::hash_set<LayerAnimationController*> AnimationControllerSet;
31
32 enum ThreadName { MainThread, CompositorThread };
33
34 // Registers the given animation controller as active. An active animation
35 // controller is one that has a running animation that needs to be ticked.
36 static void ActivateAnimationController(LayerAnimationController*,
37 ThreadName);
38
39 // Unregisters the given animation controller. When this happens, the
40 // animation controller will no longer be ticked (since it's not active). It
41 // is not an error to call this function with a deactivated controller.
42 static void DeactivateAnimationController(LayerAnimationController*,
43 ThreadName);
44
45 // Gets the list of active animations for the given thread.
46 static const AnimationControllerSet& GetActiveControllers(ThreadName);
47 };
48
49 } // namespace cc
50
51 #endif // CC_ANIMATION_REGISTRAR_H_
OLDNEW
« no previous file with comments | « no previous file | cc/animation_registrar.cc » ('j') | cc/animation_registrar.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698