Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b1b230d5f85067a615d51119501fd54a2c391141
https://github.com/WebKit/WebKit/commit/b1b230d5f85067a615d51119501fd54a2c391141
Author: Gerald Squelart <[email protected]>
Date: 2025-07-08 (Tue, 08 Jul 2025)
Changed paths:
A
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-constrained-disabled-expected.txt
A
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-constrained-disabled.html
A
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-expected.txt
A
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit.html
M Source/WebCore/html/HTMLCanvasElement.cpp
M Source/WebCore/html/HTMLCanvasElement.h
M Source/WebCore/html/canvas/CanvasRenderingContext.h
M Source/WebCore/html/canvas/GPUCanvasContextCocoa.h
M Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm
M Source/WebCore/rendering/RenderHTMLCanvas.cpp
M Source/WebCore/rendering/RenderHTMLCanvas.h
M Source/WebCore/rendering/style/RenderStyle.cpp
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Log Message:
-----------
Apply dynamic-range-limit to HDR WebGPU canvas
https://bugs.webkit.org/show_bug.cgi?id=295600
rdar://155371680
Reviewed by Mike Wyrzykowski.
Handle both dynamic-range-limit and suppress-HDR, to apply whichever
constrains the most.
* Source/WebCore/html/HTMLCanvasElement.h:
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::dynamicRangeLimitDidChange):
Stores the current dynamic-range-limit, and sets the effective limit
(which accounts for the suppress-HDR state) in the rendering context.
(WebCore::HTMLCanvasElement::getContextEffectiveDynamicRangeLimitValue const):
For testing.
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::setDynamicRangeLimit):
Default dynamic-range-limit handler, does nothing.
(WebCore::CanvasRenderingContext::getEffectiveDynamicRangeLimitValue const):
For testing.
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
(WebCore::GPUCanvasContextCocoa::GPUCanvasContextCocoa):
Observer now also passes suppressHDR to updateScreenHeadroom().
(WebCore::interpolateHeadroom):
(WebCore::GPUCanvasContextCocoa::computeContentsHeadroom):
Computes the headroom based on the screen headroom (which may already
be suppressed), and the dynamic-range-limit.
(WebCore::GPUCanvasContextCocoa::updateContentsHeadroom):
Computes the headroom and updates the compositorIntegration with it.
(WebCore::GPUCanvasContextCocoa::updateScreenHeadroom):
Called by observer, stores current headroom and suppressHDR, and
calls updateContentsHeadroom.
(WebCore::GPUCanvasContextCocoa::updateScreenHeadroomFromScreenProperties):
Fetches suppressHDR and current headroom from all screen properties, and
calls updateContentsHeadroom.
(WebCore::GPUCanvasContextCocoa::setDynamicRangeLimit):
WebGPU dynamic-range-limit handler, stores the new limits and:
- If there's no current screen data, calls
updateScreenHeadroomFromScreenProperties, because dynamic-range-limit
needs the current headroom and suppres-HDR flag to work,
- Otherwise just calls updateContentsHeadroom.
(WebCore::GPUCanvasContextCocoa::getEffectiveDynamicRangeLimitValue const):
For testing, combines dynamic-range-limit with suppress-HDR.
(WebCore::GPUCanvasContextCocoa::surfaceBufferToImageBuffer):
Refactored into updateScreenHeadroomFromScreenProperties.
(WebCore::GPUCanvasContextCocoa::configure):
Resets both current headroom and suppressHDR.
* Source/WebCore/rendering/RenderHTMLCanvas.h:
* Source/WebCore/rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::styleDidChange):
Catches dynamic-range-limit changes and notifies element.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
Ensures that dynamic-range-limit changes repaint the element, as its
effective colors may change.
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::getContextEffectiveDynamicRangeLimitValue):
For testing: `internals.getContextEffectiveDynamicRangeLimitValue(canvas)`.
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::screenPropertiesChanged):
Reworked suppress-headroom computation: Always 1.6, or current headroom
if lower.
*
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-constrained-disabled-expected.txt:
Added.
*
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-constrained-disabled.html:
Added.
*
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit-expected.txt:
Added.
*
LayoutTests/http/tests/webgpu/webgpu/web_platform/canvas/dynamic-range-limit.html:
Added.
Canonical link: https://commits.webkit.org/297140@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes