| 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 30 matching lines...) Expand all Loading... |
| 41 #include "cc/trees/proxy.h" | 41 #include "cc/trees/proxy.h" |
| 42 #include "third_party/skia/include/core/SkColor.h" | 42 #include "third_party/skia/include/core/SkColor.h" |
| 43 #include "ui/gfx/geometry/rect.h" | 43 #include "ui/gfx/geometry/rect.h" |
| 44 | 44 |
| 45 namespace gpu { | 45 namespace gpu { |
| 46 class GpuMemoryBufferManager; | 46 class GpuMemoryBufferManager; |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace cc { | 49 namespace cc { |
| 50 class AnimationRegistrar; | 50 class AnimationRegistrar; |
| 51 class BeginFrameSource; |
| 51 class HeadsUpDisplayLayer; | 52 class HeadsUpDisplayLayer; |
| 52 class Layer; | 53 class Layer; |
| 53 class LayerTreeHostImpl; | 54 class LayerTreeHostImpl; |
| 54 class LayerTreeHostImplClient; | 55 class LayerTreeHostImplClient; |
| 55 class LayerTreeHostSingleThreadClient; | 56 class LayerTreeHostSingleThreadClient; |
| 56 class PrioritizedResource; | 57 class PrioritizedResource; |
| 57 class PrioritizedResourceManager; | 58 class PrioritizedResourceManager; |
| 58 class Region; | 59 class Region; |
| 59 class RenderingStatsInstrumentation; | 60 class RenderingStatsInstrumentation; |
| 60 class ResourceProvider; | 61 class ResourceProvider; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 85 | 86 |
| 86 class CC_EXPORT LayerTreeHost { | 87 class CC_EXPORT LayerTreeHost { |
| 87 public: | 88 public: |
| 88 // The SharedBitmapManager will be used on the compositor thread. | 89 // The SharedBitmapManager will be used on the compositor thread. |
| 89 static scoped_ptr<LayerTreeHost> CreateThreaded( | 90 static scoped_ptr<LayerTreeHost> CreateThreaded( |
| 90 LayerTreeHostClient* client, | 91 LayerTreeHostClient* client, |
| 91 SharedBitmapManager* shared_bitmap_manager, | 92 SharedBitmapManager* shared_bitmap_manager, |
| 92 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 93 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 93 const LayerTreeSettings& settings, | 94 const LayerTreeSettings& settings, |
| 94 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 95 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 95 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 96 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 97 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 96 | 98 |
| 97 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 99 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
| 98 LayerTreeHostClient* client, | 100 LayerTreeHostClient* client, |
| 99 LayerTreeHostSingleThreadClient* single_thread_client, | 101 LayerTreeHostSingleThreadClient* single_thread_client, |
| 100 SharedBitmapManager* shared_bitmap_manager, | 102 SharedBitmapManager* shared_bitmap_manager, |
| 101 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 103 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 102 const LayerTreeSettings& settings, | 104 const LayerTreeSettings& settings, |
| 103 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 105 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 106 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 104 virtual ~LayerTreeHost(); | 107 virtual ~LayerTreeHost(); |
| 105 | 108 |
| 106 void SetLayerTreeHostClientReady(); | 109 void SetLayerTreeHostClientReady(); |
| 107 | 110 |
| 108 // LayerTreeHost interface to Proxy. | 111 // LayerTreeHost interface to Proxy. |
| 109 void WillBeginMainFrame() { | 112 void WillBeginMainFrame() { |
| 110 client_->WillBeginMainFrame(source_frame_number_); | 113 client_->WillBeginMainFrame(source_frame_number_); |
| 111 } | 114 } |
| 112 void DidBeginMainFrame(); | 115 void DidBeginMainFrame(); |
| 113 void BeginMainFrame(const BeginFrameArgs& args); | 116 void BeginMainFrame(const BeginFrameArgs& args); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 void set_surface_id_namespace(uint32_t id_namespace); | 314 void set_surface_id_namespace(uint32_t id_namespace); |
| 312 SurfaceSequence CreateSurfaceSequence(); | 315 SurfaceSequence CreateSurfaceSequence(); |
| 313 | 316 |
| 314 protected: | 317 protected: |
| 315 LayerTreeHost(LayerTreeHostClient* client, | 318 LayerTreeHost(LayerTreeHostClient* client, |
| 316 SharedBitmapManager* shared_bitmap_manager, | 319 SharedBitmapManager* shared_bitmap_manager, |
| 317 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 320 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 318 const LayerTreeSettings& settings); | 321 const LayerTreeSettings& settings); |
| 319 void InitializeThreaded( | 322 void InitializeThreaded( |
| 320 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 323 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 321 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 324 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 325 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 322 void InitializeSingleThreaded( | 326 void InitializeSingleThreaded( |
| 323 LayerTreeHostSingleThreadClient* single_thread_client, | 327 LayerTreeHostSingleThreadClient* single_thread_client, |
| 324 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 328 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 329 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 325 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 330 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
| 326 void SetOutputSurfaceLostForTesting(bool is_lost) { | 331 void SetOutputSurfaceLostForTesting(bool is_lost) { |
| 327 output_surface_lost_ = is_lost; | 332 output_surface_lost_ = is_lost; |
| 328 } | 333 } |
| 329 | 334 |
| 330 MicroBenchmarkController micro_benchmark_controller_; | 335 MicroBenchmarkController micro_benchmark_controller_; |
| 331 | 336 |
| 332 private: | 337 private: |
| 333 void InitializeProxy(scoped_ptr<Proxy> proxy); | 338 void InitializeProxy(scoped_ptr<Proxy> proxy); |
| 334 | 339 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 475 |
| 471 uint32_t surface_id_namespace_; | 476 uint32_t surface_id_namespace_; |
| 472 uint32_t next_surface_sequence_; | 477 uint32_t next_surface_sequence_; |
| 473 | 478 |
| 474 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 479 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 475 }; | 480 }; |
| 476 | 481 |
| 477 } // namespace cc | 482 } // namespace cc |
| 478 | 483 |
| 479 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 484 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |