Branch: refs/heads/webkitglib/2.50
Home: https://github.com/WebKit/WebKit
Commit: b593ccc26cd742fdfe115b90921a0a283e841018
https://github.com/WebKit/WebKit/commit/b593ccc26cd742fdfe115b90921a0a283e841018
Author: Carlos Bentzen <[email protected]>
Date: 2026-01-19 (Mon, 19 Jan 2026)
Changed paths:
M Source/WebCore/platform/graphics/gbm/DMABufBuffer.h
M Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
M Source/WebCore/platform/graphics/texmap/TextureMapper.h
M Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp
M Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferVideo.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferYUV.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferYUV.h
Log Message:
-----------
Cherry-pick 302751@main (1c03de58be74).
https://bugs.webkit.org/show_bug.cgi?id=301850
[GStreamer][GL] HDR10 tone mapping missing
https://bugs.webkit.org/show_bug.cgi?id=301850
Reviewed by Carlos Garcia Campos.
At the moment, we only support sRGB rendering in ports where
GStreamer is used as multimedia backend, so direct HDR rendering is not
easily feasible unless hole-punching is used, but we can at least
tone-map correctly to achieve better results with HDR10 content. This patch
implements tone-mapping of HDR10 (BT2100-PQ) to SDR (sRGB) through an
extra step in the texture mapper when such conversion is deemed necessary.
When we detect that the video info colorimetry is
GST_VIDEO_COLORIMETRY_BT2100_PQ, which wasn't in place before, we set the
colorspace
to BT.2020 and we set a newly added enum for the PQ transfer function.
The extra step in the texture mapper fragment shader program is called
`applyToneMapPQ`,
and is compiled only when we have detected a PQ transfer function in the
video info. It will perform the tone-mapping from BT.2100 PQ (HDR) to sRGB
(SDR)
by applying these steps:
1. Reference PQ EOTF (ITU-R BT.2100)
2. Normalize using HDR reference white (ITU-R BT.2408)
3. Tone-map using a simplified maxRGB-based Reinhard (based on
Chromium's implementation)
4. Convert from BT.2020 to BT.709 primaries
5. Apply inverse EOTF for sRGB gamma encoding (IEC 61966-2)
With these changes, we can get better HDR10 representation and fix the
previously-seen washed out colors
with the "Life Untouched" sample, as shown in the screenshots attached to
the bug.
The output looks much more like what's seen with Chromium, MPV and VLC.
Driving-By: Fix casing of Colorspace enums in modified classes.
TODO: implement HLG tone-mapping.
* Source/WebCore/platform/graphics/gbm/DMABufBuffer.h:
* Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::drawTexturePlanarYUV):
(WebCore::TextureMapper::drawTextureSemiPlanarYUV):
(WebCore::TextureMapper::drawTexturePackedYUV):
* Source/WebCore/platform/graphics/texmap/TextureMapper.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h:
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.cpp:
(WebCore::CoordinatedPlatformLayerBufferDMABuf::importYUV const):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferVideo.cpp:
(WebCore::CoordinatedPlatformLayerBufferVideo::createBufferFromDMABufMemory):
(WebCore::CoordinatedPlatformLayerBufferVideo::createBufferFromGLMemory):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferYUV.cpp:
(WebCore::CoordinatedPlatformLayerBufferYUV::create):
(WebCore::CoordinatedPlatformLayerBufferYUV::CoordinatedPlatformLayerBufferYUV):
(WebCore::CoordinatedPlatformLayerBufferYUV::paintToTextureMapper):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferYUV.h:
Canonical link: https://commits.webkit.org/302751@main
Canonical link: https://commits.webkit.org/298234.396@webkitglib/2.50
Commit: 2df467590545567a1809d444b2bd357e7c6982c2
https://github.com/WebKit/WebKit/commit/2df467590545567a1809d444b2bd357e7c6982c2
Author: Carlos Bentzen <[email protected]>
Date: 2026-01-19 (Mon, 19 Jan 2026)
Changed paths:
M Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp
Log Message:
-----------
Cherry-pick 305412@main (6c11a2777ba4).
https://bugs.webkit.org/show_bug.cgi?id=303687
[GStreamer] Banding artifacts when rendering tone-mapped PQ
https://bugs.webkit.org/show_bug.cgi?id=303687
Reviewed by Nikolas Zimmermann.
Apply the PQ tone-mapping shader only on platforms where highp fragment
shader precision is
supported. The shader was triggering banding artifacts on platforms where
only mediump is
available.
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::STRINGIFY):
(WebCore::TextureMapperShaderProgram::create):
Canonical link: https://commits.webkit.org/305412@main
Canonical link: https://commits.webkit.org/298234.397@webkitglib/2.50
Compare: https://github.com/WebKit/WebKit/compare/5893ee0d661b...2df467590545
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications