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 26 matching lines...) Expand all Loading... | |
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 | 45 |
46 class AnimationRegistrar; | 46 class AnimationRegistrar; |
47 class ExternalBeginFrameSource; | |
mithro-old
2014/10/13 02:56:20
Can we get away with the layer_tree_host not needi
simonhong
2014/10/15 01:04:21
I think ExternalBeginFrameSource has a different s
| |
47 class HeadsUpDisplayLayer; | 48 class HeadsUpDisplayLayer; |
48 class Layer; | 49 class Layer; |
49 class LayerTreeHostImpl; | 50 class LayerTreeHostImpl; |
50 class LayerTreeHostImplClient; | 51 class LayerTreeHostImplClient; |
51 class LayerTreeHostSingleThreadClient; | 52 class LayerTreeHostSingleThreadClient; |
52 class PrioritizedResource; | 53 class PrioritizedResource; |
53 class PrioritizedResourceManager; | 54 class PrioritizedResourceManager; |
54 class Region; | 55 class Region; |
55 class RenderingStatsInstrumentation; | 56 class RenderingStatsInstrumentation; |
56 class ResourceProvider; | 57 class ResourceProvider; |
(...skipping 23 matching lines...) Expand all Loading... | |
80 }; | 81 }; |
81 | 82 |
82 class CC_EXPORT LayerTreeHost { | 83 class CC_EXPORT LayerTreeHost { |
83 public: | 84 public: |
84 // The SharedBitmapManager will be used on the compositor thread. | 85 // The SharedBitmapManager will be used on the compositor thread. |
85 static scoped_ptr<LayerTreeHost> CreateThreaded( | 86 static scoped_ptr<LayerTreeHost> CreateThreaded( |
86 LayerTreeHostClient* client, | 87 LayerTreeHostClient* client, |
87 SharedBitmapManager* manager, | 88 SharedBitmapManager* 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, |
92 scoped_ptr<ExternalBeginFrameSource> external_begin_frame_source); | |
91 | 93 |
92 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 94 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
93 LayerTreeHostClient* client, | 95 LayerTreeHostClient* client, |
94 LayerTreeHostSingleThreadClient* single_thread_client, | 96 LayerTreeHostSingleThreadClient* single_thread_client, |
95 SharedBitmapManager* manager, | 97 SharedBitmapManager* 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, |
100 scoped_ptr<ExternalBeginFrameSource> external_begin_frame_source); | |
98 virtual ~LayerTreeHost(); | 101 virtual ~LayerTreeHost(); |
99 | 102 |
100 void SetLayerTreeHostClientReady(); | 103 void SetLayerTreeHostClientReady(); |
101 | 104 |
102 // LayerTreeHost interface to Proxy. | 105 // LayerTreeHost interface to Proxy. |
103 void WillBeginMainFrame() { | 106 void WillBeginMainFrame() { |
104 client_->WillBeginMainFrame(source_frame_number_); | 107 client_->WillBeginMainFrame(source_frame_number_); |
105 } | 108 } |
106 void DidBeginMainFrame(); | 109 void DidBeginMainFrame(); |
107 void BeginMainFrame(const BeginFrameArgs& args); | 110 void BeginMainFrame(const BeginFrameArgs& args); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 304 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
302 | 305 |
303 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 306 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
304 | 307 |
305 protected: | 308 protected: |
306 LayerTreeHost(LayerTreeHostClient* client, | 309 LayerTreeHost(LayerTreeHostClient* client, |
307 SharedBitmapManager* manager, | 310 SharedBitmapManager* 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, |
315 scoped_ptr<ExternalBeginFrameSource> external_begin_frame_source); | |
312 void InitializeSingleThreaded( | 316 void InitializeSingleThreaded( |
313 LayerTreeHostSingleThreadClient* single_thread_client, | 317 LayerTreeHostSingleThreadClient* single_thread_client, |
314 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 318 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
319 scoped_ptr<ExternalBeginFrameSource> external_begin_frame_source); | |
315 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 320 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
316 void SetOutputSurfaceLostForTesting(bool is_lost) { | 321 void SetOutputSurfaceLostForTesting(bool is_lost) { |
317 output_surface_lost_ = is_lost; | 322 output_surface_lost_ = is_lost; |
318 } | 323 } |
319 | 324 |
320 MicroBenchmarkController micro_benchmark_controller_; | 325 MicroBenchmarkController micro_benchmark_controller_; |
321 | 326 |
322 private: | 327 private: |
323 void InitializeProxy(scoped_ptr<Proxy> proxy); | 328 void InitializeProxy(scoped_ptr<Proxy> proxy); |
324 | 329 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 | 461 |
457 ScopedPtrVector<SwapPromise> swap_promise_list_; | 462 ScopedPtrVector<SwapPromise> swap_promise_list_; |
458 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 463 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
459 | 464 |
460 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 465 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
461 }; | 466 }; |
462 | 467 |
463 } // namespace cc | 468 } // namespace cc |
464 | 469 |
465 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 470 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |