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

Unified Diff: trunk/src/cc/trees/layer_tree_host.cc

Issue 103163003: Revert 238458 "cc: Defer first OutputSurface creation until clie..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | « trunk/src/cc/trees/layer_tree_host.h ('k') | trunk/src/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: trunk/src/cc/trees/layer_tree_host.cc
===================================================================
--- trunk/src/cc/trees/layer_tree_host.cc (revision 238469)
+++ trunk/src/cc/trees/layer_tree_host.cc (working copy)
@@ -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));
+ return InitializeProxy(ThreadProxy::Create(this, impl_task_runner));
}
-void LayerTreeHost::InitializeSingleThreaded(
+bool LayerTreeHost::InitializeSingleThreaded(
LayerTreeHostSingleThreadClient* single_thread_client) {
- InitializeProxy(SingleThreadProxy::Create(this, single_thread_client));
+ return InitializeProxy(
+ SingleThreadProxy::Create(this, single_thread_client));
}
-void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) {
- InitializeProxy(proxy_for_testing.Pass());
+bool LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) {
+ return InitializeProxy(proxy_for_testing.Pass());
}
-void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) {
+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 | « trunk/src/cc/trees/layer_tree_host.h ('k') | trunk/src/cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698