Commit a4986dfd authored by chrishtr@chromium.org's avatar chrishtr@chromium.org

Repaint squashing content in cases where the entire frame is repainting.

In the process, inline RenderLayerRepainter::setBackingNeedsRepaint's one call site
and remove the method.

BUG=384520

Review URL: https://codereview.chromium.org/337793004

git-svn-id: svn://svn.chromium.org/blink/trunk@176150 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e296674a
...@@ -301,8 +301,13 @@ void RenderLayer::updateLayerPositionRecursive(UpdateLayerPositionsFlags flags) ...@@ -301,8 +301,13 @@ void RenderLayer::updateLayerPositionRecursive(UpdateLayerPositionsFlags flags)
for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->updateLayerPositionRecursive(flags); child->updateLayerPositionRecursive(flags);
if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !compositedLayerMapping()->paintsIntoCompositedAncestor()) // FIXME: why isn't FrameView just calling RenderLayerCompositor::repaintCompositedLayers? Does it really impact
// performance?
if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !compositedLayerMapping()->paintsIntoCompositedAncestor()) {
compositedLayerMapping()->setContentsNeedDisplay(); compositedLayerMapping()->setContentsNeedDisplay();
// This code is called when the FrameView wants to repaint the entire frame. This includes squashing content.
compositedLayerMapping()->setSquashingContentsNeedDisplay();
}
} }
void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
......
...@@ -184,14 +184,6 @@ LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants() ...@@ -184,14 +184,6 @@ LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants()
return repaintRect; return repaintRect;
} }
void RenderLayerRepainter::setBackingNeedsRepaint()
{
// There is only one call site, and that call site ensures that the compositing state is PaintsIntoOwnBacking.
ASSERT(m_renderer.compositingState() == PaintsIntoOwnBacking);
m_renderer.compositedLayerMapping()->setContentsNeedDisplay();
}
void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r) void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r)
{ {
// https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
......
...@@ -79,7 +79,6 @@ public: ...@@ -79,7 +79,6 @@ public:
// Indicate that the layer contents need to be repainted. Only has an effect // Indicate that the layer contents need to be repainted. Only has an effect
// if layer compositing is being used, // if layer compositing is being used,
void setBackingNeedsRepaint();
void setBackingNeedsRepaintInRect(const LayoutRect&); // r is in the coordinate space of the layer's render object void setBackingNeedsRepaintInRect(const LayoutRect&); // r is in the coordinate space of the layer's render object
void setFilterBackendNeedsRepaintingInRect(const LayoutRect&); void setFilterBackendNeedsRepaintingInRect(const LayoutRect&);
......
...@@ -1869,6 +1869,11 @@ struct SetContentsNeedsDisplayFunctor { ...@@ -1869,6 +1869,11 @@ struct SetContentsNeedsDisplayFunctor {
} }
}; };
void CompositedLayerMapping::setSquashingContentsNeedDisplay()
{
ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToSquashingLayer);
}
void CompositedLayerMapping::setContentsNeedDisplay() void CompositedLayerMapping::setContentsNeedDisplay()
{ {
// FIXME: need to split out repaints for the background. // FIXME: need to split out repaints for the background.
......
...@@ -143,6 +143,7 @@ public: ...@@ -143,6 +143,7 @@ public:
// a backing store changed. // a backing store changed.
bool updateRequiresOwnBackingStoreForIntrinsicReasons(); bool updateRequiresOwnBackingStoreForIntrinsicReasons();
void setSquashingContentsNeedDisplay();
void setContentsNeedDisplay(); void setContentsNeedDisplay();
// r is in the coordinate space of the layer's render object // r is in the coordinate space of the layer's render object
void setContentsNeedDisplayInRect(const IntRect&); void setContentsNeedDisplayInRect(const IntRect&);
......
...@@ -680,8 +680,12 @@ void RenderLayerCompositor::repaintCompositedLayers() ...@@ -680,8 +680,12 @@ void RenderLayerCompositor::repaintCompositedLayers()
void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer) void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer)
{ {
// FIXME: This method does not work correctly with transforms. // FIXME: This method does not work correctly with transforms.
if (layer->compositingState() == PaintsIntoOwnBacking) if (layer->compositingState() == PaintsIntoOwnBacking) {
layer->repainter().setBackingNeedsRepaint(); layer->compositedLayerMapping()->setContentsNeedDisplay();
// This function is called only when it is desired to repaint the entire compositing graphics layer tree.
// This includes squashing.
layer->compositedLayerMapping()->setSquashingContentsNeedDisplay();
}
layer->stackingNode()->updateLayerListsIfNeeded(); layer->stackingNode()->updateLayerListsIfNeeded();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment