Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 468c14f008da618ba57333f026cdc8308cf5267e
https://github.com/WebKit/WebKit/commit/468c14f008da618ba57333f026cdc8308cf5267e
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 LayoutTests/platform/ios/TestExpectations
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
Log Message:
-----------
[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
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications