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

Unified Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 336493004: Removing a RenderLayer's CLM should trigger a repaint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment Created 6 years, 6 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 | « LayoutTests/compositing/squashing/squashed-layer-loses-graphicslayer-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
index 81603f801f981f1f2d05c5322fefc8b5cb3b13c7..6233c5d66ea752ae4e554dce5ac58f73560d6328 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -480,8 +480,19 @@ bool RenderLayerCompositor::updateLayerIfViewportConstrained(RenderLayer* layer)
// See crbug.com/383191 for a list of tests that fail if this method is removed.
void RenderLayerCompositor::applyUpdateLayerCompositingStateChickenEggHacks(RenderLayer* layer, CompositingStateTransitionType compositedLayerUpdate)
{
- if (compositedLayerUpdate != NoCompositingStateChange)
- allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate);
+ if (compositedLayerUpdate != NoCompositingStateChange) {
+ bool compositedLayerMappingChanged = allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate);
+ if (compositedLayerMappingChanged) {
+ // Repaint rects can only be computed for layers that have already been attached to the
+ // render tree, but a chicken-egg compositing update can happen before |layer| gets
+ // attached. Since newly-created renderers don't get parented until they are attached
+ // (see RenderTreeBuilder::createRendererForElementIfNeeded), we can check for attachment
+ // by checking for a parent.
+ if (layer->parent())
+ layer->repainter().computeRepaintRectsIncludingNonCompositingDescendants();
+ repaintOnCompositingChange(layer);
+ }
+ }
}
void RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, UpdateLayerCompositingStateOptions options)
« no previous file with comments | « LayoutTests/compositing/squashing/squashed-layer-loses-graphicslayer-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698