[webkit-changes] [WebKit/WebKit] 891ad7: [WebGL] Abstract attaching/detaching external images

Dan Glastonbury noreply at github.com
Tue May 30 22:52:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 891ad78c430b6b02f4b5236174b500ba6f3523b3
      https://github.com/WebKit/WebKit/commit/891ad78c430b6b02f4b5236174b500ba6f3523b3
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp
    M Source/WebCore/PAL/pal/spi/cocoa/MetalSPI.h
    M Source/WebCore/platform/graphics/GraphicsContextGL.h
    M Source/WebCore/platform/graphics/GraphicsTypesGL.h
    M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
    M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h
    M Source/WebCore/platform/graphics/cocoa/ANGLEUtilitiesCocoa.mm
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp
    M Source/WebKit/WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm
    M Tools/Scripts/generate-gpup-webgl

  Log Message:
  -----------
  [WebGL] Abstract attaching/detaching external images
https://bugs.webkit.org/show_bug.cgi?id=256945
rdar://109495127

Reviewed by Kimmo Kinnunen.

When the GPU process is enabled, the Web process no long has access to the APIs
required to create images passed from the UI process. This change added APIs to
allow attaching and detaching external images that can be represented by a
MachSendRight (either IOSurface or MTLSharedTexture), that can be used in the
Web or GPU process.

Support work for WebXR in GPUP.

* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::endFrame):
* Source/WebCore/PAL/pal/spi/cocoa/MetalSPI.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
* Source/WebCore/platform/graphics/GraphicsTypesGL.h:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::createAndBindExternalImage):
(WebCore::GraphicsContextGLANGLE::destroyEGLImage):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
* Source/WebCore/platform/graphics/cocoa/ANGLEUtilitiesCocoa.mm:
(WebCore::newSharedEventWithMachPort):
(WebCore::newSharedEvent):
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::createAndBindSharedTextureToExternalImage):
(WebCore::GraphicsContextGLCocoa::createAndBindExternalImage):
(WebCore::GraphicsContextGLCocoa::attachIOSurfaceToSharedTexture): Deleted.
(WebCore::GraphicsContextGLCocoa::detachIOSurfaceFromSharedTexture): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::createAndBindExternalImage):
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h:
(destroyEGLImage):
* Source/WebKit/Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(headers_for_type):
* Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::GraphicsContextGL::ExternalImageSourceIOSurfaceHandle>::encode):
(IPC::ArgumentCoder<WebCore::GraphicsContextGL::ExternalImageSourceIOSurfaceHandle>::decode):
(IPC::ArgumentCoder<WebCore::GraphicsContextGL::ExternalImageSourceMTLSharedTextureHandle>::encode):
(IPC::ArgumentCoder<WebCore::GraphicsContextGL::ExternalImageSourceMTLSharedTextureHandle>::decode):
* Source/WebKit/Shared/WebCoreArgumentCoders.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::createAndBindExternalImage):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp:
(WebKit::RemoteGraphicsContextGLProxy::destroyEGLImage):
* Tools/Scripts/generate-gpup-webgl:

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




More information about the webkit-changes mailing list