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 24 matching lines...) Expand all Loading... |
35 #include "cc/resources/resource_format.h" | 35 #include "cc/resources/resource_format.h" |
36 #include "cc/resources/scoped_ui_resource.h" | 36 #include "cc/resources/scoped_ui_resource.h" |
37 #include "cc/trees/layer_tree_host_client.h" | 37 #include "cc/trees/layer_tree_host_client.h" |
38 #include "cc/trees/layer_tree_host_common.h" | 38 #include "cc/trees/layer_tree_host_common.h" |
39 #include "cc/trees/layer_tree_settings.h" | 39 #include "cc/trees/layer_tree_settings.h" |
40 #include "cc/trees/proxy.h" | 40 #include "cc/trees/proxy.h" |
41 #include "third_party/skia/include/core/SkColor.h" | 41 #include "third_party/skia/include/core/SkColor.h" |
42 #include "ui/gfx/rect.h" | 42 #include "ui/gfx/rect.h" |
43 | 43 |
44 namespace cc { | 44 namespace cc { |
45 | |
46 class AnimationRegistrar; | 45 class AnimationRegistrar; |
| 46 class GpuMemoryBufferManager; |
47 class HeadsUpDisplayLayer; | 47 class HeadsUpDisplayLayer; |
48 class Layer; | 48 class Layer; |
49 class LayerTreeHostImpl; | 49 class LayerTreeHostImpl; |
50 class LayerTreeHostImplClient; | 50 class LayerTreeHostImplClient; |
51 class LayerTreeHostSingleThreadClient; | 51 class LayerTreeHostSingleThreadClient; |
52 class PrioritizedResource; | 52 class PrioritizedResource; |
53 class PrioritizedResourceManager; | 53 class PrioritizedResourceManager; |
54 class Region; | 54 class Region; |
55 class RenderingStatsInstrumentation; | 55 class RenderingStatsInstrumentation; |
56 class ResourceProvider; | 56 class ResourceProvider; |
(...skipping 20 matching lines...) Expand all Loading... |
77 bool allow_partial_texture_updates; | 77 bool allow_partial_texture_updates; |
78 int max_texture_size; | 78 int max_texture_size; |
79 bool using_shared_memory_resources; | 79 bool using_shared_memory_resources; |
80 }; | 80 }; |
81 | 81 |
82 class CC_EXPORT LayerTreeHost { | 82 class CC_EXPORT LayerTreeHost { |
83 public: | 83 public: |
84 // The SharedBitmapManager will be used on the compositor thread. | 84 // The SharedBitmapManager will be used on the compositor thread. |
85 static scoped_ptr<LayerTreeHost> CreateThreaded( | 85 static scoped_ptr<LayerTreeHost> CreateThreaded( |
86 LayerTreeHostClient* client, | 86 LayerTreeHostClient* client, |
87 SharedBitmapManager* manager, | 87 SharedBitmapManager* shared_bitmap_manager, |
| 88 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
88 const LayerTreeSettings& settings, | 89 const LayerTreeSettings& settings, |
89 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 90 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
90 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 91 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
91 | 92 |
92 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 93 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
93 LayerTreeHostClient* client, | 94 LayerTreeHostClient* client, |
94 LayerTreeHostSingleThreadClient* single_thread_client, | 95 LayerTreeHostSingleThreadClient* single_thread_client, |
95 SharedBitmapManager* manager, | 96 SharedBitmapManager* shared_bitmap_manager, |
| 97 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
96 const LayerTreeSettings& settings, | 98 const LayerTreeSettings& settings, |
97 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 99 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
98 virtual ~LayerTreeHost(); | 100 virtual ~LayerTreeHost(); |
99 | 101 |
100 void SetLayerTreeHostClientReady(); | 102 void SetLayerTreeHostClientReady(); |
101 | 103 |
102 // LayerTreeHost interface to Proxy. | 104 // LayerTreeHost interface to Proxy. |
103 void WillBeginMainFrame() { | 105 void WillBeginMainFrame() { |
104 client_->WillBeginMainFrame(source_frame_number_); | 106 client_->WillBeginMainFrame(source_frame_number_); |
105 } | 107 } |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // Call this function when you expect there to be a swap buffer. | 299 // Call this function when you expect there to be a swap buffer. |
298 // See swap_promise.h for how to use SwapPromise. | 300 // See swap_promise.h for how to use SwapPromise. |
299 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 301 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
300 | 302 |
301 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 303 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
302 | 304 |
303 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 305 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
304 | 306 |
305 protected: | 307 protected: |
306 LayerTreeHost(LayerTreeHostClient* client, | 308 LayerTreeHost(LayerTreeHostClient* client, |
307 SharedBitmapManager* manager, | 309 SharedBitmapManager* shared_bitmap_manager, |
| 310 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
308 const LayerTreeSettings& settings); | 311 const LayerTreeSettings& settings); |
309 void InitializeThreaded( | 312 void InitializeThreaded( |
310 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 313 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
311 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 314 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
312 void InitializeSingleThreaded( | 315 void InitializeSingleThreaded( |
313 LayerTreeHostSingleThreadClient* single_thread_client, | 316 LayerTreeHostSingleThreadClient* single_thread_client, |
314 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 317 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
315 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 318 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
316 void SetOutputSurfaceLostForTesting(bool is_lost) { | 319 void SetOutputSurfaceLostForTesting(bool is_lost) { |
317 output_surface_lost_ = is_lost; | 320 output_surface_lost_ = is_lost; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 bool next_commit_forces_redraw_; | 449 bool next_commit_forces_redraw_; |
447 | 450 |
448 scoped_refptr<Layer> page_scale_layer_; | 451 scoped_refptr<Layer> page_scale_layer_; |
449 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 452 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
450 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 453 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
451 | 454 |
452 LayerSelectionBound selection_start_; | 455 LayerSelectionBound selection_start_; |
453 LayerSelectionBound selection_end_; | 456 LayerSelectionBound selection_end_; |
454 | 457 |
455 SharedBitmapManager* shared_bitmap_manager_; | 458 SharedBitmapManager* shared_bitmap_manager_; |
| 459 GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
456 | 460 |
457 ScopedPtrVector<SwapPromise> swap_promise_list_; | 461 ScopedPtrVector<SwapPromise> swap_promise_list_; |
458 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 462 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
459 | 463 |
460 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 464 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
461 }; | 465 }; |
462 | 466 |
463 } // namespace cc | 467 } // namespace cc |
464 | 468 |
465 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 469 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |