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)
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
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();
// This code is called when the FrameView wants to repaint the entire frame. This includes squashing content.
compositedLayerMapping()->setSquashingContentsNeedDisplay();
}
}
void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
......
......@@ -184,14 +184,6 @@ LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants()
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)
{
// https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
......
......@@ -79,7 +79,6 @@ public:
// Indicate that the layer contents need to be repainted. Only has an effect
// 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 setFilterBackendNeedsRepaintingInRect(const LayoutRect&);
......
......@@ -1869,6 +1869,11 @@ struct SetContentsNeedsDisplayFunctor {
}
};
void CompositedLayerMapping::setSquashingContentsNeedDisplay()
{
ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToSquashingLayer);
}
void CompositedLayerMapping::setContentsNeedDisplay()
{
// FIXME: need to split out repaints for the background.
......
......@@ -143,6 +143,7 @@ public:
// a backing store changed.
bool updateRequiresOwnBackingStoreForIntrinsicReasons();
void setSquashingContentsNeedDisplay();
void setContentsNeedDisplay();
// r is in the coordinate space of the layer's render object
void setContentsNeedDisplayInRect(const IntRect&);
......
......@@ -680,8 +680,12 @@ void RenderLayerCompositor::repaintCompositedLayers()
void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer)
{
// FIXME: This method does not work correctly with transforms.
if (layer->compositingState() == PaintsIntoOwnBacking)
layer->repainter().setBackingNeedsRepaint();
if (layer->compositingState() == PaintsIntoOwnBacking) {
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();
......
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