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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 101573005: Revert of cc: Defer first OutputSurface creation until client is ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 5addf281a877f04084a501140ce88b927e10f951..c1e1d4bef5d2b4e181b441ccece32f8d19cc3180 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -70,7 +70,8 @@
DCHECK(impl_task_runner);
scoped_ptr<LayerTreeHost> layer_tree_host(
new LayerTreeHost(client, manager, settings));
- layer_tree_host->InitializeThreaded(impl_task_runner);
+ if (!layer_tree_host->InitializeThreaded(impl_task_runner))
+ return scoped_ptr<LayerTreeHost>();
return layer_tree_host.Pass();
}
@@ -81,7 +82,8 @@
const LayerTreeSettings& settings) {
scoped_ptr<LayerTreeHost> layer_tree_host(
new LayerTreeHost(client, manager, settings));
- layer_tree_host->InitializeSingleThreaded(single_thread_client);
+ if (!layer_tree_host->InitializeSingleThreaded(single_thread_client))
+ return scoped_ptr<LayerTreeHost>();
return layer_tree_host.Pass();
}
@@ -124,25 +126,31 @@
debug_state_.RecordRenderingStats());
}
-void LayerTreeHost::InitializeThreaded(
+bool LayerTreeHost::InitializeThreaded(
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
- InitializeProxy(ThreadProxy::Create(this, impl_task_runner));
-}
-
-void LayerTreeHost::InitializeSingleThreaded(
+ return InitializeProxy(ThreadProxy::Create(this, impl_task_runner));
+}
+
+bool LayerTreeHost::InitializeSingleThreaded(
LayerTreeHostSingleThreadClient* single_thread_client) {
- InitializeProxy(SingleThreadProxy::Create(this, single_thread_client));
-}
-
-void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) {
- InitializeProxy(proxy_for_testing.Pass());
-}
-
-void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) {
+ return InitializeProxy(
+ SingleThreadProxy::Create(this, single_thread_client));
+}
+
+bool LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) {
+ return InitializeProxy(proxy_for_testing.Pass());
+}
+
+bool LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) {
TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal");
+ scoped_ptr<OutputSurface> output_surface(CreateOutputSurface());
+ if (!output_surface)
+ return false;
+
proxy_ = proxy.Pass();
- proxy_->Start();
+ proxy_->Start(output_surface.Pass());
+ return true;
}
LayerTreeHost::~LayerTreeHost() {
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698