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

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 | « no previous file | cc/trees/layer_tree_host.cc » ('j') | cc/trees/layer_tree_host.cc » ('J')
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 struct InitParams {
75 LayerTreeHostClient* client = nullptr;
76 SharedBitmapManager* shared_bitmap_manager = nullptr;
77 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr;
78 TaskGraphRunner* task_graph_runner = nullptr;
79 LayerTreeSettings const* settings = nullptr;
80 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner;
81 mutable scoped_ptr<BeginFrameSource> external_begin_frame_source;
danakj 2015/05/06 21:00:48 :( mutable. this should be a movable type so we c
sadrul 2015/05/06 23:35:43 Yep, makes sense. Done.
82
83 InitParams();
84 ~InitParams();
85 };
86
74 // The SharedBitmapManager will be used on the compositor thread. 87 // The SharedBitmapManager will be used on the compositor thread.
75 static scoped_ptr<LayerTreeHost> CreateThreaded( 88 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, 89 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
83 scoped_ptr<BeginFrameSource> external_begin_frame_source); 90 const InitParams& params);
84 91
85 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( 92 static scoped_ptr<LayerTreeHost> CreateSingleThreaded(
86 LayerTreeHostClient* client,
87 LayerTreeHostSingleThreadClient* single_thread_client, 93 LayerTreeHostSingleThreadClient* single_thread_client,
88 SharedBitmapManager* shared_bitmap_manager, 94 const 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(); 95 virtual ~LayerTreeHost();
95 96
96 void SetLayerTreeHostClientReady(); 97 void SetLayerTreeHostClientReady();
97 98
98 // LayerTreeHost interface to Proxy. 99 // LayerTreeHost interface to Proxy.
99 void WillBeginMainFrame(); 100 void WillBeginMainFrame();
100 void DidBeginMainFrame(); 101 void DidBeginMainFrame();
101 void BeginMainFrame(const BeginFrameArgs& args); 102 void BeginMainFrame(const BeginFrameArgs& args);
102 void BeginMainFrameNotExpectedSoon(); 103 void BeginMainFrameNotExpectedSoon();
103 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); 104 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; 307 void SendBeginFramesToChildren(const BeginFrameArgs& args) const;
307 308
308 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); 309 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval);
309 310
310 PropertyTrees* property_trees() { return &property_trees_; } 311 PropertyTrees* property_trees() { return &property_trees_; }
311 bool needs_meta_info_recomputation() { 312 bool needs_meta_info_recomputation() {
312 return needs_meta_info_recomputation_; 313 return needs_meta_info_recomputation_;
313 } 314 }
314 315
315 protected: 316 protected:
316 LayerTreeHost(LayerTreeHostClient* client, 317 explicit LayerTreeHost(const 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( 318 void InitializeThreaded(
322 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 319 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
323 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 320 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
324 scoped_ptr<BeginFrameSource> external_begin_frame_source); 321 scoped_ptr<BeginFrameSource> external_begin_frame_source);
325 void InitializeSingleThreaded( 322 void InitializeSingleThreaded(
326 LayerTreeHostSingleThreadClient* single_thread_client, 323 LayerTreeHostSingleThreadClient* single_thread_client,
327 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 324 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
328 scoped_ptr<BeginFrameSource> external_begin_frame_source); 325 scoped_ptr<BeginFrameSource> external_begin_frame_source);
329 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); 326 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing);
330 void SetOutputSurfaceLostForTesting(bool is_lost) { 327 void SetOutputSurfaceLostForTesting(bool is_lost) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 456
460 uint32_t surface_id_namespace_; 457 uint32_t surface_id_namespace_;
461 uint32_t next_surface_sequence_; 458 uint32_t next_surface_sequence_;
462 459
463 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 460 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
464 }; 461 };
465 462
466 } // namespace cc 463 } // namespace cc
467 464
468 #endif // CC_TREES_LAYER_TREE_HOST_H_ 465 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | cc/trees/layer_tree_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698