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

Unified Diff: cc/layers/delegated_renderer_layer.cc

Issue 23530003: cc: Block commit on activate by setting a flag on LayerTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blockcommit: fix flake Created 7 years, 4 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/layers/delegated_renderer_layer.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/delegated_renderer_layer.cc
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index 0ffa54a7e3f8731d22b96738747260aa202cf948..1e1a8a0ab7a2859d6f38bc5d1aeb1cf422838a72 100644
--- a/cc/layers/delegated_renderer_layer.cc
+++ b/cc/layers/delegated_renderer_layer.cc
@@ -29,6 +29,23 @@ scoped_ptr<LayerImpl> DelegatedRendererLayer::CreateLayerImpl(
tree_impl, layer_id_).PassAs<LayerImpl>();
}
+void DelegatedRendererLayer::SetLayerTreeHost(LayerTreeHost* host) {
+ if (layer_tree_host() == host) {
+ Layer::SetLayerTreeHost(host);
+ return;
+ }
+
+ if (!host) {
+ // The active frame needs to be removed from the active tree and resources
+ // returned before the commit is called complete.
+ // TODO(danakj): Don't need to do this if the last frame commited was empty
+ // or we never commited a frame with resources.
+ SetNextCommitWaitsForActivation();
+ }
+
+ Layer::SetLayerTreeHost(host);
+}
+
bool DelegatedRendererLayer::DrawsContent() const {
return Layer::DrawsContent() && !frame_size_.IsEmpty();
}
@@ -83,6 +100,9 @@ void DelegatedRendererLayer::SetFrameData(
frame_size_ = gfx::Size();
}
SetNeedsCommit();
+ // The active frame needs to be replaced and resources returned before the
+ // commit is called complete.
+ SetNextCommitWaitsForActivation();
}
void DelegatedRendererLayer::TakeUnusedResourcesForChildCompositor(
@@ -93,12 +113,4 @@ void DelegatedRendererLayer::TakeUnusedResourcesForChildCompositor(
array->swap(unused_resources_for_child_compositor_);
}
-bool DelegatedRendererLayer::BlocksPendingCommit() const {
- // The active frame needs to be replaced and resources returned before the
- // commit is called complete. This is true even whenever there may be
- // resources to return, regardless of if the layer will draw in its new
- // state.
- return true;
-}
-
} // namespace cc
« no previous file with comments | « cc/layers/delegated_renderer_layer.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698