-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[HDR] Moving the WebView from a screen to another should change backing store formats. #47099
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
[HDR] Moving the WebView from a screen to another should change backing store formats. #47099
Conversation
EWS run on previous version of this PR (hash 478b6b6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write an API test for this?
Source/WebCore/page/LocalFrame.h
Outdated
@@ -223,7 +223,8 @@ class LocalFrame final : public Frame { | |||
WEBCORE_EXPORT float frameScaleFactor() const; | |||
|
|||
void deviceOrPageScaleFactorChanged(); | |||
|
|||
void screenContentsFormatsChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is a bit abstract. Does a screen have a "contents format"? It's more like screenSupportedContentsFormats
or screenAppropriateContentsFormats
Source/WebCore/page/Page.cpp
Outdated
@@ -1729,6 +1729,14 @@ void Page::screenPropertiesDidChange() | |||
updateDisplayEDRSuppression(); | |||
#endif | |||
|
|||
#if HAVE(SUPPORT_HDR_DISPLAY) | |||
if (m_screenSupportsHDR != screenSupportsHighDynamicRange(m_displayID)) { | |||
m_screenSupportsHDR = screenSupportsHighDynamicRange(m_displayID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not call screenSupportsHighDynamicRange(m_displayID)
twice.
Source/WebCore/page/Page.cpp
Outdated
@@ -1748,6 +1756,14 @@ void Page::windowScreenDidChange(PlatformDisplayID displayID, std::optional<Fram | |||
document.windowScreenDidChange(displayID); | |||
}); | |||
|
|||
#if HAVE(SUPPORT_HDR_DISPLAY) | |||
if (m_screenSupportsHDR != screenSupportsHighDynamicRange(m_displayID)) { | |||
m_screenSupportsHDR = screenSupportsHighDynamicRange(m_displayID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should share some code with screenPropertiesDidChange()
.
478b6b6
to
3f3d861
Compare
EWS run on previous version of this PR (hash 3f3d861) |
3f3d861
to
39555cd
Compare
EWS run on current version of this PR (hash 39555cd) |
…ng store formats. https://bugs.webkit.org/show_bug.cgi?id=294757 <rdar://problem/153908494> Reviewed by Simon Fraser. Add code to PlatformCALayerClient/GraphicsLayerClient to query the currently supported ContentsFormats for the screen that the layer is on. Use this version, rather than querying the values for the primary display for all layers. Add change handling to Page (similar to deviceOrPageScaleFactorChanged) that notifies all GraphicsLayers when this result might change. * Source/WebCore/page/LocalFrame.cpp: (WebCore::LocalFrame::screenContentsFormatsChanged): * Source/WebCore/page/LocalFrame.h: * Source/WebCore/page/Page.cpp: (WebCore::Page::screenPropertiesDidChange): (WebCore::Page::windowScreenDidChange): * Source/WebCore/page/Page.h: * Source/WebCore/platform/PlatformScreen.h: * Source/WebCore/platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::noteScreenContentsFormatsChangedIncludingDescendants): * Source/WebCore/platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::screenContentsFormatsChanged): * Source/WebCore/platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::screenContentsFormats const): * Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createPlatformCALayer): (WebCore::GraphicsLayerCA::ensureStructuralLayer): * Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h: * Source/WebCore/platform/graphics/ca/PlatformCALayer.h: * Source/WebCore/platform/graphics/ca/PlatformCALayer.mm: (WebCore::PlatformCALayer::contentsFormatForLayer): * Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h: * Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::screenContentsFormats const): * Source/WebCore/platform/graphics/ca/TileCoverageMap.h: * Source/WebCore/platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::screenContentsFormats const): * Source/WebCore/platform/graphics/ca/TileGrid.h: * Source/WebCore/platform/ios/PlatformScreenIOS.mm: (WebCore::screenSupportsHighDynamicRange): * Source/WebCore/platform/mac/PlatformScreenMac.mm: (WebCore::screenSupportsHighDynamicRange): * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::screenContentsFormats const): * Source/WebCore/rendering/RenderLayerBacking.h: * Source/WebCore/rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::screenContentsFormatsChanged): * Source/WebCore/rendering/RenderLayerCompositor.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm: (WebKit::GraphicsLayerCARemote::createPlatformCALayer): Canonical link: https://commits.webkit.org/296635@main
39555cd
to
a08fe89
Compare
Committed 296635@main (a08fe89): https://commits.webkit.org/296635@main Reviewed commits have been landed. Closing PR #47099 and removing active labels. |
a08fe89
39555cd