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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.h
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index f9667e3d084d3c16922e743e126b2de239488d99..1b88cffc62cda658d843d1af15332fc25f3a07ea 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -71,26 +71,29 @@ struct ScrollAndScaleSet;
class CC_EXPORT LayerTreeHost {
public:
+ // TODO(sad): InitParams should be a movable type so that it can be
+ // std::move()d to the Create* functions.
+ struct CC_EXPORT InitParams {
+ LayerTreeHostClient* client = nullptr;
+ SharedBitmapManager* shared_bitmap_manager = nullptr;
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr;
+ TaskGraphRunner* task_graph_runner = nullptr;
+ LayerTreeSettings const* settings = nullptr;
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner;
+ scoped_ptr<BeginFrameSource> external_begin_frame_source;
+
+ InitParams();
+ ~InitParams();
+ };
+
// The SharedBitmapManager will be used on the compositor thread.
static scoped_ptr<LayerTreeHost> CreateThreaded(
- LayerTreeHostClient* client,
- SharedBitmapManager* shared_bitmap_manager,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- TaskGraphRunner* task_graph_runner,
- const LayerTreeSettings& settings,
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
- scoped_ptr<BeginFrameSource> external_begin_frame_source);
+ InitParams* params);
static scoped_ptr<LayerTreeHost> CreateSingleThreaded(
- LayerTreeHostClient* client,
LayerTreeHostSingleThreadClient* single_thread_client,
- SharedBitmapManager* shared_bitmap_manager,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- TaskGraphRunner* task_graph_runner,
- const LayerTreeSettings& settings,
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
- scoped_ptr<BeginFrameSource> external_begin_frame_source);
+ InitParams* params);
virtual ~LayerTreeHost();
void SetLayerTreeHostClientReady();
@@ -313,11 +316,7 @@ class CC_EXPORT LayerTreeHost {
}
protected:
- LayerTreeHost(LayerTreeHostClient* client,
- SharedBitmapManager* shared_bitmap_manager,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- TaskGraphRunner* task_graph_runner,
- const LayerTreeSettings& settings);
+ explicit LayerTreeHost(InitParams* params);
void InitializeThreaded(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
@@ -331,6 +330,17 @@ class CC_EXPORT LayerTreeHost {
output_surface_lost_ = is_lost;
}
+ // shared_bitmap_manager(), gpu_memory_buffer_manager(), and
+ // task_graph_runner() return valid values only until the LayerTreeHostImpl is
+ // created in CreateLayerTreeHostImpl().
+ SharedBitmapManager* shared_bitmap_manager() const {
+ return shared_bitmap_manager_;
+ }
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const {
+ return gpu_memory_buffer_manager_;
+ }
+ TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; }
+
MicroBenchmarkController micro_benchmark_controller_;
private:
« 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