Branch: refs/heads/webkitglib/2.54
Home: https://github.com/WebKit/WebKit
Commit: fead9841406b8bf1fd40a0c10717ede6baee6098
https://github.com/WebKit/WebKit/commit/fead9841406b8bf1fd40a0c10717ede6baee6098
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-09-07 (Mon, 07 Sep 2026)
Changed paths:
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/platform/graphics/skia/SkiaBackingStore.cpp
M Source/WebCore/platform/graphics/skia/SkiaBackingStore.h
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.h
M Source/WebCore/platform/graphics/skia/SkiaUtilities.h
Log Message:
-----------
Cherry-pick 320490@main (f42e74f7147c).
https://bugs.webkit.org/show_bug.cgi?id=323260
[GTK][WPE] Skia compositor: backing store tiles ignore the layer transform
when picking sampling options
https://bugs.webkit.org/show_bug.cgi?id=323260
Reviewed by Carlos Garcia Campos.
Layer tiles are always drawn with SkFilterMode::kNearest. That is fine as
long as
each pixel of the tile ends up on exactly one screen pixel, at the same
size and
without any rotation. Once the layer is shifted by a fraction of a pixel,
every
screen pixel still takes its color from a single source pixel, rather than
from a
mix of the two it now falls inbetween. Edges lose their smoothness and
visibly
"snap" from one pixel to the next. TextureMapper does not have this problem,
because its GL path always uses GL_LINEAR.
The fix is to choose nearest or linear for each draw, depending on whether
the
transform still maps tile pixels 1:1 onto screen pixels. Layers whose
content
is a single image, already performed this test before they are drawn, so
move
that functionality into a shared place and use it for backing store tiles
as well.
Audit all other places that hardcoded linear vs. nearest and fast vs
strict srcRect constraint.
imported/w3c/web-platform-tests/css/css-animations/transform-animation-under-large-scale.html
loses its glib specific [ Pass ] override and falls back to the generic
ImageOnlyFailure of
webkit.org/b/225407. The test scales a layer by 100 without re-rasterizing
its contents at
that scale, since GraphicsLayerCoordinated keeps the root relative scale
factor updates
turned off. Nearest sampling replicated each of the two content rows into a
sharp block,
which happened to match the reference. Linear sampling blurs the magnified
tile, the same
result all other ports produce.
Linear sampling reaches past the source rect, which only matters for a tile
whose
texture is padded past its logical size (super-tiled textures) - keep
that into account when deciding which sampling strategy to use.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/platform/graphics/skia/SkiaBackingStore.cpp:
(WebCore::SkiaBackingStore::processPendingTileUpdates):
(WebCore::SkiaBackingStore::samplingOptionsForMatrix const):
(WebCore::SkiaBackingStore::paintToCanvas):
(WebCore::SkiaBackingStore::Tile::isPadded const):
* Source/WebCore/platform/graphics/skia/SkiaBackingStore.h:
(WebCore::SkiaBackingStore::requiresStrictSourceConstraint const):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintContents):
(WebCore::SkiaCompositingLayer::paintWithIntermediateSurface):
(WebCore::SkiaCompositingLayer::paintWithMaskAndBackdrop):
*
Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.cpp:
(WebCore::SkiaCompositingLayerImageSetBatch::samplingOptionsForImage const):
(WebCore::SkiaCompositingLayerImageSetBatch::samplingOptionsForBackingStore
const):
(WebCore::SkiaCompositingLayerImageSetBatch::addImageSet):
(WebCore::SkiaCompositingLayerImageSetBatch::addImage):
(WebCore::SkiaCompositingLayerImageSetBatch::imageRequiresLinearSampling
const): Deleted.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayerImageSetBatch.h:
(WebCore::SkiaCompositingLayerImageSetBatch::planRestrictedDraw):
(WebCore::SkiaCompositingLayerImageSetBatch::drawOutsideBatch):
* Source/WebCore/platform/graphics/skia/SkiaUtilities.h:
(WebCore::SkiaUtilities::samplingOptionsForMatrix):
(WebCore::SkiaUtilities::samplingOptionsForImageDraw):
Canonical link: https://commits.webkit.org/320490@main
Canonical link: https://commits.webkit.org/317695.207@webkitglib/2.54
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications