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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 251343002: Remove offscreen compositor contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-offscreencontext: include Created 6 years, 8 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 447bfc0847e88137453d8eb990f652c27f06484d..679e0e76a083e0fb2b4a9034928d589b80717ce8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1426,14 +1426,12 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
scoped_ptr<SoftwareRenderer> temp_software_renderer =
SoftwareRenderer::Create(this, &settings_, output_surface_.get(), NULL);
temp_software_renderer->DrawFrame(&frame->render_passes,
- NULL,
device_scale_factor_,
DeviceViewport(),
DeviceClip(),
disable_picture_quad_image_filtering);
} else {
renderer_->DrawFrame(&frame->render_passes,
- offscreen_context_provider_.get(),
device_scale_factor_,
DeviceViewport(),
DeviceClip(),
@@ -1917,8 +1915,7 @@ bool LayerTreeHostImpl::InitializeRenderer(
return true;
}
-bool LayerTreeHostImpl::DeferredInitialize(
- scoped_refptr<ContextProvider> offscreen_context_provider) {
+void LayerTreeHostImpl::DeferredInitialize() {
DCHECK(output_surface_->capabilities().deferred_gl_initialization);
DCHECK(settings_.impl_side_painting);
DCHECK(output_surface_->context_provider());
@@ -1932,39 +1929,8 @@ bool LayerTreeHostImpl::DeferredInitialize(
CreateAndSetRenderer(
output_surface_.get(), resource_provider_.get(), skip_gl_renderer);
- bool success = true;
- if (offscreen_context_provider.get() &&
- !offscreen_context_provider->BindToCurrentThread())
- success = false;
-
- if (success) {
- EnforceZeroBudget(false);
- client_->SetNeedsCommitOnImplThread();
- } else {
- if (offscreen_context_provider.get()) {
- if (offscreen_context_provider->BindToCurrentThread())
- offscreen_context_provider->VerifyContexts();
- offscreen_context_provider = NULL;
- }
-
- client_->DidLoseOutputSurfaceOnImplThread();
-
- // If this method fails, the context provider will be dropped from the
- // output surface and destroyed. But the GLRenderer expects the output
- // surface to stick around - and hold onto the context3d - as long as it is
- // alive.
- // TODO(danakj): Remove the need for this code path: crbug.com/276411
- renderer_.reset();
-
- // The resource provider can't stay in GL mode or it tries to clean up GL
- // stuff, but the context provider is going away on the output surface
- // which contradicts being in GL mode.
- // TODO(danakj): Remove the need for this code path: crbug.com/276411
- resource_provider_->InitializeSoftware();
- }
-
- SetOffscreenContextProvider(offscreen_context_provider);
- return success;
+ EnforceZeroBudget(false);
+ client_->SetNeedsCommitOnImplThread();
}
void LayerTreeHostImpl::ReleaseGL() {
@@ -1991,8 +1957,6 @@ void LayerTreeHostImpl::ReleaseGL() {
GetRendererCapabilities().allow_rasterize_on_demand);
DCHECK(tile_manager_);
- SetOffscreenContextProvider(NULL);
-
client_->SetNeedsCommitOnImplThread();
}
@@ -2821,21 +2785,6 @@ void LayerTreeHostImpl::SendReleaseResourcesRecursive(LayerImpl* current) {
SendReleaseResourcesRecursive(current->children()[i]);
}
-void LayerTreeHostImpl::SetOffscreenContextProvider(
- const scoped_refptr<ContextProvider>& offscreen_context_provider) {
- if (!offscreen_context_provider.get()) {
- offscreen_context_provider_ = NULL;
- return;
- }
-
- if (!offscreen_context_provider->BindToCurrentThread()) {
- offscreen_context_provider_ = NULL;
- return;
- }
-
- offscreen_context_provider_ = offscreen_context_provider;
-}
-
std::string LayerTreeHostImpl::LayerTreeAsJson() const {
std::string str;
if (active_tree_->root_layer()) {
« 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