summaryrefslogtreecommitdiffstats
path: root/cc/layers/delegated_renderer_layer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/layers/delegated_renderer_layer.cc')
-rw-r--r--cc/layers/delegated_renderer_layer.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index 0ffa54a..1e1a8a0 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