summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 00:24:11 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 00:24:11 +0000
commit849758361608a2bcaff0498bee547956eb2f34a8 (patch)
tree36710c6817f26e302090b6de6d702095c2f8446b /cc
parent7aab04d1573e5e85ac832abd611a5fee04b4b4d8 (diff)
downloadchromium_src-849758361608a2bcaff0498bee547956eb2f34a8.zip
chromium_src-849758361608a2bcaff0498bee547956eb2f34a8.tar.gz
chromium_src-849758361608a2bcaff0498bee547956eb2f34a8.tar.bz2
cc: Fix incorrect LTHI shutdown logic
It's possible that if there has never been an activation (implying no root layer on the active tree), then the trees will not be cleared during LayerTreeHostImpl's destructor. Given the comment in the destructor about animation, this seems to be problematic enough. Issue 251722 is about a case where the tile manager tries to activate the tree during its destruction but because the trees haven't been cleared yet, it thinks this is a supported operation. This is fixed by always destroying the trees in the destructor. Related cleanup is to remove the CleanupRenderSurfaces() call which isn't needed there. When you destroy a tree, you destroy its render surfaces. And, it looked like none of the other CleanupRenderSurfaces() calls were really needed either except for losing the output surface, so one call got moved there and all the rest of the functions got removed. R=danakj@chromium.org BUG=251722 Review URL: https://chromiumcodereview.appspot.com/16831016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/trees/layer_tree_host_impl.cc14
-rw-r--r--cc/trees/layer_tree_host_impl.h1
-rw-r--r--cc/trees/layer_tree_impl.cc17
-rw-r--r--cc/trees/layer_tree_impl.h3
4 files changed, 4 insertions, 31 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 3905e8e..99386b9 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -227,7 +227,6 @@ LayerTreeHostImpl::~LayerTreeHostImpl() {
input_handler_client_ = NULL;
}
- ClearRenderSurfaces();
// The layer trees must be destroyed before the layer tree host. We've
// made a contract with our animation controllers that the registrar
// will outlive them, and we must make good.
@@ -1390,7 +1389,6 @@ void LayerTreeHostImpl::ActivatePendingTree() {
// tree, rename the pending tree the recycle tree so we can reuse it on the
// next sync.
pending_tree_.swap(recycle_tree_);
- recycle_tree_->ClearRenderSurfaces();
active_tree_->SetRootLayerScrollOffsetDelegate(
root_layer_scroll_offset_delegate_);
@@ -1445,8 +1443,6 @@ ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
void LayerTreeHostImpl::ReleaseTreeResources() {
if (active_tree_->root_layer())
- ClearRenderSurfaces();
- if (active_tree_->root_layer())
SendReleaseResourcesRecursive(active_tree_->root_layer());
if (pending_tree_ && pending_tree_->root_layer())
SendReleaseResourcesRecursive(pending_tree_->root_layer());
@@ -1472,8 +1468,10 @@ void LayerTreeHostImpl::CreateAndSetRenderer(
SoftwareRenderer::Create(this, output_surface, resource_provider);
}
- if (renderer_)
+ if (renderer_) {
renderer_->SetVisible(visible_);
+ SetFullRootLayerDamage();
+ }
}
void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) {
@@ -2161,12 +2159,6 @@ void LayerTreeHostImpl::SendReleaseResourcesRecursive(LayerImpl* current) {
SendReleaseResourcesRecursive(current->children()[i]);
}
-void LayerTreeHostImpl::ClearRenderSurfaces() {
- active_tree_->ClearRenderSurfaces();
- if (pending_tree_)
- pending_tree_->ClearRenderSurfaces();
-}
-
std::string LayerTreeHostImpl::LayerTreeAsJson() const {
std::string str;
if (active_tree_->root_layer()) {
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 7bb59d2..ab6ab46 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -427,7 +427,6 @@ class CC_EXPORT LayerTreeHostImpl
bool CalculateRenderPasses(FrameData* frame);
void SendReleaseResourcesRecursive(LayerImpl* current);
- void ClearRenderSurfaces();
bool EnsureRenderSurfaceLayerList();
void ClearCurrentlyScrollingLayer();
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 3061626..03d0100 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -297,23 +297,6 @@ void LayerTreeImpl::UpdateDrawProperties() {
"CalcDrawProperties should not set_needs_update_draw_properties()";
}
-static void ClearRenderSurfacesOnLayerImplRecursive(LayerImpl* current) {
- DCHECK(current);
- for (size_t i = 0; i < current->children().size(); ++i)
- ClearRenderSurfacesOnLayerImplRecursive(current->children()[i]);
- current->ClearRenderSurface();
-}
-
-void LayerTreeImpl::ClearRenderSurfaces() {
- if (root_layer() == NULL) {
- DCHECK(render_surface_layer_list_.empty());
- return;
- }
- ClearRenderSurfacesOnLayerImplRecursive(root_layer());
- render_surface_layer_list_.clear();
- set_needs_update_draw_properties();
-}
-
const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const {
// If this assert triggers, then the list is dirty.
DCHECK(!needs_update_draw_properties_);
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 2f85f1d..3158e5d 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -149,8 +149,6 @@ class CC_EXPORT LayerTreeImpl {
void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; }
bool needs_full_tree_sync() const { return needs_full_tree_sync_; }
- void ClearRenderSurfaces();
-
const LayerImplList& RenderSurfaceLayerList() const;
// These return the size of the root scrollable area and the size of
@@ -235,6 +233,7 @@ class CC_EXPORT LayerTreeImpl {
ui::LatencyInfo latency_info_;
+ private:
DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
};