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" |
14 #include "ui/base/latency_info.h" | 15 #include "ui/base/latency_info.h" |
15 | 16 |
16 #if defined(COMPILER_GCC) | 17 #if defined(COMPILER_GCC) |
17 namespace BASE_HASH_NAMESPACE { | 18 namespace BASE_HASH_NAMESPACE { |
(...skipping 15 matching lines...) Expand all Loading... |
33 class LayerTreeHostImpl; | 34 class LayerTreeHostImpl; |
34 class LayerTreeImpl; | 35 class LayerTreeImpl; |
35 class LayerTreeSettings; | 36 class LayerTreeSettings; |
36 class MemoryHistory; | 37 class MemoryHistory; |
37 class OutputSurface; | 38 class OutputSurface; |
38 class PaintTimeCounter; | 39 class PaintTimeCounter; |
39 class Proxy; | 40 class Proxy; |
40 class ResourceProvider; | 41 class ResourceProvider; |
41 class TileManager; | 42 class TileManager; |
42 struct RendererCapabilities; | 43 struct RendererCapabilities; |
| 44 struct UIResourceRequest; |
| 45 |
| 46 typedef int UIResourceId; |
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void set_needs_update_draw_properties() { | 147 void set_needs_update_draw_properties() { |
143 needs_update_draw_properties_ = true; | 148 needs_update_draw_properties_ = true; |
144 } | 149 } |
145 bool needs_update_draw_properties() const { | 150 bool needs_update_draw_properties() const { |
146 return needs_update_draw_properties_; | 151 return needs_update_draw_properties_; |
147 } | 152 } |
148 | 153 |
149 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } | 154 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } |
150 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } | 155 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } |
151 | 156 |
| 157 void set_ui_resource_request_queue(const UIResourceRequestQueue& queue); |
| 158 |
152 const LayerImplList& RenderSurfaceLayerList() const; | 159 const LayerImplList& RenderSurfaceLayerList() const; |
153 | 160 |
154 // These return the size of the root scrollable area and the size of | 161 // These return the size of the root scrollable area and the size of |
155 // the user-visible scrolling viewport, in CSS layout coordinates. | 162 // the user-visible scrolling viewport, in CSS layout coordinates. |
156 gfx::Size ScrollableSize() const; | 163 gfx::Size ScrollableSize() const; |
157 gfx::SizeF ScrollableViewportSize() const; | 164 gfx::SizeF ScrollableViewportSize() const; |
158 | 165 |
159 LayerImpl* LayerById(int id); | 166 LayerImpl* LayerById(int id); |
160 | 167 |
161 // These should be called by LayerImpl's ctor/dtor. | 168 // These should be called by LayerImpl's ctor/dtor. |
(...skipping 21 matching lines...) Expand all Loading... |
183 | 190 |
184 void SetRootLayerScrollOffsetDelegate( | 191 void SetRootLayerScrollOffsetDelegate( |
185 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 192 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
186 | 193 |
187 void SetLatencyInfo(const ui::LatencyInfo& latency_info); | 194 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
188 const ui::LatencyInfo& GetLatencyInfo(); | 195 const ui::LatencyInfo& GetLatencyInfo(); |
189 void ClearLatencyInfo(); | 196 void ClearLatencyInfo(); |
190 | 197 |
191 void WillModifyTilePriorities(); | 198 void WillModifyTilePriorities(); |
192 | 199 |
| 200 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 201 void ProcessUIResourceRequestQueue(); |
| 202 |
193 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | 203 void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
194 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); | 204 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); |
195 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; | 205 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; |
196 | 206 |
197 protected: | 207 protected: |
198 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 208 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
199 | 209 |
200 void UpdateSolidColorScrollbars(); | 210 void UpdateSolidColorScrollbars(); |
201 | 211 |
202 void UpdateRootScrollLayerSizeDelta(); | 212 void UpdateRootScrollLayerSizeDelta(); |
(...skipping 29 matching lines...) Expand all Loading... |
232 bool contents_textures_purged_; | 242 bool contents_textures_purged_; |
233 bool viewport_size_invalid_; | 243 bool viewport_size_invalid_; |
234 bool needs_update_draw_properties_; | 244 bool needs_update_draw_properties_; |
235 | 245 |
236 // In impl-side painting mode, this is true when the tree may contain | 246 // In impl-side painting mode, this is true when the tree may contain |
237 // structural differences relative to the active tree. | 247 // structural differences relative to the active tree. |
238 bool needs_full_tree_sync_; | 248 bool needs_full_tree_sync_; |
239 | 249 |
240 ui::LatencyInfo latency_info_; | 250 ui::LatencyInfo latency_info_; |
241 | 251 |
| 252 UIResourceRequestQueue ui_resource_request_queue_; |
| 253 |
242 private: | 254 private: |
243 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 255 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
244 }; | 256 }; |
245 | 257 |
246 } // namespace cc | 258 } // namespace cc |
247 | 259 |
248 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 260 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |