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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 256573003: cc: Remove the capability to give up and leave compositing mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.h ('k') | cc/trees/layer_tree_host_client.h » ('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 4cdd97d3c354be3b526969ef983b00dab32b8a83..cf7949280b43fc3fd8e83052336ee5edc148adb9 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -177,50 +177,38 @@ static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) {
layer->OnOutputSurfaceCreated();
}
-LayerTreeHost::CreateResult
-LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
+void LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
+ DCHECK(output_surface_lost_);
TRACE_EVENT1("cc",
"LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted",
"success",
success);
- DCHECK(output_surface_lost_);
- if (success) {
- output_surface_lost_ = false;
-
- if (!contents_texture_manager_ && !settings_.impl_side_painting) {
- contents_texture_manager_ =
- PrioritizedResourceManager::Create(proxy_.get());
- surface_memory_placeholder_ =
- contents_texture_manager_->CreateTexture(gfx::Size(), RGBA_8888);
- }
-
- if (root_layer()) {
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(),
- base::Bind(&LayerTreeHostOnOutputSurfaceCreatedCallback));
- }
-
- client_->DidInitializeOutputSurface(true);
- return CreateSucceeded;
+ if (!success) {
+ // Tolerate a certain number of recreation failures to work around races
+ // in the output-surface-lost machinery.
+ ++num_failed_recreate_attempts_;
+ if (num_failed_recreate_attempts_ >= 5)
+ LOG(FATAL) << "Failed to create a fallback OutputSurface.";
+ client_->DidFailToInitializeOutputSurface();
+ return;
}
- // Failure path.
+ output_surface_lost_ = false;
- client_->DidFailToInitializeOutputSurface();
+ if (!contents_texture_manager_ && !settings_.impl_side_painting) {
+ contents_texture_manager_ =
+ PrioritizedResourceManager::Create(proxy_.get());
+ surface_memory_placeholder_ =
+ contents_texture_manager_->CreateTexture(gfx::Size(), RGBA_8888);
+ }
- // Tolerate a certain number of recreation failures to work around races
- // in the output-surface-lost machinery.
- ++num_failed_recreate_attempts_;
- if (num_failed_recreate_attempts_ >= 5) {
- // We have tried too many times to recreate the output surface. Tell the
- // host to fall back to software rendering.
- output_surface_can_be_initialized_ = false;
- client_->DidInitializeOutputSurface(false);
- return CreateFailedAndGaveUp;
+ if (root_layer()) {
+ LayerTreeHostCommon::CallFunctionForSubtree(
+ root_layer(), base::Bind(&LayerTreeHostOnOutputSurfaceCreatedCallback));
}
- return CreateFailedButTryAgain;
+ client_->DidInitializeOutputSurface();
}
void LayerTreeHost::DeleteContentsTexturesOnImplThread(
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698