-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Placeholder canvas does not always propagate HDR content format correctly to the layer #47292
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
base: main
Are you sure you want to change the base?
Placeholder canvas does not always propagate HDR content format correctly to the layer #47292
Conversation
…ctly to the layer https://bugs.webkit.org/show_bug.cgi?id=295095 rdar://154478292 Reviewed by NOBODY (OOPS!). Propagate the HDR content format from the image buffer. Fixes a race where the content format was not set if the buffer had not reached the main thread when the delegate was created. * Source/WebCore/html/canvas/PlaceholderRenderingContext.cpp: (WebCore::PlaceholderRenderingContextSource::setContentsToLayer): (WebCore::PlaceholderRenderingContext::setContentsToLayer): (WebCore::PlaceholderRenderingContext::setPlaceholderBuffer): (WebCore::PlaceholderRenderingContext::pixelFormat const): (WebCore::pixelFormatToContentsFormat): Deleted. * Source/WebCore/html/canvas/PlaceholderRenderingContext.h: * Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h: (WebCore::GraphicsLayerAsyncContentsDisplayDelegate::isGraphicsLayerCARemoteAsyncContentsDisplayDelegate const): (WebCore::GraphicsLayerAsyncContentsDisplayDelegate::setContentsFormat): Deleted. * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::applyContentsFormatToLayer): (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): (WebKit::RemoteLayerTreePropertyApplier::applyAsyncContentsUpdate): * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::asyncSetLayerContents): * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::asyncSetLayerContents): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm: (WebKit::pixelFormatToContentsFormat):
EWS run on current version of this PR (hash 0fa785e) |
ALLOW_DEPRECATED_DECLARATIONS_BEGIN | ||
[layer setWantsExtendedDynamicRangeContent:true]; | ||
ALLOW_DEPRECATED_DECLARATIONS_END | ||
} |
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.
suggested addition:
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
index 6a6be5e4c328..aed53b4b988e 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
@@ -387,6 +387,7 @@ static void applyContentsFormatToLayer(CALayer *layer, ContentsFormat contentsFo
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
[layer setWantsExtendedDynamicRangeContent:true];
ALLOW_DEPRECATED_DECLARATIONS_END
+ [layer setToneMapMode:CAToneMapModeIfSupported];
}
#endif
}
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.
This would enable tone mapping for painted content too, which I don't think we want to do.
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.
r+ with suggested addition:
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
index 6a6be5e4c328..aed53b4b988e 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
@@ -387,6 +387,7 @@ static void applyContentsFormatToLayer(CALayer *layer, ContentsFormat contentsFo
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
[layer setWantsExtendedDynamicRangeContent:true];
ALLOW_DEPRECATED_DECLARATIONS_END
+ [layer setToneMapMode:CAToneMapModeIfSupported];
}
#endif
}
Defer to @mattwoodrow for approval for how to correctly handle tonemapping in the layer tree
0fa785e
0fa785e