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_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_IMPL_H_ |
6 #define CC_LAYER_TREE_IMPL_H_ | 6 #define CC_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 class LayerTreeHostImpl; | 28 class LayerTreeHostImpl; |
29 class LayerTreeImpl; | 29 class LayerTreeImpl; |
30 class LayerTreeSettings; | 30 class LayerTreeSettings; |
31 class OutputSurface; | 31 class OutputSurface; |
32 class PinchZoomViewport; | 32 class PinchZoomViewport; |
33 class ResourceProvider; | 33 class ResourceProvider; |
34 class TileManager; | 34 class TileManager; |
35 | 35 |
36 class CC_EXPORT LayerTreeImpl { | 36 class CC_EXPORT LayerTreeImpl { |
37 public: | 37 public: |
| 38 typedef std::vector<LayerImpl*> LayerList; |
| 39 |
38 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp
l) | 40 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp
l) |
39 { | 41 { |
40 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 42 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
41 } | 43 } |
42 virtual ~LayerTreeImpl(); | 44 virtual ~LayerTreeImpl(); |
43 | 45 |
44 // Methods called by the layer tree that pass-through or access LTHI. | 46 // Methods called by the layer tree that pass-through or access LTHI. |
45 // --------------------------------------------------------------------------- | 47 // --------------------------------------------------------------------------- |
46 const LayerTreeSettings& settings() const; | 48 const LayerTreeSettings& settings() const; |
47 OutputSurface* output_surface() const; | 49 OutputSurface* output_surface() const; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; } | 86 const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; } |
85 void set_root_scroll_layer(LayerImpl* layer_impl) { root_scroll_layer_ = layer
_impl; } | 87 void set_root_scroll_layer(LayerImpl* layer_impl) { root_scroll_layer_ = layer
_impl; } |
86 | 88 |
87 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } | 89 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } |
88 void set_currently_scrolling_layer(LayerImpl* layer_impl) { currently_scrollin
g_layer_ = layer_impl; } | 90 void set_currently_scrolling_layer(LayerImpl* layer_impl) { currently_scrollin
g_layer_ = layer_impl; } |
89 | 91 |
90 void ClearCurrentlyScrollingLayer(); | 92 void ClearCurrentlyScrollingLayer(); |
91 | 93 |
92 void UpdateMaxScrollOffset(); | 94 void UpdateMaxScrollOffset(); |
93 | 95 |
| 96 // Updates draw properties and render surface layer list |
| 97 void UpdateDrawProperties(); |
| 98 |
| 99 void ClearRenderSurfaces(); |
| 100 |
| 101 const LayerList& RenderSurfaceLayerList() const; |
| 102 |
94 gfx::Size ContentSize() const; | 103 gfx::Size ContentSize() const; |
95 | 104 |
96 LayerImpl* LayerById(int id); | 105 LayerImpl* LayerById(int id); |
97 | 106 |
98 // These should be called by LayerImpl's ctor/dtor. | 107 // These should be called by LayerImpl's ctor/dtor. |
99 void RegisterLayer(LayerImpl* layer); | 108 void RegisterLayer(LayerImpl* layer); |
100 void UnregisterLayer(LayerImpl* layer); | 109 void UnregisterLayer(LayerImpl* layer); |
101 | 110 |
102 AnimationRegistrar* animationRegistrar() const; | 111 AnimationRegistrar* animationRegistrar() const; |
103 | 112 |
104 protected: | 113 protected: |
105 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 114 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
106 | 115 |
107 LayerTreeHostImpl* layer_tree_host_impl_; | 116 LayerTreeHostImpl* layer_tree_host_impl_; |
108 int source_frame_number_; | 117 int source_frame_number_; |
109 scoped_ptr<LayerImpl> root_layer_; | 118 scoped_ptr<LayerImpl> root_layer_; |
110 HeadsUpDisplayLayerImpl* hud_layer_; | 119 HeadsUpDisplayLayerImpl* hud_layer_; |
111 LayerImpl* root_scroll_layer_; | 120 LayerImpl* root_scroll_layer_; |
112 LayerImpl* currently_scrolling_layer_; | 121 LayerImpl* currently_scrolling_layer_; |
113 | 122 |
114 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 123 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
115 LayerIdMap layer_id_map_; | 124 LayerIdMap layer_id_map_; |
116 | 125 |
117 // Persisted state | 126 // Persisted state |
118 int scrolling_layer_id_from_previous_tree_; | 127 int scrolling_layer_id_from_previous_tree_; |
119 | 128 |
| 129 // List of visible layers for the most recently prepared frame. Used for |
| 130 // rendering and input event hit testing. |
| 131 LayerList render_surface_layer_list_; |
| 132 |
120 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 133 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
121 }; | 134 }; |
122 | 135 |
123 } | 136 } |
124 | 137 |
125 #endif // CC_LAYER_TREE_IMPL_H_ | 138 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |