Ignore:
Timestamp:
May 26, 2022, 3:22:08 PM (3 years ago)
Author:
Alan Bujtas
Message:

Do not issue repaint when the ancestor layer has already been scheduled for one
https://bugs.webkit.org/show_bug.cgi?id=240728

Reviewed by Simon Fraser.

When a renderer needs repaint, we walk the layer tree to search for the repaint container (root for all the paints).
If we find a layer between the renderer and the repaint container that has already been scheduled for a full repaint
we know that this repaint is redundant and will be covered by the ancestor layer.
Since layers paint their overflow content, this works even when the renderer "sticks out" of the ancestor layer's renderer's border box (i.e. produces ink/scrollable overflow).

  • Source/WebCore/rendering/RenderLayer.cpp:

(WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
(WebCore::RenderLayer::clipCrossesPaintingBoundary const):
(WebCore::RenderLayer::calculateClipRects const):

  • Source/WebCore/rendering/RenderLayer.h:

(WebCore::RenderLayer::needsFullRepaint const):

  • Source/WebCore/rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::repaintInCompositedAncestor):

  • Source/WebCore/rendering/RenderObject.cpp:

(WebCore::RenderObject::containerForRepaint const):
(WebCore::fullRepaintIsScheduled): This covers the cases when the content is embedded inside an iframe and the iframe's view is not composited.
(WebCore::RenderObject::repaint const):
(WebCore::RenderObject::repaintRectangle const):

  • Source/WebCore/rendering/RenderView.cpp:

(WebCore::RenderView::paintBoxDecorations):

Canonical link: https://commits.webkit.org/251025@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r294699 r294902  
    381381        }
    382382
    383         if (RenderLayer* compositingLayer = layer->enclosingCompositingLayerForRepaint()) {
     383        if (auto* compositingLayer = layer->enclosingCompositingLayerForRepaint().layer) {
    384384            if (!compositingLayer->backing()->paintsIntoWindow()) {
    385385                frameView().setCannotBlitToWindow();
Note: See TracChangeset for help on using the changeset viewer.