Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: cc/trees/layer_tree_host.h

Issue 1126253005: cc: Add LayerTreeHost::InitParams for LayerTreeHost creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 class SharedBitmapManager; 64 class SharedBitmapManager;
65 class TaskGraphRunner; 65 class TaskGraphRunner;
66 class TopControlsManager; 66 class TopControlsManager;
67 class UIResourceRequest; 67 class UIResourceRequest;
68 struct PendingPageScaleAnimation; 68 struct PendingPageScaleAnimation;
69 struct RenderingStats; 69 struct RenderingStats;
70 struct ScrollAndScaleSet; 70 struct ScrollAndScaleSet;
71 71
72 class CC_EXPORT LayerTreeHost { 72 class CC_EXPORT LayerTreeHost {
73 public: 73 public:
74 // TODO(sad): InitParams should be a movable type so that it can be
75 // std::move()d to the Create* functions.
76 struct CC_EXPORT InitParams {
77 LayerTreeHostClient* client = nullptr;
78 SharedBitmapManager* shared_bitmap_manager = nullptr;
79 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr;
80 TaskGraphRunner* task_graph_runner = nullptr;
81 LayerTreeSettings const* settings = nullptr;
82 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner;
83 scoped_ptr<BeginFrameSource> external_begin_frame_source;
84
85 InitParams();
86 ~InitParams();
87 };
88
74 // The SharedBitmapManager will be used on the compositor thread. 89 // The SharedBitmapManager will be used on the compositor thread.
75 static scoped_ptr<LayerTreeHost> CreateThreaded( 90 static scoped_ptr<LayerTreeHost> CreateThreaded(
76 LayerTreeHostClient* client,
77 SharedBitmapManager* shared_bitmap_manager,
78 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
79 TaskGraphRunner* task_graph_runner,
80 const LayerTreeSettings& settings,
81 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
82 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 91 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
83 scoped_ptr<BeginFrameSource> external_begin_frame_source); 92 InitParams* params);
84 93
85 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( 94 static scoped_ptr<LayerTreeHost> CreateSingleThreaded(
86 LayerTreeHostClient* client,
87 LayerTreeHostSingleThreadClient* single_thread_client, 95 LayerTreeHostSingleThreadClient* single_thread_client,
88 SharedBitmapManager* shared_bitmap_manager, 96 InitParams* params);
89 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
90 TaskGraphRunner* task_graph_runner,
91 const LayerTreeSettings& settings,
92 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
93 scoped_ptr<BeginFrameSource> external_begin_frame_source);
94 virtual ~LayerTreeHost(); 97 virtual ~LayerTreeHost();
95 98
96 void SetLayerTreeHostClientReady(); 99 void SetLayerTreeHostClientReady();
97 100
98 // LayerTreeHost interface to Proxy. 101 // LayerTreeHost interface to Proxy.
99 void WillBeginMainFrame(); 102 void WillBeginMainFrame();
100 void DidBeginMainFrame(); 103 void DidBeginMainFrame();
101 void BeginMainFrame(const BeginFrameArgs& args); 104 void BeginMainFrame(const BeginFrameArgs& args);
102 void BeginMainFrameNotExpectedSoon(); 105 void BeginMainFrameNotExpectedSoon();
103 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); 106 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; 309 void SendBeginFramesToChildren(const BeginFrameArgs& args) const;
307 310
308 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); 311 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval);
309 312
310 PropertyTrees* property_trees() { return &property_trees_; } 313 PropertyTrees* property_trees() { return &property_trees_; }
311 bool needs_meta_info_recomputation() { 314 bool needs_meta_info_recomputation() {
312 return needs_meta_info_recomputation_; 315 return needs_meta_info_recomputation_;
313 } 316 }
314 317
315 protected: 318 protected:
316 LayerTreeHost(LayerTreeHostClient* client, 319 explicit LayerTreeHost(InitParams* params);
317 SharedBitmapManager* shared_bitmap_manager,
318 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
319 TaskGraphRunner* task_graph_runner,
320 const LayerTreeSettings& settings);
321 void InitializeThreaded( 320 void InitializeThreaded(
322 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 321 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
323 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 322 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
324 scoped_ptr<BeginFrameSource> external_begin_frame_source); 323 scoped_ptr<BeginFrameSource> external_begin_frame_source);
325 void InitializeSingleThreaded( 324 void InitializeSingleThreaded(
326 LayerTreeHostSingleThreadClient* single_thread_client, 325 LayerTreeHostSingleThreadClient* single_thread_client,
327 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 326 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
328 scoped_ptr<BeginFrameSource> external_begin_frame_source); 327 scoped_ptr<BeginFrameSource> external_begin_frame_source);
329 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); 328 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing);
330 void SetOutputSurfaceLostForTesting(bool is_lost) { 329 void SetOutputSurfaceLostForTesting(bool is_lost) {
331 output_surface_lost_ = is_lost; 330 output_surface_lost_ = is_lost;
332 } 331 }
333 332
333 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and
334 // task_graph_runner() return valid values only until the LayerTreeHostImpl is
335 // created in CreateLayerTreeHostImpl().
336 SharedBitmapManager* shared_bitmap_manager() const {
337 return shared_bitmap_manager_;
338 }
339 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const {
340 return gpu_memory_buffer_manager_;
341 }
342 TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; }
343
334 MicroBenchmarkController micro_benchmark_controller_; 344 MicroBenchmarkController micro_benchmark_controller_;
335 345
336 private: 346 private:
337 void InitializeProxy(scoped_ptr<Proxy> proxy); 347 void InitializeProxy(scoped_ptr<Proxy> proxy);
338 348
339 void PaintLayerContents( 349 void PaintLayerContents(
340 const RenderSurfaceLayerList& render_surface_layer_list, 350 const RenderSurfaceLayerList& render_surface_layer_list,
341 ResourceUpdateQueue* queue, 351 ResourceUpdateQueue* queue,
342 bool* did_paint_content, 352 bool* did_paint_content,
343 bool* need_more_updates); 353 bool* need_more_updates);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 469
460 uint32_t surface_id_namespace_; 470 uint32_t surface_id_namespace_;
461 uint32_t next_surface_sequence_; 471 uint32_t next_surface_sequence_;
462 472
463 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 473 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
464 }; 474 };
465 475
466 } // namespace cc 476 } // namespace cc
467 477
468 #endif // CC_TREES_LAYER_TREE_HOST_H_ 478 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698