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

Unified Diff: cc/test/fake_layer_tree_host.cc

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/test/fake_layer_tree_host.cc
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 143d22ea0c8413ec8cd100e39a276c4b48d79a57..e6688c7f221cce9e046ff6a70c92267a5cf46b79 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -6,10 +6,13 @@
namespace cc {
FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
- const LayerTreeSettings& settings)
- : LayerTreeHost(client, NULL, NULL, NULL, settings),
+ LayerTreeHost::InitParams* params)
+ : LayerTreeHost(params),
client_(client),
- host_impl_(settings, &proxy_, &manager_, nullptr),
+ host_impl_(params->settings ? *params->settings : LayerTreeSettings(),
danakj 2015/05/07 00:59:56 not a fan, this is a bit unobvious. i'd rather the
sadrul 2015/05/07 04:39:25 Removed the NULL check (and kept settings as a ptr
+ &proxy_,
+ &manager_,
+ nullptr),
needs_commit_(false) {
client_->SetLayerTreeHost(this);
}
@@ -18,13 +21,16 @@ scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
FakeLayerTreeHostClient* client) {
LayerTreeSettings settings;
settings.verify_property_trees = true;
- return make_scoped_ptr(new FakeLayerTreeHost(client, settings));
+ return Create(client, settings);
}
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
FakeLayerTreeHostClient* client,
const LayerTreeSettings& settings) {
- return make_scoped_ptr(new FakeLayerTreeHost(client, settings));
+ LayerTreeHost::InitParams params;
+ params.client = client;
+ params.settings = &settings;
+ return make_scoped_ptr(new FakeLayerTreeHost(client, &params));
}
FakeLayerTreeHost::~FakeLayerTreeHost() {

Powered by Google App Engine
This is Rietveld 408576698