Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| index c070f17b691aaa55202e27bd01b0c065aeb2c101..0e7f4cff92544fb4bd6c322bbb9369d3185b1af8 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -173,6 +173,7 @@ CompositedLayerMapping::CompositedLayerMapping(PaintLayer& layer) |
| , m_isMainFrameLayoutViewLayer(false) |
| , m_backgroundLayerPaintsFixedRootBackground(false) |
| , m_scrollingContentsAreEmpty(false) |
| + , m_backgroundPaintsOntoScrollingContentsLayer(false) |
| { |
| if (layer.isRootLayer() && layoutObject()->frame()->isMainFrame()) |
| m_isMainFrameLayoutViewLayer = true; |
| @@ -293,9 +294,15 @@ void CompositedLayerMapping::updateIsRootForIsolatedGroup() |
| m_graphicsLayer->setIsRootForIsolatedGroup(isolate); |
| } |
| +void CompositedLayerMapping::updateBackgroundPaintingLayer() |
| +{ |
| + bool backgroundLayerPaintsOntoScrollingContentsLayer = shouldPaintBackgroundOntoScrollingContentsLayer(); |
| + if (backgroundLayerPaintsOntoScrollingContentsLayer != m_backgroundPaintsOntoScrollingContentsLayer) |
|
Stephen Chennney
2016/08/22 19:16:04
You never set m_backgroundPaintsOntoScrollingConte
flackr
2016/08/22 19:33:25
Oops, thank you for catching this. I suspect the o
|
| + m_owningLayer.setNeedsRepaint(); |
| +} |
| + |
| void CompositedLayerMapping::updateContentsOpaque() |
| { |
| - ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer); |
| if (isAcceleratedCanvas(layoutObject())) { |
| // Determine whether the rendering context's external texture layer is opaque. |
| CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->node())->renderingContext(); |
| @@ -311,7 +318,7 @@ void CompositedLayerMapping::updateContentsOpaque() |
| } else { |
| // For non-root layers, background is painted by the scrolling contents layer if all backgrounds |
| // are background attachment local, otherwise background is painted by the primary graphics layer. |
| - if (hasScrollingLayer() && shouldPaintBackgroundOntoScrollingContentsLayer()) { |
| + if (hasScrollingLayer() && m_backgroundPaintsOntoScrollingContentsLayer) { |
| // Backgrounds painted onto the foreground are clipped by the padding box rect. |
| // TODO(flackr): This should actually check the entire overflow rect within the |
| // scrolling contents layer but since we currently only trigger this for solid |
| @@ -768,6 +775,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(const PaintLayer* compo |
| updateBackgroundColor(); |
| updateDrawsContent(); |
| updateElementIdAndCompositorMutableProperties(); |
| + updateBackgroundPaintingLayer(); |
| updateContentsOpaque(); |
| updateAfterPartResize(); |
| updateRenderingContext(); |
| @@ -2460,7 +2468,7 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G |
| || graphicsLayer == m_childClippingMaskLayer.get() |
| || graphicsLayer == m_scrollingContentsLayer.get()) { |
| - bool paintRootBackgroundOntoScrollingContentsLayer = shouldPaintBackgroundOntoScrollingContentsLayer(); |
| + bool paintRootBackgroundOntoScrollingContentsLayer = m_backgroundPaintsOntoScrollingContentsLayer; |
| DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || (!m_backgroundLayer && !m_foregroundLayer)); |
| if (paintRootBackgroundOntoScrollingContentsLayer) { |
| if (graphicsLayer == m_scrollingContentsLayer.get()) |