Skip to content

Conversation

@squelart
Copy link
Contributor

@squelart squelart commented Mar 5, 2025

dfab897

Refactor dynamic-range-limit layer-setting code after suppress-HDR notifications
https://bugs.webkit.org/show_bug.cgi?id=289152
rdar://146238622

Reviewed by Mike Wyrzykowski.

Centralize the dynamic-range-limit to be used when suppressing HDR in
videos and other elements.

Also directly use the window-did-become/resign-key notification to use
as window activity state -- `m_page->isViewWindowActive()` was not
actually correct yet.
And only update layer properties when the target dynamic range limit has
actually changed.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::computePlayerDynamicRangeLimit const):
* Source/WebCore/platform/graphics/PlatformDynamicRangeLimit.h:
(WebCore::PlatformDynamicRangeLimit::defaultWhenSuppressingHDR):
(WebCore::PlatformDynamicRangeLimit::defaultWhenSuppressingHDRInVideos):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):
(WebKit::WebViewImpl::updateHDRState):
(WebKit::WebViewImpl::applicationShouldSuppressHDR):
(WebKit::WebViewImpl::applicationShouldAllowHDR):

Canonical link: https://commits.webkit.org/292044@main

8a479e9

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
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@squelart squelart requested a review from cdumez as a code owner March 5, 2025 09:07
@squelart squelart self-assigned this Mar 5, 2025
@squelart squelart added the Images For bugs in image handling. label Mar 5, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 5, 2025
@squelart squelart removed the merging-blocked Applied to prevent a change from being merged label Mar 5, 2025
@squelart squelart force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from a869bc4 to 26f231a Compare March 5, 2025 09:49
@squelart squelart requested a review from mwyrzykowski March 5, 2025 10:12
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 5, 2025
@squelart
Copy link
Contributor Author

squelart commented Mar 5, 2025

Reconsidering... -> draft for now.

@squelart squelart marked this pull request as draft March 5, 2025 20:29
@squelart squelart removed the merging-blocked Applied to prevent a change from being merged label Mar 9, 2025
@squelart squelart force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from 26f231a to 917c44d Compare March 9, 2025 22:20
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 9, 2025
@squelart squelart added skip-ews Applied to prevent a change from being run on EWS and removed merging-blocked Applied to prevent a change from being merged skip-ews Applied to prevent a change from being run on EWS labels Mar 9, 2025
@squelart squelart force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from 917c44d to 7027a92 Compare March 10, 2025 02:57
@squelart squelart changed the title Suppress-HDR notifications should only constrain HDR Refactor dynamic-range-limit layer-setting code after suppress-HDR notifications Mar 12, 2025
@squelart squelart force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from 7027a92 to 3b14102 Compare March 12, 2025 05:49
@squelart squelart force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from 3b14102 to 8a479e9 Compare March 12, 2025 06:07
@squelart squelart marked this pull request as ready for review March 12, 2025 06:29
@squelart squelart requested a review from rniwa as a code owner March 12, 2025 06:29
@squelart squelart added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Mar 12, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 12, 2025
@squelart squelart added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Mar 12, 2025
…tifications

https://bugs.webkit.org/show_bug.cgi?id=289152
rdar://146238622

Reviewed by Mike Wyrzykowski.

Centralize the dynamic-range-limit to be used when suppressing HDR in
videos and other elements.

Also directly use the window-did-become/resign-key notification to use
as window activity state -- `m_page->isViewWindowActive()` was not
actually correct yet.
And only update layer properties when the target dynamic range limit has
actually changed.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::computePlayerDynamicRangeLimit const):
* Source/WebCore/platform/graphics/PlatformDynamicRangeLimit.h:
(WebCore::PlatformDynamicRangeLimit::defaultWhenSuppressingHDR):
(WebCore::PlatformDynamicRangeLimit::defaultWhenSuppressingHDRInVideos):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):
(WebKit::WebViewImpl::updateHDRState):
(WebKit::WebViewImpl::applicationShouldSuppressHDR):
(WebKit::WebViewImpl::applicationShouldAllowHDR):

Canonical link: https://commits.webkit.org/292044@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/mac-suppress-hdr-notification-should-constrain-hdr branch from 8a479e9 to dfab897 Compare March 12, 2025 21:19
@webkit-commit-queue
Copy link
Collaborator

Committed 292044@main (dfab897): https://commits.webkit.org/292044@main

Reviewed commits have been landed. Closing PR #41909 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit dfab897 into WebKit:main Mar 12, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 12, 2025
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.

5 participants