Chromium Code Reviews| Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp |
| diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
| index 3f3eeb5bc620195b3bcd7e04d5f38dbf2058e7f6..a00b8dc0649adc7f2167d35fcb253deb51677518 100644 |
| --- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
| +++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
| @@ -176,6 +176,7 @@ CompositedLayerMapping::CompositedLayerMapping(RenderLayer& layer) |
| , m_backgroundLayerPaintsFixedRootBackground(false) |
| , m_needToUpdateGraphicsLayer(false) |
| , m_needToUpdateGraphicsLayerOfAllDecendants(false) |
| + , m_scrollingContentsAreEmpty(false) |
| { |
| if (layer.isRootLayer() && renderer()->frame()->isMainFrame()) |
| m_isMainFrameRenderViewLayer = true; |
| @@ -1051,6 +1052,20 @@ void CompositedLayerMapping::updateContentsRect() |
| m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); |
| } |
| +void CompositedLayerMapping::updateScrollingContentsForSelectionGaps(const IntRect& blockSelectionGapsBounds) |
| +{ |
| + if (!m_scrollingContentsAreEmpty || !m_scrollingContentsLayer) |
| + return; |
| + |
| + if (blockSelectionGapsBounds.isEmpty()) { |
| + m_scrollingContentsLayer->setDrawsContent(false); |
| + return; |
| + } |
| + |
| + m_scrollingContentsLayer->setDrawsContent(true); |
| + m_scrollingContentsLayer->setContentsRect(IntRect()); |
|
Ian Vollick
2014/06/03 17:11:47
It's weird that you can pass the empty rect. Can y
hartmanng
2014/06/04 15:32:32
It turns out that the contents rect isn't being us
hartmanng
2014/06/05 15:59:37
Done (in patch set 7).
|
| +} |
| + |
| void CompositedLayerMapping::updateDrawsContent() |
| { |
| if (m_scrollingLayer) { |
| @@ -1062,7 +1077,13 @@ void CompositedLayerMapping::updateDrawsContent() |
| m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); |
| bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer()->hasBackground() || paintsChildren()); |
| - m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent); |
| + m_scrollingContentsAreEmpty = !hasScrollingPaintedContent; |
| + |
| + IntRect gapRect = owningLayer().blockSelectionGapsBounds(); |
| + bool shouldDrawContent = !m_scrollingContentsAreEmpty || !gapRect.isEmpty(); |
| + m_scrollingContentsLayer->setDrawsContent(shouldDrawContent); |
| + if (shouldDrawContent && m_scrollingContentsAreEmpty) |
| + m_scrollingContentsLayer->setContentsRect(IntRect()); |
| return; |
| } |