OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
8 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
9 #include "base/values.h" | 12 #include "base/values.h" |
10 #include "cc/layers/layer_impl.h" | 13 #include "cc/layers/layer_impl.h" |
11 | 14 |
12 #if defined(COMPILER_GCC) | 15 #if defined(COMPILER_GCC) |
13 namespace BASE_HASH_NAMESPACE { | 16 namespace BASE_HASH_NAMESPACE { |
14 template<> | 17 template<> |
15 struct hash<cc::LayerImpl*> { | 18 struct hash<cc::LayerImpl*> { |
16 size_t operator()(cc::LayerImpl* ptr) const { | 19 size_t operator()(cc::LayerImpl* ptr) const { |
17 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 20 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
18 } | 21 } |
19 }; | 22 }; |
20 } // namespace BASE_HASH_NAMESPACE | 23 } // namespace BASE_HASH_NAMESPACE |
21 #endif // COMPILER | 24 #endif // COMPILER |
22 | 25 |
23 namespace cc { | 26 namespace cc { |
24 | 27 |
25 class DebugRectHistory; | 28 class DebugRectHistory; |
26 class FrameRateCounter; | 29 class FrameRateCounter; |
27 class HeadsUpDisplayLayerImpl; | 30 class HeadsUpDisplayLayerImpl; |
28 class LayerTreeDebugState; | 31 class LayerTreeDebugState; |
29 class LayerTreeHostImpl; | 32 class LayerTreeHostImpl; |
30 class LayerTreeImpl; | 33 class LayerTreeImpl; |
31 class LayerTreeSettings; | 34 class LayerTreeSettings; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 std::string layer_tree_as_text() const; | 84 std::string layer_tree_as_text() const; |
82 DebugRectHistory* debug_rect_history() const; | 85 DebugRectHistory* debug_rect_history() const; |
83 scoped_ptr<base::Value> AsValue() const; | 86 scoped_ptr<base::Value> AsValue() const; |
84 | 87 |
85 // Other public methods | 88 // Other public methods |
86 // --------------------------------------------------------------------------- | 89 // --------------------------------------------------------------------------- |
87 LayerImpl* root_layer() const { return root_layer_.get(); } | 90 LayerImpl* root_layer() const { return root_layer_.get(); } |
88 void SetRootLayer(scoped_ptr<LayerImpl>); | 91 void SetRootLayer(scoped_ptr<LayerImpl>); |
89 scoped_ptr<LayerImpl> DetachLayerTree(); | 92 scoped_ptr<LayerImpl> DetachLayerTree(); |
90 | 93 |
91 void PushPropertiesTo(LayerTreeImpl*); | 94 void PushPropertiesTo(LayerTreeImpl* tree_impl); |
92 | 95 |
93 int source_frame_number() const { return source_frame_number_; } | 96 int source_frame_number() const { return source_frame_number_; } |
94 void set_source_frame_number(int frame_number) { | 97 void set_source_frame_number(int frame_number) { |
95 source_frame_number_ = frame_number; | 98 source_frame_number_ = frame_number; |
96 } | 99 } |
97 | 100 |
98 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } | 101 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } |
99 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { | 102 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { |
100 hud_layer_ = layer_impl; | 103 hud_layer_ = layer_impl; |
101 } | 104 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 Proxy* proxy() const; | 194 Proxy* proxy() const; |
192 | 195 |
193 void SetPinchZoomHorizontalLayerId(int layer_id); | 196 void SetPinchZoomHorizontalLayerId(int layer_id); |
194 void SetPinchZoomVerticalLayerId(int layer_id); | 197 void SetPinchZoomVerticalLayerId(int layer_id); |
195 | 198 |
196 void DidBeginScroll(); | 199 void DidBeginScroll(); |
197 void DidUpdateScroll(); | 200 void DidUpdateScroll(); |
198 void DidEndScroll(); | 201 void DidEndScroll(); |
199 | 202 |
200 protected: | 203 protected: |
201 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 204 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
202 | 205 |
203 void UpdateSolidColorScrollbars(); | 206 void UpdateSolidColorScrollbars(); |
204 | 207 |
205 // Hide existence of pinch-zoom scrollbars. | 208 // Hide existence of pinch-zoom scrollbars. |
206 void UpdatePinchZoomScrollbars(); | 209 void UpdatePinchZoomScrollbars(); |
207 void FadeInPinchZoomScrollbars(); | 210 void FadeInPinchZoomScrollbars(); |
208 void FadeOutPinchZoomScrollbars(); | 211 void FadeOutPinchZoomScrollbars(); |
209 ScrollbarLayerImpl* PinchZoomScrollbarHorizontal(); | 212 ScrollbarLayerImpl* PinchZoomScrollbarHorizontal(); |
210 ScrollbarLayerImpl* PinchZoomScrollbarVertical(); | 213 ScrollbarLayerImpl* PinchZoomScrollbarVertical(); |
211 bool HasPinchZoomScrollbars() const; | 214 bool HasPinchZoomScrollbars() const; |
(...skipping 30 matching lines...) Expand all Loading... |
242 bool viewport_size_invalid_; | 245 bool viewport_size_invalid_; |
243 bool needs_update_draw_properties_; | 246 bool needs_update_draw_properties_; |
244 | 247 |
245 // In impl-side painting mode, this is true when the tree may contain | 248 // In impl-side painting mode, this is true when the tree may contain |
246 // structural differences relative to the active tree. | 249 // structural differences relative to the active tree. |
247 bool needs_full_tree_sync_; | 250 bool needs_full_tree_sync_; |
248 | 251 |
249 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 252 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
250 }; | 253 }; |
251 | 254 |
252 } | 255 } // namespace cc |
253 | 256 |
254 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 257 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |