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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile by including ContextProvider from output_surface_client.h Created 7 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2b8d453ea916e48f3ba9d5710915225a2f99a8f9..d384ea716996f05d7171f3ddb04a0a1f284d1c6a 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1454,7 +1454,15 @@ bool LayerTreeHostImpl::InitializeRenderer(
if (!output_surface->BindToClient(this))
return false;
- if (output_surface->capabilities().deferred_gl_initialization) {
+ return DoInitializeRenderer(output_surface.Pass(),
+ false /* is_deferred_init */);
+}
+
+bool LayerTreeHostImpl::DoInitializeRenderer(
+ scoped_ptr<OutputSurface> output_surface,
+ bool is_deferred_init) {
+ if (output_surface->capabilities().deferred_gl_initialization &&
+ !is_deferred_init) {
// TODO(joth): Defer creating the Renderer too, until GL is initialized.
// See http://crbug.com/230197
renderer_ = SoftwareRenderer::Create(this, output_surface.get(), NULL);
@@ -1511,6 +1519,22 @@ bool LayerTreeHostImpl::InitializeRenderer(
return true;
}
+bool LayerTreeHostImpl::DeferredInitialize(
+ scoped_refptr<ContextProvider> offscreen_context_provider) {
+ DCHECK(output_surface_->capabilities().deferred_gl_initialization);
+ DCHECK(output_surface_->context3d());
+
+ // TODO(boliu): This is temporary until proper resource clean up is possible
+ // without resetting |tile_manager_| or |resource_provider_|.
+ DCHECK(!resource_provider_);
+
+ bool success =
+ DoInitializeRenderer(output_surface_.Pass(), true /* is_deferred_init */);
+ client_->DidTryInitializeRendererOnImplThread(success,
+ offscreen_context_provider);
+ return success;
+}
+
void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) {
if (device_viewport_size == device_viewport_size_)
return;
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698