| 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" | |
| 19 | 18 |
| 20 #if defined(COMPILER_GCC) | 19 #if defined(COMPILER_GCC) |
| 21 namespace BASE_HASH_NAMESPACE { | 20 namespace BASE_HASH_NAMESPACE { |
| 22 template<> | 21 template<> |
| 23 struct hash<cc::LayerImpl*> { | 22 struct hash<cc::LayerImpl*> { |
| 24 size_t operator()(cc::LayerImpl* ptr) const { | 23 size_t operator()(cc::LayerImpl* ptr) const { |
| 25 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 24 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 26 } | 25 } |
| 27 }; | 26 }; |
| 28 } // namespace BASE_HASH_NAMESPACE | 27 } // namespace BASE_HASH_NAMESPACE |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 bool ViewportSizeInvalid() const; | 199 bool ViewportSizeInvalid() const; |
| 201 void SetViewportSizeInvalid(); | 200 void SetViewportSizeInvalid(); |
| 202 void ResetViewportSizeInvalid(); | 201 void ResetViewportSizeInvalid(); |
| 203 | 202 |
| 204 // Useful for debug assertions, probably shouldn't be used for anything else. | 203 // Useful for debug assertions, probably shouldn't be used for anything else. |
| 205 Proxy* proxy() const; | 204 Proxy* proxy() const; |
| 206 | 205 |
| 207 void SetRootLayerScrollOffsetDelegate( | 206 void SetRootLayerScrollOffsetDelegate( |
| 208 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 207 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
| 209 | 208 |
| 210 void SetLatencyInfo(const ui::LatencyInfo& latency_info); | 209 void TakeLatencyInfo(ui::LatencyInfo* latency_info); |
| 211 const ui::LatencyInfo& GetLatencyInfo(); | |
| 212 void ClearLatencyInfo(); | |
| 213 | 210 |
| 214 // Call this function when you expect there to be a swap buffer. | 211 // Call this function when you expect there to be a swap buffer. |
| 215 // See swap_promise.h for how to use SwapPromise. | 212 // See swap_promise.h for how to use SwapPromise. |
| 216 // LayerTreeImpl will take the ownershipf of |swap_promise|. | 213 // LayerTreeImpl will take the ownershipf of |swap_promise|. |
| 217 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 214 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
| 218 | 215 |
| 219 // Take the |new_swap_promise| and appended it to |swap_promise_list_|. | 216 // Take the |new_swap_promise| and appended it to |swap_promise_list_|. |
| 220 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 217 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
| 221 void FinishSwapPromises(); | 218 void FinishSwapPromises(); |
| 222 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 219 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 bool contents_textures_purged_; | 271 bool contents_textures_purged_; |
| 275 bool viewport_size_invalid_; | 272 bool viewport_size_invalid_; |
| 276 bool needs_update_draw_properties_; | 273 bool needs_update_draw_properties_; |
| 277 | 274 |
| 278 // In impl-side painting mode, this is true when the tree may contain | 275 // In impl-side painting mode, this is true when the tree may contain |
| 279 // structural differences relative to the active tree. | 276 // structural differences relative to the active tree. |
| 280 bool needs_full_tree_sync_; | 277 bool needs_full_tree_sync_; |
| 281 | 278 |
| 282 bool next_activation_forces_redraw_; | 279 bool next_activation_forces_redraw_; |
| 283 | 280 |
| 284 ui::LatencyInfo latency_info_; | |
| 285 | |
| 286 ScopedPtrVector<SwapPromise> swap_promise_list_; | 281 ScopedPtrVector<SwapPromise> swap_promise_list_; |
| 287 | 282 |
| 288 UIResourceRequestQueue ui_resource_request_queue_; | 283 UIResourceRequestQueue ui_resource_request_queue_; |
| 289 | 284 |
| 290 private: | 285 private: |
| 291 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 286 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 292 }; | 287 }; |
| 293 | 288 |
| 294 } // namespace cc | 289 } // namespace cc |
| 295 | 290 |
| 296 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 291 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |