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

Unified Diff: cc/test/fake_layer_tree_host.cc

Issue 348093004: Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android compile fixes Created 6 years, 3 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 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; }

Powered by Google App Engine
This is Rietveld 408576698