Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 52936d4f17f0b2acb5fa0d5013ef392bebe765ee
https://github.com/WebKit/WebKit/commit/52936d4f17f0b2acb5fa0d5013ef392bebe765ee
Author: Simon Fraser <[email protected]>
Date: 2025-10-27 (Mon, 27 Oct 2025)
Changed paths:
A LayoutTests/compositing/hdr/hdr-image-positioned-expected.txt
A LayoutTests/compositing/hdr/hdr-image-positioned.html
M Source/WebCore/rendering/RenderLayer.cpp
M Source/WebCore/rendering/RenderLayer.h
M Source/WebCore/rendering/RenderLayerBacking.cpp
Log Message:
-----------
[HDR] IMG tag CSS features position and transform switch HDR JPEG with
gainmap to SDR
https://bugs.webkit.org/show_bug.cgi?id=301398
rdar://156858374
Reviewed by Said Abou-Hallawa.
HDR images which had their own RenderLayer (by virtue of being positioned,
transformed,
opacity etc) failed to render as HDR. This is because
`RenderLayerBacking::determineNonCompositedLayerDescendantsPaintedContent()`
failed to
test for HDR content on the RenderLayer's immediate renderer. The fix is in two
parts;
first, `RenderLayer::isVisuallyNonEmpty()` needs to detect HDR on this renderer
when
asked, and we have to avoid clobbering `request.hasHDRContent` with
`localRequest.hasHDRContent`
in
`RenderLayerBacking::determineNonCompositedLayerDescendantsPaintedContent()`;
we should
only pass on `RequestState::True`.
This PR also cleans up the usage of `PaintedContentRequest` a little. Instead of
having a constructor that always triggers HDR detection when the document has
HDR
images, we make it a responsibility of the client to ask for HDR when it wants
to;
this avoids potentially wasting time detecting HDR when no-one has asked.
Finally rename the HDR-related members of `PaintedContentsInfo` from
`m_hasHDRContent`/
`m_rendererHDRContent` to `m_hdrContent`/`m_rendererHDRContent` since these
represent
query state, not "have" state.
Test: compositing/hdr/hdr-image-positioned.html
* LayoutTests/compositing/hdr/hdr-image-positioned-expected.txt: Added.
* LayoutTests/compositing/hdr/hdr-image-positioned.html: Added.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::PaintedContentRequest::PaintedContentRequest): Deleted.
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::PaintedContentsInfo::PaintedContentsInfo):
(WebCore::PaintedContentsInfo::setDetectsHDRContent):
(WebCore::PaintedContentsInfo::isPaintsContentSatisfied const):
(WebCore::PaintedContentsInfo::paintsHDRContent):
(WebCore::PaintedContentsInfo::isContentsTypeSatisfied const):
(WebCore::PaintedContentsInfo::rendererHasHDRContent):
(WebCore::PaintedContentsInfo::determinePaintsContent):
(WebCore::PaintedContentsInfo::determineContentsType):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::determineNonCompositedLayerDescendantsPaintedContent
const):
Rename childElement to childRenderElement.
Canonical link: https://commits.webkit.org/302200@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications