OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_HOST_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // to unregister itself. | 293 // to unregister itself. |
294 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 294 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
295 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 295 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
296 | 296 |
297 // Call this function when you expect there to be a swap buffer. | 297 // Call this function when you expect there to be a swap buffer. |
298 // See swap_promise.h for how to use SwapPromise. | 298 // See swap_promise.h for how to use SwapPromise. |
299 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 299 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
300 | 300 |
301 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 301 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
302 | 302 |
| 303 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
| 304 |
303 protected: | 305 protected: |
304 LayerTreeHost(LayerTreeHostClient* client, | 306 LayerTreeHost(LayerTreeHostClient* client, |
305 SharedBitmapManager* manager, | 307 SharedBitmapManager* manager, |
306 const LayerTreeSettings& settings); | 308 const LayerTreeSettings& settings); |
307 void InitializeThreaded( | 309 void InitializeThreaded( |
308 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 310 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
309 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 311 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
310 void InitializeSingleThreaded( | 312 void InitializeSingleThreaded( |
311 LayerTreeHostSingleThreadClient* single_thread_client, | 313 LayerTreeHostSingleThreadClient* single_thread_client, |
312 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 314 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 456 |
455 ScopedPtrVector<SwapPromise> swap_promise_list_; | 457 ScopedPtrVector<SwapPromise> swap_promise_list_; |
456 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 458 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
457 | 459 |
458 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 460 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
459 }; | 461 }; |
460 | 462 |
461 } // namespace cc | 463 } // namespace cc |
462 | 464 |
463 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 465 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |