Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 12fc548e87879a183158907d00955dd1b4957941
https://github.com/WebKit/WebKit/commit/12fc548e87879a183158907d00955dd1b4957941
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M LayoutTests/platform/glib/damage/transform-3d-rotate-3-axes.html
A
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-expected.txt
A
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted-expected.txt
A
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html
A
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane.html
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp
Log Message:
-----------
[GTK][WPE] Damage is too small for layers that extend behind the camera
https://bugs.webkit.org/show_bug.cgi?id=324748
Reviewed by Carlos Garcia Campos.
Before painting a frame we collect the damage, the part of the frame that has
changed, so that only that part has to be re-composited. Each layer has a rect
in its own coordinates that bounds what it paints, and we map that rect through
the layer transform to find the area it covers in the frame.
We used mapRect() for this, which maps the four corners of the rect and returns
the smallest rect that encloses them. Under a perspective the transform maps a
corner to x/y coordinates and a depth value w (measured from the camera, > 0
for a corner in front of the camera). The position in the frame coordinate
space is then x/y and y/w.
Part of a layer can end up _behind_ the camera, e.g. an element under
rotateX(90deg) that is large enough for one end to be deep in the scene while
the other is behid the camera. The corners behind the camera have a negative
depth and no position on the frame at all, and dividing by that negative number
w incorrectly puts them on the opposite side of the frame. The rect around the
four corners then covers less than the area the layer really paints, thus
damaging related rendering artifacts appear on screen.
The fix is to stop using mapRect() but instead switch to projectedBoundingBox(),
which removes what lies behind the camera before mapping.
Tests: platform/glib/damage/transform-3d-rotate-across-camera-plane.html
platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html
* LayoutTests/platform/glib/damage/transform-3d-rotate-3-axes.html:
Update expectations.
*
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-expected.txt:
Added.
*
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted-expected.txt:
Added.
*
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane-tilted.html:
Added.
*
LayoutTests/platform/glib/damage/transform-3d-rotate-across-camera-plane.html:
Added.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::collectFrameDamage):
(WebCore::SkiaCompositingLayer::collectBackdropDamage):
(WebCore::SkiaCompositingLayer::addGroupDamage):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp:
(WebCore::projectedBoundingBox):
Canonical link: https://commits.webkit.org/321578@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications