Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 271c923387563e1a51c21d2f4f1662d2c3af57b6
      
https://github.com/WebKit/WebKit/commit/271c923387563e1a51c21d2f4f1662d2c3af57b6
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
    M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
    M 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp

  Log Message:
  -----------
  [Damage][Skia] Split the compositing walk into a damage pass and a paint pass
https://bugs.webkit.org/show_bug.cgi?id=319379

Reviewed by Alejandro G. Castro.

The Skia compositor collects the frame damage in the same walk that draws, so 
the
damage is only complete once everything has already been painted. A compositor 
that
paints only what changed has to know the damage before it draws anything.

Split the walk in two: a damage pass walks the tree without drawing, into an
SkNoDrawCanvas, and gathers the frame damage, then a paint pass draws. Both 
passes
run from a single paint(), which first applies the animations and computes the
transforms once, so the two passes see the same tree, and returns whether any
animation is still running. When paint() is given no frame damage it just draws.

PaintContext says which pass is running by whether it carries a frame damage, 
and
the damage-collecting pass skips the work that only exists to composite a group:
the overlap-region splitting in paintWithOpacity() and paintWithBlendMode(), and
the intermediate surfaces, none of which change the rects it collects.

The debug indicators split the same way: the border is a content draw, so it
moves into the content stream where content above hides it and it shares the 
group's
opacity, filter and mask. The repaint counter is a device-space overlay and 
stays
one, drawn after the layer's subtree.

* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paint):
(WebCore::SkiaCompositingLayer::paintSelf):
(WebCore::SkiaCompositingLayer::combinedTransform const):
(WebCore::SkiaCompositingLayer::paintDebugBorder):
(WebCore::SkiaCompositingLayer::paintRepaintCounter):
(WebCore::SkiaCompositingLayer::paintWithIntermediateSurface):
(WebCore::SkiaCompositingLayer::paintWithMaskAndBackdrop):
(WebCore::SkiaCompositingLayer::paintWithFilterAndMask):
(WebCore::SkiaCompositingLayer::recursivePaint):
(WebCore::SkiaCompositingLayer::computeOverlapRegions):
(WebCore::SkiaCompositingLayer::paintWithOpacity):
(WebCore::SkiaCompositingLayer::paintWithBlendMode):
(WebCore::SkiaCompositingLayer::paintDebugIndicators): Deleted.
(WebCore::SkiaCompositingLayer::hasVisualContent const): Deleted.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::paintToSkiaCanvas):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to