| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 297 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
| 296 | 298 |
| 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 protected: | 305 protected: |
| 304 LayerTreeHost(LayerTreeHostClient* client, | 306 LayerTreeHost(LayerTreeHostClient* client, |
| 305 SharedBitmapManager* manager, | 307 SharedBitmapManager* shared_bitmap_manager, |
| 308 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 306 const LayerTreeSettings& settings); | 309 const LayerTreeSettings& settings); |
| 307 void InitializeThreaded( | 310 void InitializeThreaded( |
| 308 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 311 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 309 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 312 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 310 void InitializeSingleThreaded( | 313 void InitializeSingleThreaded( |
| 311 LayerTreeHostSingleThreadClient* single_thread_client, | 314 LayerTreeHostSingleThreadClient* single_thread_client, |
| 312 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 315 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 313 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 316 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
| 314 void SetOutputSurfaceLostForTesting(bool is_lost) { | 317 void SetOutputSurfaceLostForTesting(bool is_lost) { |
| 315 output_surface_lost_ = is_lost; | 318 output_surface_lost_ = is_lost; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 bool next_commit_forces_redraw_; | 447 bool next_commit_forces_redraw_; |
| 445 | 448 |
| 446 scoped_refptr<Layer> page_scale_layer_; | 449 scoped_refptr<Layer> page_scale_layer_; |
| 447 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 450 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
| 448 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 451 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
| 449 | 452 |
| 450 LayerSelectionBound selection_start_; | 453 LayerSelectionBound selection_start_; |
| 451 LayerSelectionBound selection_end_; | 454 LayerSelectionBound selection_end_; |
| 452 | 455 |
| 453 SharedBitmapManager* shared_bitmap_manager_; | 456 SharedBitmapManager* shared_bitmap_manager_; |
| 457 GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 454 | 458 |
| 455 ScopedPtrVector<SwapPromise> swap_promise_list_; | 459 ScopedPtrVector<SwapPromise> swap_promise_list_; |
| 456 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 460 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 457 | 461 |
| 458 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 462 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 459 }; | 463 }; |
| 460 | 464 |
| 461 } // namespace cc | 465 } // namespace cc |
| 462 | 466 |
| 463 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 467 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |