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 <list> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
13 #include "cc/layers/layer_impl.h" | 14 #include "cc/layers/layer_impl.h" |
| 15 #include "cc/resources/ui_resource_client.h" |
14 #include "ui/base/latency_info.h" | 16 #include "ui/base/latency_info.h" |
15 | 17 |
16 #if defined(COMPILER_GCC) | 18 #if defined(COMPILER_GCC) |
17 namespace BASE_HASH_NAMESPACE { | 19 namespace BASE_HASH_NAMESPACE { |
18 template<> | 20 template<> |
19 struct hash<cc::LayerImpl*> { | 21 struct hash<cc::LayerImpl*> { |
20 size_t operator()(cc::LayerImpl* ptr) const { | 22 size_t operator()(cc::LayerImpl* ptr) const { |
21 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 23 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
22 } | 24 } |
23 }; | 25 }; |
24 } // namespace BASE_HASH_NAMESPACE | 26 } // namespace BASE_HASH_NAMESPACE |
25 #endif // COMPILER | 27 #endif // COMPILER |
26 | 28 |
27 namespace cc { | 29 namespace cc { |
28 | 30 |
29 class DebugRectHistory; | 31 class DebugRectHistory; |
30 class FrameRateCounter; | 32 class FrameRateCounter; |
31 class HeadsUpDisplayLayerImpl; | 33 class HeadsUpDisplayLayerImpl; |
32 class LayerTreeDebugState; | 34 class LayerTreeDebugState; |
33 class LayerTreeHostImpl; | 35 class LayerTreeHostImpl; |
34 class LayerTreeImpl; | 36 class LayerTreeImpl; |
35 class LayerTreeSettings; | 37 class LayerTreeSettings; |
36 class MemoryHistory; | 38 class MemoryHistory; |
37 class OutputSurface; | 39 class OutputSurface; |
38 class PaintTimeCounter; | 40 class PaintTimeCounter; |
39 class Proxy; | 41 class Proxy; |
40 class ResourceProvider; | 42 class ResourceProvider; |
41 class TileManager; | 43 class TileManager; |
42 struct RendererCapabilities; | 44 struct RendererCapabilities; |
| 45 struct UIResourceRequest; |
| 46 |
| 47 typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
43 | 48 |
44 class CC_EXPORT LayerTreeImpl { | 49 class CC_EXPORT LayerTreeImpl { |
45 public: | 50 public: |
46 static scoped_ptr<LayerTreeImpl> create( | 51 static scoped_ptr<LayerTreeImpl> create( |
47 LayerTreeHostImpl* layer_tree_host_impl) { | 52 LayerTreeHostImpl* layer_tree_host_impl) { |
48 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 53 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
49 } | 54 } |
50 virtual ~LayerTreeImpl(); | 55 virtual ~LayerTreeImpl(); |
51 | 56 |
52 // Methods called by the layer tree that pass-through or access LTHI. | 57 // Methods called by the layer tree that pass-through or access LTHI. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 void set_needs_update_draw_properties() { | 148 void set_needs_update_draw_properties() { |
144 needs_update_draw_properties_ = true; | 149 needs_update_draw_properties_ = true; |
145 } | 150 } |
146 bool needs_update_draw_properties() const { | 151 bool needs_update_draw_properties() const { |
147 return needs_update_draw_properties_; | 152 return needs_update_draw_properties_; |
148 } | 153 } |
149 | 154 |
150 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } | 155 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } |
151 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } | 156 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } |
152 | 157 |
| 158 void set_ui_resource_request_queue(const UIResourceRequestQueue& queue); |
| 159 |
| 160 size_t ui_resource_request_queue_size() { |
| 161 return ui_resource_request_queue_.size(); |
| 162 } |
| 163 |
153 const LayerImplList& RenderSurfaceLayerList() const; | 164 const LayerImplList& RenderSurfaceLayerList() const; |
154 | 165 |
155 // These return the size of the root scrollable area and the size of | 166 // These return the size of the root scrollable area and the size of |
156 // the user-visible scrolling viewport, in CSS layout coordinates. | 167 // the user-visible scrolling viewport, in CSS layout coordinates. |
157 gfx::Size ScrollableSize() const; | 168 gfx::Size ScrollableSize() const; |
158 gfx::SizeF ScrollableViewportSize() const; | 169 gfx::SizeF ScrollableViewportSize() const; |
159 | 170 |
160 LayerImpl* LayerById(int id); | 171 LayerImpl* LayerById(int id); |
161 | 172 |
162 // These should be called by LayerImpl's ctor/dtor. | 173 // These should be called by LayerImpl's ctor/dtor. |
(...skipping 21 matching lines...) Expand all Loading... |
184 | 195 |
185 void SetRootLayerScrollOffsetDelegate( | 196 void SetRootLayerScrollOffsetDelegate( |
186 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 197 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
187 | 198 |
188 void SetLatencyInfo(const ui::LatencyInfo& latency_info); | 199 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
189 const ui::LatencyInfo& GetLatencyInfo(); | 200 const ui::LatencyInfo& GetLatencyInfo(); |
190 void ClearLatencyInfo(); | 201 void ClearLatencyInfo(); |
191 | 202 |
192 void WillModifyTilePriorities(); | 203 void WillModifyTilePriorities(); |
193 | 204 |
| 205 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 206 void ProcessUIResourceRequestQueue(); |
| 207 |
194 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | 208 void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
195 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); | 209 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); |
196 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; | 210 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; |
197 | 211 |
198 protected: | 212 protected: |
199 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 213 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
200 | 214 |
201 void UpdateSolidColorScrollbars(); | 215 void UpdateSolidColorScrollbars(); |
202 | 216 |
203 void UpdateRootScrollLayerSizeDelta(); | 217 void UpdateRootScrollLayerSizeDelta(); |
(...skipping 29 matching lines...) Expand all Loading... |
233 bool contents_textures_purged_; | 247 bool contents_textures_purged_; |
234 bool viewport_size_invalid_; | 248 bool viewport_size_invalid_; |
235 bool needs_update_draw_properties_; | 249 bool needs_update_draw_properties_; |
236 | 250 |
237 // In impl-side painting mode, this is true when the tree may contain | 251 // In impl-side painting mode, this is true when the tree may contain |
238 // structural differences relative to the active tree. | 252 // structural differences relative to the active tree. |
239 bool needs_full_tree_sync_; | 253 bool needs_full_tree_sync_; |
240 | 254 |
241 ui::LatencyInfo latency_info_; | 255 ui::LatencyInfo latency_info_; |
242 | 256 |
| 257 UIResourceRequestQueue ui_resource_request_queue_; |
| 258 |
243 private: | 259 private: |
244 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 260 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
245 }; | 261 }; |
246 | 262 |
247 } // namespace cc | 263 } // namespace cc |
248 | 264 |
249 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 265 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |