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 28a7a527c8181f244499a6f9ab08ac06808232eb..32767c824aba590615be64a177ed110fca96b400 100644 |
--- a/cc/test/fake_layer_tree_host.cc |
+++ b/cc/test/fake_layer_tree_host.cc |
@@ -5,22 +5,29 @@ |
#include "cc/test/fake_layer_tree_host.h" |
namespace cc { |
-FakeLayerTreeHost::FakeLayerTreeHost(LayerTreeHostClient* client, |
+FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client, |
const LayerTreeSettings& settings) |
: LayerTreeHost(client, NULL, settings), |
+ client_(client), |
host_impl_(settings, &proxy_, &manager_), |
- needs_commit_(false) {} |
+ needs_commit_(false) { |
+ client_->SetLayerTreeHost(this); |
+} |
-scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create() { |
- static FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D); |
- static LayerTreeSettings settings; |
- return make_scoped_ptr(new FakeLayerTreeHost(&client, settings)); |
+scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create( |
+ FakeLayerTreeHostClient* client) { |
+ LayerTreeSettings settings; |
+ return make_scoped_ptr(new FakeLayerTreeHost(client, settings)); |
} |
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create( |
+ FakeLayerTreeHostClient* client, |
const LayerTreeSettings& settings) { |
- static FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D); |
- return make_scoped_ptr(new FakeLayerTreeHost(&client, settings)); |
+ return make_scoped_ptr(new FakeLayerTreeHost(client, settings)); |
+} |
+ |
+FakeLayerTreeHost::~FakeLayerTreeHost() { |
+ client_->SetLayerTreeHost(NULL); |
} |
void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; } |