Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fa73c7ed032b2ea59ee5e02a1b4c7288be9ffd18
      
https://github.com/WebKit/WebKit/commit/fa73c7ed032b2ea59ee5e02a1b4c7288be9ffd18
  Author: Matt Woodrow <[email protected]>
  Date:   2025-07-06 (Sun, 06 Jul 2025)

  Changed paths:
    M Source/WebCore/html/OffscreenCanvas.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.h
    M Source/WebCore/html/canvas/GPUCanvasContextCocoa.h
    M Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm
    M Source/WebCore/html/canvas/PlaceholderRenderingContext.cpp
    M Source/WebCore/html/canvas/PlaceholderRenderingContext.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.h
    M Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h
    M Source/WebCore/platform/graphics/ImageBufferPixelFormat.h
    M 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.h
    M 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.mm
    M 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerAsyncContentsDisplayDelegateCoordinated.cpp
    M 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerAsyncContentsDisplayDelegateCoordinated.h
    M Source/WebKit/Platform/IPC/JSIPCBinding.h
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm

  Log Message:
  -----------
  Placeholder canvas does not always propagate HDR content format correctly to 
the layer.
https://bugs.webkit.org/show_bug.cgi?id=295095
rdar://154478292

Reviewed by Mike Wyrzykowski and Kimmo Kinnunen.

OffscreenCanvas can send frames via the AsyncSetLayerContents path instead of a
normal RemoteLayerTreeTransaction, so this path needs to set any properties
related to the buffer (like opaque, and wantsExtendedDynamicRangeContent).

Changes AsyncSetLayerContents to pass a RemoteLayerBackingStoreProperties so
that we're serializing identical data in both paths. Refactors the UI side a bit
so that this buffer can be applied the same in both cases (which should fix a
potential race where RemoteLayerTreeNode::asyncContentsIdentifier() was only
being check for the transaction path).

Enables generated serializers for RemoteLayerBackingStoreProperties.

CALayer contentsFormat and opaque aren't used when we set contents explicitly,
so remove these from the LayerProperties serialization. Instead, serialize
'wantsExtendedDynamicRangeContent' as part of the backing store (which could
hopefully be determined from the buffer's pixel format in the future).

Now that we (correctly) require a value for 'opaque' in AsyncSetLayerContents,
add a getter to CanvasRenderingContext for this. Add implementations for
WebGL/WebGPU where this might not be the same as what would be inferred from the
pixel format.

* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::commitToPlaceholderCanvas):
* Source/WebCore/html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::isOpaque const):
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
(WebCore::GPUCanvasContextCocoa::isOpaque const):
* Source/WebCore/html/canvas/PlaceholderRenderingContext.cpp:
(WebCore::PlaceholderRenderingContextSource::setPlaceholderBuffer):
(WebCore::PlaceholderRenderingContextSource::setContentsToLayer):
(WebCore::PlaceholderRenderingContext::setContentsToLayer):
(WebCore::PlaceholderRenderingContext::setPlaceholderBuffer):
(WebCore::PlaceholderRenderingContext::pixelFormat const):
(WebCore::pixelFormatToContentsFormat): Deleted.
* Source/WebCore/html/canvas/PlaceholderRenderingContext.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::isOpaque const):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h:
(WebCore::GraphicsLayerAsyncContentsDisplayDelegate::isGraphicsLayerCARemoteAsyncContentsDisplayDelegate
 const):
(WebCore::GraphicsLayerAsyncContentsDisplayDelegate::setContentsFormat): 
Deleted.
* Source/WebCore/platform/graphics/ImageBufferPixelFormat.h:
(WebCore::convertToContentsFormat):
(WebCore::imageBufferPixelFormatIsOpaque):
* 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.h:
* 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.mm:
(WebCore::GraphicsLayerAsyncContentsDisplayDelegateCocoa::tryCopyToLayer):
* Source/WebKit/Platform/IPC/JSIPCBinding.h:
(IPC::putJSValueForDecodeArgumentInArray):
* Source/WebKit/Scripts/webkit/messages.py:
(types_that_must_be_moved):
(headers_for_type):
* Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStoreProperties::contentsRenderingResourceIdentifier 
const):
(WebKit::RemoteLayerBackingStoreProperties::isOpaque const): Deleted.
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode const):
(WebKit::RemoteLayerBackingStoreProperties::dump const):
(WebKit::RemoteLayerBackingStoreProperties::RemoteLayerBackingStoreProperties):
(WebKit::RemoteLayerBackingStoreProperties::applyBackingStoreToLayer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::dumpChangedLayers):
* 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/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::applyBackingStore):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::setOpaque):
(WebKit::PlatformCALayerRemote::setContentsFormat):

Canonical link: https://commits.webkit.org/297040@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

Reply via email to