Skip to content

[HDR] Support HDR snapshotting #47146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shallawa
Copy link
Contributor

@shallawa shallawa commented Jun 24, 2025

2d06b2a

[HDR] Support HDR snapshotting
https://bugs.webkit.org/show_bug.cgi?id=283316
rdar://140144773

Reviewed by NOBODY (OOPS!).

Since snapshotting happens on only one GraphicsContext, we can either create it
as HDR context or as SDR context. This will depend on whether the main document
or any its sub document has HDR content. In this case ExtendedSRGB and RGBA16F
will be chosen for the snapshotting ImageBuffer.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::drawsHDRContent const):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
* Source/WebKit/Shared/WebImage.cpp:
(WebKit::WebImage::create):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeSnapshot):
(WebKit::snapshotColorSpace):

2d06b2a

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
❌ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ❌ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@shallawa shallawa requested a review from cdumez as a code owner June 24, 2025 23:46
@shallawa shallawa self-assigned this Jun 24, 2025
@shallawa shallawa added the Images For bugs in image handling. label Jun 24, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 25, 2025
https://bugs.webkit.org/show_bug.cgi?id=283316
rdar://140144773

Reviewed by NOBODY (OOPS!).

Since snapshotting happens on only one GraphicsContext, we can either create it
as HDR context or as SDR context. This will depend on whether the main document
or any its sub document has HDR content. In this case ExtendedSRGB and RGBA16F
will be chosen for the snapshotting ImageBuffer.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::drawsHDRContent const):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
* Source/WebKit/Shared/WebImage.cpp:
(WebKit::WebImage::create):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeSnapshot):
(WebKit::snapshotColorSpace):
@shallawa shallawa removed the merging-blocked Applied to prevent a change from being merged label Jun 25, 2025
@shallawa shallawa force-pushed the eng/HDR-Support-HDR-snapshotting branch from 34180a4 to 2d06b2a Compare June 25, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Images For bugs in image handling.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants