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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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_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 4d03449fc0d073598aea5dbe4b5f28fdfb168060..d192a9aaa88d0fea68d586a193dda2f6e443fbc5 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -114,7 +114,6 @@ LayerTreeHost::LayerTreeHost(
source_frame_number_(0),
rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()),
output_surface_lost_(true),
- num_failed_recreate_attempts_(0),
settings_(settings),
debug_state_(settings.initial_debug_state),
top_controls_shrink_blink_size_(false),
@@ -217,40 +216,6 @@ static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) {
layer->OnOutputSurfaceCreated();
}
-void LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
- DCHECK(output_surface_lost_);
- TRACE_EVENT1("cc",
- "LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted",
- "success",
- success);
-
- 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;
- }
-
- 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();
-}
-
void LayerTreeHost::DeleteContentsTexturesOnImplThread(
ResourceProvider* resource_provider) {
DCHECK(proxy_->IsImplThread());
@@ -328,12 +293,6 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees(
root_layer(), sync_tree->DetachLayerTree(), sync_tree));
}
-
- {
- TRACE_EVENT0("cc", "LayerTreeHost::PushProperties");
- TreeSynchronizer::PushProperties(root_layer(), sync_tree->root_layer());
- }
-
sync_tree->set_needs_full_tree_sync(needs_full_tree_sync_);
needs_full_tree_sync_ = false;
@@ -355,6 +314,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
page_scale_layer_->id(), inner_viewport_scroll_layer_->id(),
outer_viewport_scroll_layer_.get() ? outer_viewport_scroll_layer_->id()
: Layer::INVALID_ID);
+ DCHECK(inner_viewport_scroll_layer_->IsContainerForFixedPositionLayers());
} else {
sync_tree->ClearViewportLayers();
}
@@ -415,6 +375,11 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->set_has_ever_been_drawn(false);
+ {
+ TRACE_EVENT0("cc", "LayerTreeHost::PushProperties");
+ TreeSynchronizer::PushProperties(root_layer(), sync_tree->root_layer());
+ }
+
micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl);
}
@@ -441,11 +406,38 @@ void LayerTreeHost::CommitComplete() {
}
void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) {
+ TRACE_EVENT0("cc", "LayerTreeHost::SetOutputSurface");
+ DCHECK(output_surface_lost_);
+ DCHECK(surface);
+
proxy_->SetOutputSurface(surface.Pass());
}
void LayerTreeHost::RequestNewOutputSurface() {
- client_->RequestNewOutputSurface(num_failed_recreate_attempts_ >= 4);
+ client_->RequestNewOutputSurface();
+}
+
+void LayerTreeHost::DidInitializeOutputSurface() {
+ 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();
+}
+
+void LayerTreeHost::DidFailToInitializeOutputSurface() {
+ DCHECK(output_surface_lost_);
+ client_->DidFailToInitializeOutputSurface();
}
scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl(
@@ -478,7 +470,6 @@ void LayerTreeHost::DidLoseOutputSurface() {
if (output_surface_lost_)
return;
- num_failed_recreate_attempts_ = 0;
output_surface_lost_ = true;
SetNeedsCommit();
}
« 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