[webkit-changes] [WebKit/WebKit] 0489eb: REGRESSION(286164 at main): HDR images are washed out...
Said Abou-Hallawa
noreply at github.com
Wed Mar 26 16:43:03 PDT 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0489eb20b522872f7d0a88eb37acb2ff944fb73f
https://github.com/WebKit/WebKit/commit/0489eb20b522872f7d0a88eb37acb2ff944fb73f
Author: Said Abou-Hallawa <said at apple.com>
Date: 2025-03-26 (Wed, 26 Mar 2025)
Changed paths:
M Source/WebCore/platform/graphics/DestinationColorSpace.cpp
M Source/WebCore/platform/graphics/DestinationColorSpace.h
M Source/WebCore/platform/graphics/NativeImage.h
M Source/WebCore/platform/graphics/ShareableBitmap.cpp
M Source/WebCore/platform/graphics/ShareableBitmap.h
M Source/WebCore/platform/graphics/cg/ShareableBitmapCG.mm
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm
M Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.h
M Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.serialization.in
M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h
M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteNativeImageBackendProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteNativeImageBackendProxy.h
M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h
M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h
M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm
Log Message:
-----------
REGRESSION(286164 at main): HDR images are washed out if SupportHDRDisplayEnabled is off
https://bugs.webkit.org/show_bug.cgi?id=290061
rdar://147430003
Reviewed by Simon Fraser.
When transferring the NativeImage to GPUProcess through ShareableBitmap the
image colorSpace is used. After 286164 at main and if the colorSpace of the image
UsesITUR_2100TF, ShareableBitmapConfiguration::validateColorSpace() will return
ExtendedSRGB.
Drawing an image with ExtendedSRGB backing store on an sRGB destination context
makes the image look as it is washed out.
To fix this regression, a few things needs to be corrected as well.
1. DestinationColorSpace::usesRec2100TransferFunctions() is not the correct to
check whether an image has HDR contents or not. This function will return
false for colorSpace ITUR_2020. The image headroom should be used instead.
2. On macOS, CALayer should be created with the colorSpace of the screen. This
was the behavior before 284617 at main.
3. Layer contentsFormat should be propagated to RemoteDisplayListRecorderProxy
through RemoteImageBufferSetConfiguration.
4. When transferring a NativeImage to GPUProcess and the Headroom of NativeImage
is greater than 1 and
a) The layer contentsFormat is RGBA16F, ExtendedSRGB colorSpace will be used.
b) On iOS, DisplayP3 colorSpace will be used.
c) Otherwise SRGB colorSpace will be used.
* Source/WebCore/platform/graphics/DestinationColorSpace.cpp:
(WebCore::DestinationColorSpace::asRGB const):
(WebCore::DestinationColorSpace::usesRec2100TransferFunctions const): Deleted.
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
(WebCore::DestinationColorSpace::usesStandardRange const): Deleted.
* Source/WebCore/platform/graphics/NativeImage.h:
* Source/WebCore/platform/graphics/ShareableBitmap.cpp:
* Source/WebCore/platform/graphics/ShareableBitmap.h:
* Source/WebCore/platform/graphics/cg/ShareableBitmapCG.mm:
(WebCore::ShareableBitmapConfiguration::validateColorSpace):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm:
(WebKit::RemoteLayerWithRemoteRenderingBackingStore::ensureBackingStore):
* Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.h:
* Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::RemoteDisplayListRecorderProxy):
(WebKit::RemoteDisplayListRecorderProxy::recordResourceUse):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp:
(WebKit::RemoteImageBufferSetProxy::willPrepareForDisplay):
* Source/WebKit/WebProcess/GPU/graphics/RemoteNativeImageBackendProxy.cpp:
(WebKit::RemoteNativeImageBackendProxy::create):
* Source/WebKit/WebProcess/GPU/graphics/RemoteNativeImageBackendProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::createDisplayListRecorder):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::RemoteResourceCacheProxy::recordNativeImageUse):
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::displayColorSpace const):
Canonical link: https://commits.webkit.org/292734@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list