Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43e301c7583418ae57bba236e08d077d9f6c55b4
      
https://github.com/WebKit/WebKit/commit/43e301c7583418ae57bba236e08d077d9f6c55b4
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-09-25 (Fri, 25 Sep 2026)

  Changed paths:
    A 
LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity-expected.txt
    A LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity.html
    M 
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html
    M Source/WebCore/platform/graphics/Polygon4D.cpp
    M Source/WebCore/platform/graphics/Polygon4D.h
    M 
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp

  Log Message:
  -----------
  [GTK][WPE] Damage is too large for layers with an edge at infinity
https://bugs.webkit.org/show_bug.cgi?id=247042

Reviewed by Fujii Hironori.

When a layer crosses the camera plane, projectedBoundingBox() keeps only the
part in front of the camera. That part has vertices on the camera plane, where
w = 0, which project to infinity. projectedBoundingBox() clamps them to the
clip bounds in both x and y, so the bounding box often ends up much larger
than what the layer paints.

Before clamping, and before dividing by w, clip the polygon against the four
sides of the clip bounds. Each side is just another plane, so the new
Polygon4D::clipToPlane() handles it the same way as the camera plane. The
remaining vertices are finite and inside the clip bounds, so the bounding box
matches what the layer paints.

Covered by two new tests.

Tests: platform/glib/damage/transform-3d-edge-at-infinity.html
       platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html:

* LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity-expected.txt: 
Added.
* LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity.html: Added.
* 
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html:
  Adapt to damage changes: it's narrow now.
* Source/WebCore/platform/graphics/Polygon4D.cpp:
(WebCore::Polygon4D::clipToPlane):
* Source/WebCore/platform/graphics/Polygon4D.h:
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp:
(WebCore::projectedBoundingBox):

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



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

Reply via email to