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

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: all 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
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..3ae651a89b9e7673793966a2aaf07a297315efaf 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 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,

Powered by Google App Engine
This is Rietveld 408576698