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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "cc/base/scoped_ptr_vector.h" | 23 #include "cc/base/scoped_ptr_vector.h" |
24 #include "cc/debug/micro_benchmark.h" | 24 #include "cc/debug/micro_benchmark.h" |
25 #include "cc/debug/micro_benchmark_controller.h" | 25 #include "cc/debug/micro_benchmark_controller.h" |
26 #include "cc/input/input_handler.h" | 26 #include "cc/input/input_handler.h" |
27 #include "cc/input/layer_selection_bound.h" | 27 #include "cc/input/layer_selection_bound.h" |
28 #include "cc/input/scrollbar.h" | 28 #include "cc/input/scrollbar.h" |
29 #include "cc/input/top_controls_state.h" | 29 #include "cc/input/top_controls_state.h" |
30 #include "cc/layers/layer_lists.h" | 30 #include "cc/layers/layer_lists.h" |
31 #include "cc/output/output_surface.h" | 31 #include "cc/output/output_surface.h" |
32 #include "cc/output/renderer_capabilities.h" | 32 #include "cc/output/renderer_capabilities.h" |
33 #include "cc/output/swap_promise.h" | 33 #include "cc/output/promise.h" |
| 34 #include "cc/output/promise_list.h" |
34 #include "cc/resources/resource_format.h" | 35 #include "cc/resources/resource_format.h" |
35 #include "cc/resources/scoped_ui_resource.h" | 36 #include "cc/resources/scoped_ui_resource.h" |
36 #include "cc/surfaces/surface_sequence.h" | 37 #include "cc/surfaces/surface_sequence.h" |
37 #include "cc/trees/layer_tree_host_client.h" | 38 #include "cc/trees/layer_tree_host_client.h" |
38 #include "cc/trees/layer_tree_host_common.h" | 39 #include "cc/trees/layer_tree_host_common.h" |
39 #include "cc/trees/layer_tree_settings.h" | 40 #include "cc/trees/layer_tree_settings.h" |
40 #include "cc/trees/proxy.h" | 41 #include "cc/trees/proxy.h" |
41 #include "cc/trees/swap_promise_monitor.h" | 42 #include "cc/trees/swap_promise_monitor.h" |
42 #include "third_party/skia/include/core/SkColor.h" | 43 #include "third_party/skia/include/core/SkColor.h" |
43 #include "ui/gfx/geometry/rect.h" | 44 #include "ui/gfx/geometry/rect.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 285 |
285 // When a SwapPromiseMonitor is created on the main thread, it calls | 286 // When a SwapPromiseMonitor is created on the main thread, it calls |
286 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | 287 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. |
287 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 288 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
288 // to unregister itself. | 289 // to unregister itself. |
289 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 290 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
290 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 291 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
291 | 292 |
292 // Call this function when you expect there to be a swap buffer. | 293 // Call this function when you expect there to be a swap buffer. |
293 // See swap_promise.h for how to use SwapPromise. | 294 // See swap_promise.h for how to use SwapPromise. |
294 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 295 void QueuePromise(scoped_ptr<Promise> promise); |
295 | 296 |
296 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 297 size_t num_queued_promises() const { return promises_.size(); } |
297 | 298 |
298 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 299 void BreakSwapPromises(Promise::DidNotSwap::Reason reason); |
| 300 void BreakActivationPromises(Promise::DidNotActivate::Reason reason); |
299 | 301 |
300 void set_surface_id_namespace(uint32_t id_namespace); | 302 void set_surface_id_namespace(uint32_t id_namespace); |
301 SurfaceSequence CreateSurfaceSequence(); | 303 SurfaceSequence CreateSurfaceSequence(); |
302 | 304 |
303 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; | 305 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; |
304 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; | 306 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; |
305 | 307 |
306 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); | 308 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
307 | 309 |
308 PropertyTrees* property_trees() { return &property_trees_; } | 310 PropertyTrees* property_trees() { return &property_trees_; } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 scoped_refptr<Layer> page_scale_layer_; | 441 scoped_refptr<Layer> page_scale_layer_; |
440 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 442 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
441 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 443 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
442 | 444 |
443 LayerSelection selection_; | 445 LayerSelection selection_; |
444 | 446 |
445 SharedBitmapManager* shared_bitmap_manager_; | 447 SharedBitmapManager* shared_bitmap_manager_; |
446 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 448 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
447 TaskGraphRunner* task_graph_runner_; | 449 TaskGraphRunner* task_graph_runner_; |
448 | 450 |
449 ScopedPtrVector<SwapPromise> swap_promise_list_; | 451 PromiseList promises_; |
450 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 452 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
451 | 453 |
452 PropertyTrees property_trees_; | 454 PropertyTrees property_trees_; |
453 | 455 |
454 uint32_t surface_id_namespace_; | 456 uint32_t surface_id_namespace_; |
455 uint32_t next_surface_sequence_; | 457 uint32_t next_surface_sequence_; |
456 | 458 |
457 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 459 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
458 }; | 460 }; |
459 | 461 |
460 } // namespace cc | 462 } // namespace cc |
461 | 463 |
462 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 464 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |