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

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 | « no previous file | cc/trees/layer_tree_host.cc » ('j') | cc/trees/layer_tree_host.cc » ('J')
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..6054b481caad47c1db8dda047c55bda6488f2de0 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -71,26 +71,27 @@ struct ScrollAndScaleSet;
class CC_EXPORT LayerTreeHost {
public:
+ struct 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;
+ 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.
+
+ 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);
+ const 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);
+ const InitParams& params);
virtual ~LayerTreeHost();
void SetLayerTreeHostClientReady();
@@ -313,11 +314,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(const InitParams& params);
void InitializeThreaded(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
« 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