Chromium Code Reviews| Index: cc/layer_tree_impl.h |
| diff --git a/cc/layer_tree_impl.h b/cc/layer_tree_impl.h |
| index 6fc4429d9e7752d147f65e639df66901b49a758c..62e01354f5530c084edfa56935937613c834b9bc 100644 |
| --- a/cc/layer_tree_impl.h |
| +++ b/cc/layer_tree_impl.h |
| @@ -5,8 +5,20 @@ |
| #ifndef CC_LAYER_TREE_IMPL_H_ |
| #define CC_LAYER_TREE_IMPL_H_ |
| +#include "base/hash_tables.h" |
| #include "cc/layer_impl.h" |
| +#if defined(COMPILER_GCC) |
|
danakj
2012/12/13 23:57:11
I would expect you to need an MSVC version too. If
enne (OOO)
2012/12/14 00:21:12
Nope. That's just for std::pair being weird. See
|
| +namespace BASE_HASH_NAMESPACE { |
| +template<> |
| +struct hash<cc::LayerImpl*> { |
| + size_t operator()(cc::LayerImpl* ptr) const { |
| + return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| + } |
| +}; |
| +} // namespace BASE_HASH_NAMESPACE |
| +#endif // COMPILER |
| + |
| namespace cc { |
| class DebugRectHistory; |
| @@ -70,6 +82,12 @@ class CC_EXPORT LayerTreeImpl { |
| void ClearCurrentlyScrollingLayer(); |
| + LayerImpl* LayerById(int id); |
| + |
| + // These should be called by LayerImpl's ctor/dtor. |
| + void RegisterLayer(LayerImpl* layer); |
| + void UnregisterLayer(LayerImpl* layer); |
| + |
| protected: |
| LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
| @@ -80,6 +98,9 @@ protected: |
| LayerImpl* root_scroll_layer_; |
| LayerImpl* currently_scrolling_layer_; |
| + typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
| + LayerIdMap layer_id_map_; |
| + |
| // Persisted state |
| int scrolling_layer_id_from_previous_tree_; |