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 <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/base/scoped_ptr_vector.h" | 14 #include "cc/base/scoped_ptr_vector.h" |
15 #include "cc/base/swap_promise.h" | 15 #include "cc/base/swap_promise.h" |
16 #include "cc/layers/layer_impl.h" | 16 #include "cc/layers/layer_impl.h" |
17 #include "cc/resources/ui_resource_client.h" | 17 #include "cc/resources/ui_resource_client.h" |
| 18 #include "ui/events/latency_info.h" |
18 | 19 |
19 #if defined(COMPILER_GCC) | 20 #if defined(COMPILER_GCC) |
20 namespace BASE_HASH_NAMESPACE { | 21 namespace BASE_HASH_NAMESPACE { |
21 template<> | 22 template<> |
22 struct hash<cc::LayerImpl*> { | 23 struct hash<cc::LayerImpl*> { |
23 size_t operator()(cc::LayerImpl* ptr) const { | 24 size_t operator()(cc::LayerImpl* ptr) const { |
24 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 25 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
25 } | 26 } |
26 }; | 27 }; |
27 } // namespace BASE_HASH_NAMESPACE | 28 } // namespace BASE_HASH_NAMESPACE |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 bool ViewportSizeInvalid() const; | 200 bool ViewportSizeInvalid() const; |
200 void SetViewportSizeInvalid(); | 201 void SetViewportSizeInvalid(); |
201 void ResetViewportSizeInvalid(); | 202 void ResetViewportSizeInvalid(); |
202 | 203 |
203 // Useful for debug assertions, probably shouldn't be used for anything else. | 204 // Useful for debug assertions, probably shouldn't be used for anything else. |
204 Proxy* proxy() const; | 205 Proxy* proxy() const; |
205 | 206 |
206 void SetRootLayerScrollOffsetDelegate( | 207 void SetRootLayerScrollOffsetDelegate( |
207 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 208 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
208 | 209 |
| 210 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
| 211 const ui::LatencyInfo& GetLatencyInfo(); |
| 212 void ClearLatencyInfo(); |
| 213 |
209 // Call this function when you expect there to be a swap buffer. | 214 // Call this function when you expect there to be a swap buffer. |
210 // See swap_promise.h for how to use SwapPromise. | 215 // See swap_promise.h for how to use SwapPromise. |
211 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 216 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
212 | 217 |
213 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 218 // Take the |new_swap_promise| and append it to |swap_promise_list_|. |
214 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 219 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
215 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 220 void FinishSwapPromises(); |
216 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 221 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
217 | 222 |
218 void DidModifyTilePriorities(); | 223 void DidModifyTilePriorities(); |
219 | 224 |
220 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 225 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
221 void ProcessUIResourceRequestQueue(); | 226 void ProcessUIResourceRequestQueue(); |
222 | 227 |
223 bool IsUIResourceOpaque(UIResourceId uid) const; | 228 bool IsUIResourceOpaque(UIResourceId uid) const; |
224 | 229 |
225 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | 230 void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 bool contents_textures_purged_; | 273 bool contents_textures_purged_; |
269 bool viewport_size_invalid_; | 274 bool viewport_size_invalid_; |
270 bool needs_update_draw_properties_; | 275 bool needs_update_draw_properties_; |
271 | 276 |
272 // In impl-side painting mode, this is true when the tree may contain | 277 // In impl-side painting mode, this is true when the tree may contain |
273 // structural differences relative to the active tree. | 278 // structural differences relative to the active tree. |
274 bool needs_full_tree_sync_; | 279 bool needs_full_tree_sync_; |
275 | 280 |
276 bool next_activation_forces_redraw_; | 281 bool next_activation_forces_redraw_; |
277 | 282 |
| 283 ui::LatencyInfo latency_info_; |
| 284 |
278 ScopedPtrVector<SwapPromise> swap_promise_list_; | 285 ScopedPtrVector<SwapPromise> swap_promise_list_; |
279 | 286 |
280 UIResourceRequestQueue ui_resource_request_queue_; | 287 UIResourceRequestQueue ui_resource_request_queue_; |
281 | 288 |
282 private: | 289 private: |
283 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 290 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
284 }; | 291 }; |
285 | 292 |
286 } // namespace cc | 293 } // namespace cc |
287 | 294 |
288 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 295 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |