Index: Source/core/rendering/compositing/RenderLayerCompositor.cpp |
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp |
index 2f51e2187c133b40a6f2b37a06e06a82269c48e9..7a1654745563d3503840cf733652909ba7a30475 100644 |
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp |
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp |
@@ -259,7 +259,12 @@ void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() |
bool isLocalRoot = m_renderView.frame()->isLocalRoot(); |
RenderVideo* video = findFullscreenVideoRenderer(m_renderView.document()); |
- if (!video || !video->layer()->hasCompositedLayerMapping()) { |
+ CompositedLayerMapping* videoCompositedLayerMapping = nullptr; |
+ |
+ if (video) |
+ videoCompositedLayerMapping = video->layer()->compositedLayerMapping(); |
+ |
+ if (!videoCompositedLayerMapping) { |
if (isLocalRoot) { |
GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer(); |
if (backgroundLayer && !backgroundLayer->parent()) |
@@ -268,7 +273,7 @@ void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() |
return; |
} |
- GraphicsLayer* videoLayer = video->layer()->compositedLayerMapping()->mainGraphicsLayer(); |
+ GraphicsLayer* videoLayer = videoCompositedLayerMapping->mainGraphicsLayer(); |
// The fullscreen video has layer position equal to its enclosing frame's scroll position because fullscreen container is fixed-positioned. |
// We should reset layer position here since we are going to reattach the layer at the very top level. |
@@ -410,7 +415,7 @@ bool RenderLayerCompositor::allocateOrClearCompositedLayerMapping(RenderLayer* l |
// requirements fully. |
switch (compositedLayerUpdate) { |
case AllocateOwnCompositedLayerMapping: |
- ASSERT(!layer->hasCompositedLayerMapping()); |
+ ASSERT(!layer->compositedLayerMapping()); |
setCompositingModeEnabled(true); |
// If we need to issue paint invalidations, do so before allocating the compositedLayerMapping and clearing out the groupedMapping. |
@@ -436,15 +441,15 @@ bool RenderLayerCompositor::allocateOrClearCompositedLayerMapping(RenderLayer* l |
case RemoveOwnCompositedLayerMapping: |
// PutInSquashingLayer means you might have to remove the composited layer mapping first. |
case PutInSquashingLayer: |
- if (layer->hasCompositedLayerMapping()) { |
+ if (layer->compositedLayerMapping()) { |
// If we're removing the compositedLayerMapping from a reflection, clear the source GraphicsLayer's pointer to |
// its replica GraphicsLayer. In practice this should never happen because reflectee and reflection |
// are both either composited, or not composited. |
if (layer->isReflection()) { |
RenderLayer* sourceLayer = toRenderLayerModelObject(layer->renderer()->parent())->layer(); |
- if (sourceLayer->hasCompositedLayerMapping()) { |
- ASSERT(sourceLayer->compositedLayerMapping()->mainGraphicsLayer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer()); |
- sourceLayer->compositedLayerMapping()->mainGraphicsLayer()->setReplicatedByLayer(0); |
+ if (CompositedLayerMapping* sourceCompositedLayerMapping = sourceLayer->compositedLayerMapping()) { |
+ ASSERT(sourceCompositedLayerMapping->mainGraphicsLayer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer()); |
+ sourceCompositedLayerMapping->mainGraphicsLayer()->setReplicatedByLayer(0); |
} |
} |
@@ -626,11 +631,10 @@ bool RenderLayerCompositor::parentFrameContentLayers(RenderPart* renderer) |
if (!innerCompositor || !innerCompositor->staleInCompositingMode() || innerCompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame) |
return false; |
- RenderLayer* layer = renderer->layer(); |
- if (!layer->hasCompositedLayerMapping()) |
+ CompositedLayerMapping* compositedLayerMapping = renderer->layer()->compositedLayerMapping(); |
+ if (!compositedLayerMapping) |
return false; |
- CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping(); |
GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); |
GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); |
if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != rootLayer) { |