Branch: refs/heads/webkitglib/2.54
Home: https://github.com/WebKit/WebKit
Commit: e2f4f85fbd144ba450917bd111ee237c617bac06
https://github.com/WebKit/WebKit/commit/e2f4f85fbd144ba450917bd111ee237c617bac06
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
A LayoutTests/platform/glib/damage/animations-drop-shadow-color-expected.txt
A LayoutTests/platform/glib/damage/animations-drop-shadow-color.html
A
LayoutTests/platform/glib/damage/layer-blur-filter-child-change-expected.txt
A LayoutTests/platform/glib/damage/layer-blur-filter-child-change.html
A LayoutTests/platform/glib/damage/layer-blur-filter-expected.txt
A LayoutTests/platform/glib/damage/layer-blur-filter.html
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
Log Message:
-----------
Cherry-pick 320622@main (23f1d29063a8).
https://bugs.webkit.org/show_bug.cgi?id=322563
SkiaCompositingLayer: layers with filters are always damaged
https://bugs.webkit.org/show_bug.cgi?id=322563
Reviewed by Carlos Garcia Campos.
SkiaCompositingLayer::paintWithFilterAndMask added damage in every frame,
even
when nothing in the filtered subtree had changed. Only add damage if any
descendant of the subtree was damaged, and compute the overlap region only
in
that case - instead of in every collecting walk.
If the filter of a static layer changes, its indicated by setFilters(),
which marks the group as changed: collectGroupDamage() is then able to
pick up the change. Animated filters are applied on the compositor side
by syncAnimations(), which added no damage at all, so add damage there
when the applied filter changes. This also handles the end of an animation,
where the value goes back to the pre-animation state of the layer.
Tests: platform/glib/damage/animations-drop-shadow-color.html
platform/glib/damage/layer-blur-filter.html
platform/glib/damage/layer-blur-filter-child-change.html
*
LayoutTests/platform/glib/damage/animations-drop-shadow-color-expected.txt:
Added.
* LayoutTests/platform/glib/damage/animations-drop-shadow-color.html: Added.
*
LayoutTests/platform/glib/damage/layer-blur-filter-child-change-expected.txt:
Added.
* LayoutTests/platform/glib/damage/layer-blur-filter-child-change.html:
Added.
* LayoutTests/platform/glib/damage/layer-blur-filter-expected.txt: Added.
* LayoutTests/platform/glib/damage/layer-blur-filter.html: Added.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::expandByOutsets):
(WebCore::SkiaCompositingLayer::unclippedFilterOutsets const):
(WebCore::SkiaCompositingLayer::paintedLayerRect const):
(WebCore::SkiaCompositingLayer::syncAnimations):
(WebCore::SkiaCompositingLayer::hasGroupPropertyDamage const):
(WebCore::SkiaCompositingLayer::hasDamageInSubtree const):
(WebCore::SkiaCompositingLayer::collectGroupDamage):
(WebCore::SkiaCompositingLayer::paintWithFilterAndMask):
(WebCore::SkiaCompositingLayer::computeOverlapRegions):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
Canonical link: https://commits.webkit.org/320622@main
Canonical link: https://commits.webkit.org/317695.360@webkitglib/2.54
Commit: 32661519b3dcdc11323bf89c286ac90128a9978f
https://github.com/WebKit/WebKit/commit/32661519b3dcdc11323bf89c286ac90128a9978f
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale.html
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.h
Log Message:
-----------
Cherry-pick 321515@main (891d1c8d9a92).
https://bugs.webkit.org/show_bug.cgi?id=323693
[GTK][WPE] Fix SkiaCompositingLayer filter rendering under transforms
https://bugs.webkit.org/show_bug.cgi?id=323693
Reviewed by Fujii Hironori.
On GTK and WPE an element with both a filter and a transform is drawn
wrongly:
drop-shadow always falls in the same direction on screen instead of turning
with
the element, blur is scaled neither by the transform nor by the device scale
factor, and perspective is not handled at all. The same applies to
backdrop-filter.
Such a layer was painted into an offscreen surface with the transform
already
applied on the canvas, and the filter was applied while drawing that surface
back with no transform on the canvas, so Skia had nothing to map the filter
parameters through.
Paint the subtree with the layer transform on the canvas instead, into a
surface
in the layer plane at a fixed scale (the 2D scale of the layer transform,
or of
the nearest ancestor without a perspective), apply the filter there and
draw the
result with the layer transform, as Chromium does. SkCanvas::saveLayer()
would
instead pick the resolution at the center of the bounds, which under a
perspective can be far off the resolution anywhere else.
Mapping a device point back into a tilted layer plane can land arbitrarily
far
away, and the points that do not land on the plane at all form the horizon
of
the plane on screen. Map only the part of the device clip that stays one
device
pixel away from the horizon, which keeps the bounds of the subtree finite.
The overlap region code can no longer treat layer space and device space as
the
same modulo a translation now that a filtered subtree is painted with a
transform on the canvas - adapt it.
The new WPT tests cover filters under 2D transforms and perspective,
backdrop-filter under a transform, 3D children behind, spanning or crossing
the
eye plane, filtered layers inside 3D transformed or 3D filtered ancestors,
and
layer planes with zero area. They include the cases reported by Fujii
Hironori
and Jani Hautakangas in the ticket.
filter-in-3d-transformed-ancestor-child-near-eye-plane.html needs the
clampedBoundsOfProjectedQuad() fix from webkit.org/b/324623 as well, so it
is
marked ImageOnlyFailure on GTK/WPE until that one lands.
Now passing on GTK/WPE:
- css/css-transforms/transform3d-rotatex-perspective-003.html
- css/filter-effects: backdrop-filter-edge-behavior.html,
drop-shadow-currentcolor-dynamic-003.html
Tests:
imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap.html
imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform.html
imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer.html
imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop.html
imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane.html
imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor.html
imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane.html
imported/w3c/web-platform-tests/css/filter-effects/invert-scale.html
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-on-transformed-layer.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-rotation.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective-scale.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-perspective.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-scale.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-in-opacity-overlap.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/drop-shadow-transform.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-behind-eye-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-in-3d-filtered-layer.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-child-spanning-eye-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-3d-children-crossing-eye-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-backdrop.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-degenerate-layer-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-crossing-eye-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-child-near-eye-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-in-3d-transformed-ancestor.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filter-unbounded-child-in-layer-plane.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/invert-scale.html:
Added.
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintedLayerRect const):
(WebCore::SkiaCompositingLayer::collectFrameDamage):
(WebCore::SkiaCompositingLayer::collectBackdropDamage):
(WebCore::SkiaCompositingLayer::addGroupDamage):
(WebCore::SkiaCompositingLayer::stopPaintingIntoBackdropIfNeeded):
(WebCore::SkiaCompositingLayer::paintSelfAndChildren):
(WebCore::clipRectIgnoringCanvasMatrix):
(WebCore::SkiaCompositingLayer::paintWithIntermediateSurface):
(WebCore::inverseLayerPlaneTransform):
(WebCore::SkiaCompositingLayer::paintBackdrop):
(WebCore::maxFilterSurfaceSize):
(WebCore::SkiaCompositingLayer::paintWithFilter):
(WebCore::transform2DScaleComponents):
(WebCore::SkiaCompositingLayer::filterSurfaceScale const):
(WebCore::SkiaCompositingLayer::paintWithFilterAndMask):
(WebCore::SkiaCompositingLayer::computeConsolidatedOverlapRegionRects):
(WebCore::SkiaCompositingLayer::computeOverlapRegions):
(WebCore::SkiaCompositingLayer::paintWithOpacity):
(WebCore::SkiaCompositingLayer::paintWithBlendMode):
(WebCore::expandByOutsets): Deleted.
(WebCore::SkiaCompositingLayer::clipBounds const): Deleted.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp:
(WebCore::projectedBoundingBox):
(WebCore::layerPlaneClipBounds):
(WebCore::ComputeOverlapRegionData::transformedBoundingBox const): Deleted.
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.h:
Canonical link: https://commits.webkit.org/321515@main
Canonical link: https://commits.webkit.org/317695.361@webkitglib/2.54
Commit: 532543ed2201b5658a65e658904b40b543f10a20
https://github.com/WebKit/WebKit/commit/532543ed2201b5658a65e658904b40b543f10a20
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 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:
-----------
Cherry-pick 321578@main (12fc548e8787).
https://bugs.webkit.org/show_bug.cgi?id=324748
[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
Canonical link: https://commits.webkit.org/317695.362@webkitglib/2.54
Commit: 1e83cd6518b203413815db233cebef3332ad7cb6
https://github.com/WebKit/WebKit/commit/1e83cd6518b203413815db233cebef3332ad7cb6
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
A
LayoutTests/transforms/3d/general/preserve-3d-intersecting-planes-across-camera-plane-expected.html
A
LayoutTests/transforms/3d/general/preserve-3d-intersecting-planes-across-camera-plane.html
A
LayoutTests/transforms/3d/general/preserve-3d-plane-across-camera-plane-expected.html
A
LayoutTests/transforms/3d/general/preserve-3d-plane-across-camera-plane.html
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
A Source/WebCore/platform/graphics/Polygon4D.cpp
A Source/WebCore/platform/graphics/Polygon4D.h
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayer3DRenderingContext.cpp
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayer3DRenderingContext.h
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp
Log Message:
-----------
Cherry-pick 321875@main (5c9058b92f41).
https://bugs.webkit.org/show_bug.cgi?id=324944
[GTK][WPE] preserve-3d layers are painted in the wrong order when a layer
crosses the camera plane
https://bugs.webkit.org/show_bug.cgi?id=324944
Reviewed by Fujii Hironori.
To paint a preserve-3d scene, we sort its layers from back to front in a BSP
tree, which splits layers, where they intersect. We map the corners of a
layer through its perspective transform, yielding x, y, z and w. w is the
distance of the corner in front of the camera, scaled by the perspective.
Dividing x, y and z by w then results in the position on the screen.
However,
a corner behind the camera has a negative w, so the division flips it to the
other side of the screen, far away. The polygon built from such corners no
longer matches the layer/reality: it covers the wrong part of the screen and
thus lies in the wrong plane. The BSP tree then splits and orders layers
against that wrong polygon, and far layers get painted over near ones.
This is the root cause that's breaking
https://keithclark.co.uk/labs/css-fps/.
321515@main fixed the same kind of problem for filters, where mapping points
of a plane that reaches behind the camera also went wrong.
To fix it for the preserve-3d scenes, introduce a new Polygon4D class,
separate from FloatPolygon3D, which TextureMapper keeps using, as we only
want to change the Skia-based compositor and keep TextureMapper as it was.
Polygon4D keeps the mapped corner x/y/z positions as they are (no w
division!)
and clips away the part of the layer that lies behind the camera, where w<0.
Layers that are fully behind the camera are then dropped. Sorting and
splitting
now work on these polygons, instead of on corners that were divided by w.
Classifying and splitting now share the same distance tolerance.
We can now also refactor projectedBoundingBox() to use the very same logic,
instead of handling each possible number of corners behind the camera
separately, which greatly simplifies the code.
Tests:
transforms/3d/general/preserve-3d-intersecting-planes-across-camera-plane.html
transforms/3d/general/preserve-3d-plane-across-camera-plane.html
*
LayoutTests/transforms/3d/general/preserve-3d-intersecting-planes-across-camera-plane-expected.html:
Added.
*
LayoutTests/transforms/3d/general/preserve-3d-intersecting-planes-across-camera-plane.html:
Added.
*
LayoutTests/transforms/3d/general/preserve-3d-plane-across-camera-plane-expected.html:
Added.
*
LayoutTests/transforms/3d/general/preserve-3d-plane-across-camera-plane.html:
Added.
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/platform/graphics/Polygon4D.cpp: Added.
(WebCore::splitPolygon):
(WebCore::Polygon4D::clipToFrontOfCamera):
(WebCore::Polygon4D::Polygon4D):
(WebCore::Polygon4D::split const):
* Source/WebCore/platform/graphics/Polygon4D.h: Added.
(WebCore::operator+):
(WebCore::operator-):
(WebCore::operator*):
(WebCore::operator/):
(WebCore::signedDistanceToPlane):
(WebCore::Polygon4D::numberOfVertices const):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::geometryFor3DRenderingContext const):
(WebCore::SkiaCompositingLayer::collect3DRenderingContextLayers):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayer3DRenderingContext.cpp:
(WebCore::projectPolygonToZYPlane):
(WebCore::projectPolygonOnAxis):
(WebCore::polygonsIntersect):
(WebCore::SkiaCompositingLayer3DRenderingContext::paint):
(WebCore::SkiaCompositingLayer3DRenderingContext::computeBoundingBox):
(WebCore::SkiaCompositingLayer3DRenderingContext::buildTree):
(WebCore::SkiaCompositingLayer3DRenderingContext::traverseTree):
(WebCore::SkiaCompositingLayer3DRenderingContext::classifyLayer):
(WebCore::projectQuadOnAxis): Deleted.
(WebCore::quadsIntersect): Deleted.
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayer3DRenderingContext.h:
(WebCore::SkiaCompositingLayer3DRenderingContext::Layer::Layer):
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp:
(WebCore::projectedBoundingBox):
(WebCore::operator+): Deleted.
(WebCore::operator-): Deleted.
(WebCore::operator*): Deleted.
Canonical link: https://commits.webkit.org/321875@main
Canonical link: https://commits.webkit.org/317695.363@webkitglib/2.54
Commit: cc71717027b975987d15cb5506f22d42d83a391b
https://github.com/WebKit/WebKit/commit/cc71717027b975987d15cb5506f22d42d83a391b
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 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:
-----------
Cherry-pick 321905@main (43e301c75834).
https://bugs.webkit.org/show_bug.cgi?id=247042
[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
Canonical link: https://commits.webkit.org/317695.364@webkitglib/2.54
Commit: d2b14950ff4d7cb2d12aad034543082b6f37d772
https://github.com/WebKit/WebKit/commit/d2b14950ff4d7cb2d12aad034543082b6f37d772
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap.html
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
Log Message:
-----------
Cherry-pick 321709@main (67eb0d13a0dd).
https://bugs.webkit.org/show_bug.cgi?id=324961
[GTK][WPE] Thin line of the opposite edge painted along scaled or
transformed no-repeat background images
https://bugs.webkit.org/show_bug.cgi?id=324961
Reviewed by Carlos Garcia Campos.
Composited background images were always drawn with a repeating shader, even
when the image does _not_ repeat. Whenever such an image is filtered, e.g.
under a scale or a fractional translation, sampling past its edge picks up
the opposite edge, painting a thin line of it along the border. The fix is
to only repeat tiles that actually repeat and clamp the rest.
This fixes the yellow line artifact above the gun in the CSS FPS example.
Added a new WPT test to cover this issue.
Test:
imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-image-no-repeat-does-not-wrap.html:
Added.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintContents):
Canonical link: https://commits.webkit.org/321709@main
Canonical link: https://commits.webkit.org/317695.365@webkitglib/2.54
Commit: 58ca03301e16c442ab2054cea351bf5b78772c77
https://github.com/WebKit/WebKit/commit/58ca03301e16c442ab2054cea351bf5b78772c77
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity.html
A
LayoutTests/platform/glib/damage/transform-scale-crossing-clip-edge-expected.txt
A LayoutTests/platform/glib/damage/transform-scale-crossing-clip-edge.html
A
LayoutTests/platform/glib/damage/transform-skew-corner-just-inside-clip-edge-expected.txt
A
LayoutTests/platform/glib/damage/transform-skew-corner-just-inside-clip-edge.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:
-----------
Cherry-pick 322042@main (8c5ed5fa2b4e).
https://bugs.webkit.org/show_bug.cgi?id=325380
[GTK][WPE] Simplify clipping in projectedBoundingBox()
https://bugs.webkit.org/show_bug.cgi?id=325380
Reviewed by Fujii Hironori.
Follow-up to 321905@main, which clips a layer against the camera plane and
then against the four sides of the clip bounds, seperately. Merge the
steps so that Polygon4D::clipToFrontOfCamera() does both in one go,
rendering
Polygon4D::clipToPlane() unncessary.
While at it, fix two small errors in the clipping procedure: The sides now
use
no tolerance, because with it a thin visible part of the layer next to a
side
could be dropped (transform-skew-corner-just-inside-clip-edge.html). Also,
coordinates that both ends of an edge share are now copied instead of
interpolated, so axis-aligned layers no longer grow by a pixel from rounding
(transform-scale-crossing-clip-edge.html).
Tests: platform/glib/damage/transform-scale-crossing-clip-edge.html
platform/glib/damage/transform-skew-corner-just-inside-clip-edge.html
* LayoutTests/platform/glib/damage/transform-3d-edge-at-infinity.html:
Fix comment.
*
LayoutTests/platform/glib/damage/transform-scale-crossing-clip-edge-expected.txt:
Added.
* LayoutTests/platform/glib/damage/transform-scale-crossing-clip-edge.html:
Added.
*
LayoutTests/platform/glib/damage/transform-skew-corner-just-inside-clip-edge-expected.txt:
Added.
*
LayoutTests/platform/glib/damage/transform-skew-corner-just-inside-clip-edge.html:
Added.
* Source/WebCore/platform/graphics/Polygon4D.cpp:
(WebCore::splitPolygon):
(WebCore::Polygon4D::clipToFrontOfCamera):
(WebCore::Polygon4D::clipToPlane): Deleted.
* Source/WebCore/platform/graphics/Polygon4D.h:
(WebCore::Polygon4D::clipToFrontOfCamera):
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerOverlapRegions.cpp:
(WebCore::projectedBoundingBox):
Canonical link: https://commits.webkit.org/322042@main
Canonical link: https://commits.webkit.org/317695.366@webkitglib/2.54
Commit: 23666af38314da15c126fc9c456088c9b96d9ff5
https://github.com/WebKit/WebKit/commit/23666af38314da15c126fc9c456088c9b96d9ff5
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
A
LayoutTests/compositing/filters/filter-fractional-translation-expected.html
A
LayoutTests/compositing/filters/filter-fractional-translation-flipped-expected.html
A LayoutTests/compositing/filters/filter-fractional-translation-flipped.html
A
LayoutTests/compositing/filters/filter-fractional-translation-perspective-expected.html
A
LayoutTests/compositing/filters/filter-fractional-translation-perspective.html
A
LayoutTests/compositing/filters/filter-fractional-translation-rotate-y-expected.html
A
LayoutTests/compositing/filters/filter-fractional-translation-rotate-y.html
A LayoutTests/compositing/filters/filter-fractional-translation.html
A
LayoutTests/css3/filters/backdrop/backdrop-filter-fractional-translation-edge-expected.html
A
LayoutTests/css3/filters/backdrop/backdrop-filter-fractional-translation-edge.html
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
Log Message:
-----------
Cherry-pick 322050@main (468c14f008da).
https://bugs.webkit.org/show_bug.cgi?id=325197
[GTK][WPE] Align the filter surface with the device pixel grid
https://bugs.webkit.org/show_bug.cgi?id=325197
Reviewed by Carlos Garcia Campos.
paintWithFilter() paints the subtree into an intermediate surface in the
local
coordinates of the layer and applies the filter to that surface. The
filtered
image is then drawn onto the target surface with the transform that maps the
local coordinates of the layer to the target surface. If the layer ends up
at
a fractional device position, this transform re-samples the image. The
outermost rows and columns of pixels of the filtered layer, which the layer
only partly covers, then get different colors than without a filter.
If the layer is only scaled and translated on the device, paint the subtree
into the surface with its device transform instead, shifted by a whole
number
of pixels to the origin of the surface. The surface pixels then align with
the
device pixels, avoiding resampling.
This is not done for backdrop filters, which keep the surface in the local
coordinates of the layer. Per spec, a backdrop blur mirrors the image at the
border box, and an aligned surface could include pixels from outside it:
https://drafts.csswg.org/filter-effects-2/#BackdropFilterProperty
Tests: compositing/filters/filter-fractional-translation-flipped.html
compositing/filters/filter-fractional-translation-perspective.html
compositing/filters/filter-fractional-translation-rotate-y.html
compositing/filters/filter-fractional-translation.html
css3/filters/backdrop/backdrop-filter-fractional-translation-edge.html
*
LayoutTests/compositing/filters/filter-fractional-translation-expected.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-flipped-expected.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-flipped.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-perspective-expected.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-perspective.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-rotate-y-expected.html:
Added.
*
LayoutTests/compositing/filters/filter-fractional-translation-rotate-y.html:
Added.
* LayoutTests/compositing/filters/filter-fractional-translation.html: Added.
*
LayoutTests/css3/filters/backdrop/backdrop-filter-fractional-translation-edge-expected.html:
Added.
*
LayoutTests/css3/filters/backdrop/backdrop-filter-fractional-translation-edge.html:
Added.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintBackdrop):
(WebCore::computeDeviceAlignedSurfaceTransform):
(WebCore::SkiaCompositingLayer::paintWithFilter):
(WebCore::SkiaCompositingLayer::paintWithFilterAndMask):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
Canonical link: https://commits.webkit.org/322050@main
Canonical link: https://commits.webkit.org/317695.367@webkitglib/2.54
Compare: https://github.com/WebKit/WebKit/compare/91086f81084b...23666af38314
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications