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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 285373003: Reland "cc: Remove layers that are not drawn from tile manager." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | cc/resources/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 8a4e30ee8aeed23cd721254522ffaaeb664b46f8..7c14b7ede2d439ae8fd4c1794b912df128dc90ad 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -358,10 +358,34 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
}
void PictureLayerImpl::DidUnregisterLayer() {
+ TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer");
+
layer_needs_to_register_itself_ = true;
+ RemoveAllTilings();
+
+ // If we're on the pending tree, this means we might have an active twin
+ // layer. If we don't require that we sync from the active layer again, we
+ // might go through CalculateDrawProperties again, which will cause us to call
+ // ManageTilings. This, in turn, will create high and low res tilings for this
+ // layer and try to apply the same layer to the active tree. However, the
+ // active tree would already have these tilings, which would cause us to
+ // CHECK. As a workaround, this simply requires that this layer first syncs
+ // the tilings from the active tree before doing ManageTilings.
+ // TODO(vmpstr): This might not be a requirement once
+ // https://codereview.chromium.org/271533011 lands.
+ if (layer_tree_impl()->IsPendingTree()) {
+ if (twin_layer_) {
+ twin_layer_->twin_layer_ = NULL;
+ twin_layer_ = NULL;
+ }
+ needs_post_commit_initialization_ = true;
enne (OOO) 2014/05/15 17:41:32 :( Just wait for https://codereview.chromium.org/
+ }
}
void PictureLayerImpl::UpdateTilePriorities() {
+ TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
+
+ DCHECK(IsDrawnRenderSurfaceLayerListMember());
DCHECK(!needs_post_commit_initialization_);
CHECK(should_update_tile_priorities_);
« no previous file with comments | « no previous file | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698