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_); |