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 |
153 const LayerImplList& RenderSurfaceLayerList() const; | 160 const LayerImplList& RenderSurfaceLayerList() const; |
154 | 161 |
155 // These return the size of the root scrollable area and the size of | 162 // These return the size of the root scrollable area and the size of |
156 // the user-visible scrolling viewport, in CSS layout coordinates. | 163 // the user-visible scrolling viewport, in CSS layout coordinates. |
157 gfx::Size ScrollableSize() const; | 164 gfx::Size ScrollableSize() const; |
158 gfx::SizeF ScrollableViewportSize() const; | 165 gfx::SizeF ScrollableViewportSize() const; |
159 | 166 |
160 LayerImpl* LayerById(int id); | 167 LayerImpl* LayerById(int id); |
161 | 168 |
162 // These should be called by LayerImpl's ctor/dtor. | 169 // These should be called by LayerImpl's ctor/dtor. |
(...skipping 21 matching lines...) Expand all Loading... |
184 | 191 |
185 void SetRootLayerScrollOffsetDelegate( | 192 void SetRootLayerScrollOffsetDelegate( |
186 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 193 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
187 | 194 |
188 void SetLatencyInfo(const ui::LatencyInfo& latency_info); | 195 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
189 const ui::LatencyInfo& GetLatencyInfo(); | 196 const ui::LatencyInfo& GetLatencyInfo(); |
190 void ClearLatencyInfo(); | 197 void ClearLatencyInfo(); |
191 | 198 |
192 void WillModifyTilePriorities(); | 199 void WillModifyTilePriorities(); |
193 | 200 |
| 201 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 202 void ProcessUIResourceRequestQueue(); |
| 203 |
194 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | 204 void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
195 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); | 205 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); |
196 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; | 206 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; |
197 | 207 |
198 protected: | 208 protected: |
199 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 209 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
200 | 210 |
201 void UpdateSolidColorScrollbars(); | 211 void UpdateSolidColorScrollbars(); |
202 | 212 |
203 void UpdateRootScrollLayerSizeDelta(); | 213 void UpdateRootScrollLayerSizeDelta(); |
(...skipping 29 matching lines...) Expand all Loading... |
233 bool contents_textures_purged_; | 243 bool contents_textures_purged_; |
234 bool viewport_size_invalid_; | 244 bool viewport_size_invalid_; |
235 bool needs_update_draw_properties_; | 245 bool needs_update_draw_properties_; |
236 | 246 |
237 // In impl-side painting mode, this is true when the tree may contain | 247 // In impl-side painting mode, this is true when the tree may contain |
238 // structural differences relative to the active tree. | 248 // structural differences relative to the active tree. |
239 bool needs_full_tree_sync_; | 249 bool needs_full_tree_sync_; |
240 | 250 |
241 ui::LatencyInfo latency_info_; | 251 ui::LatencyInfo latency_info_; |
242 | 252 |
| 253 UIResourceRequestQueue ui_resource_request_queue_; |
| 254 |
243 private: | 255 private: |
244 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 256 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
245 }; | 257 }; |
246 | 258 |
247 } // namespace cc | 259 } // namespace cc |
248 | 260 |
249 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 261 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |