[webkit-changes] [WebKit/WebKit] 08a58d: Add TransferImageBuffer message

mattwoodrow noreply at github.com
Mon Dec 12 18:43:04 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 08a58d6e99250f434fab7ccbe8f89d3602ddcc7e
      https://github.com/WebKit/WebKit/commit/08a58d6e99250f434fab7ccbe8f89d3602ddcc7e
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2022-12-12 (Mon, 12 Dec 2022)

  Changed paths:
    M Source/WebCore/platform/graphics/ImageBuffer.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebCore/platform/graphics/ImageBufferBackend.h
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h
    M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteResourceCache.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteResourceCache.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h

  Log Message:
  -----------
  Add TransferImageBuffer message
https://bugs.webkit.org/show_bug.cgi?id=249111
<rdar://problem/103232081>

Reviewed by Kimmo Kinnunen.

This implements transfering the backend of a RemoteImageBuffer from its existing RemoteRenderingBackend/WorkQueue to its new RRB.
This will likely be replaced in the future with the new way of sharing resources in the GPUP.

When we create a new ImageBuffer in the WebProcess, and want to transfer contents, we send the message across the connection for the
new buffer.
The GPUP side dispatches messages to the main thread to find the RemoteRenderingBackend, dispatches to the existing WorkQueue to take
ownership of the old buffer and dispatches the result back to the new WorkQueue to complete the transfer.

RemoteImageBuffer sends the same didCreateImageBufferBackend message back once the buffer is transferred (as happens when a remote buffer
is allocated), so that WebProcess attempts to block and wait for the buffer to be available succeed.

* Source/WebCore/platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::transferToNewContext):
(WebCore::ImageBufferBackend::parameters):
* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::transferToNewContext):
* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didClose):
(WebKit::GPUConnectionToWebProcess::findRemoteRenderingBackend):
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h:
* Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.cpp:
(WebKit::RemoteImageBuffer::~RemoteImageBuffer):
(WebKit::RemoteImageBuffer::create):
(WebKit::RemoteImageBuffer::createTransfer):
* Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h:
(WebKit::RemoteImageBuffer::create): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::transferImageBuffer):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h:
(WebKit::RemoteRenderingBackend::resourceOwner const):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteResourceCache.cpp:
(WebKit::RemoteResourceCache::cacheImageBuffer):
(WebKit::RemoteResourceCache::cachedImageBuffer const):
(WebKit::RemoteResourceCache::takeImageBuffer):
* Source/WebKit/GPUProcess/graphics/RemoteResourceCache.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
(WebKit::RemoteRenderingBackendProxy::sendToStreamWithAsyncReply):

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




More information about the webkit-changes mailing list