Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f72b3d7740d588f216e4fc2e746e963931f0d93
      
https://github.com/WebKit/WebKit/commit/2f72b3d7740d588f216e4fc2e746e963931f0d93
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-09 (Sun, 09 Aug 2026)

  Changed paths:
    M 
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.cpp
    M Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.h
    M Source/WebCore/platform/graphics/skia/SkiaDamageRegion.h

  Log Message:
  -----------
  [Skia] Skip damage restriction when the damage covers the whole draw
https://bugs.webkit.org/show_bug.cgi?id=321377

Reviewed by Alejandro G. Castro.

Respecting the damage information in compositing regressed the MotionMark
composition suite by about 20%, and two of its tests by more than 50%.

A draw is restricted to the damage either by splitting it into multiple
source-rect-to-destination-rect pieces, which needs a transform that keeps
rects as rects, or by drawing it under a device-space clip of the damage
region. Neither restricts a draw that the damage already covers. A composited
layer in the affected tests is much smaller than a damage grid cell, so most
layers are covered. Draw those the way they are drawn with damage off.
The extra clips add nothing and only stop the batching.

Skia turned a region of more than one rect into a clip path, and the image set
batch entries carry no clip quad, so a draw needing a clip also flushed the
batch, leaving it an order of magnitude smaller than it is without damage.
Solid color layers never reach the batch and paid the clip alone, and filters
paid it again per layer, compositing their intermediate surface back under
the clip as well.

Fix that and recover the performance losses, while keeping damage
propagation intact for the cases where it pays off.

* Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.cpp:
(WebCore::SkiaCompositingLayerImageSetBatch::addImageSet):
(WebCore::SkiaCompositingLayerImageSetBatch::addImage):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.h:
(WebCore::SkiaCompositingLayerImageSetBatch::planRestrictedDraw):
* Source/WebCore/platform/graphics/skia/SkiaDamageRegion.h:
(WebCore::SkiaDamageRegion::covers const):
(WebCore::SkiaDamageRegion::restrictDraw const):

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



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

Reply via email to