[webkit-changes] [WebKit/WebKit] 4fbc3e: Cocoa readPixels is slower in GPUP WebGL than in-p...

Kimmo Kinnunen noreply at github.com
Mon Jan 30 03:27:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4fbc3e1ca2be55ea9b489ca4ac612317d9c68369
      https://github.com/WebKit/WebKit/commit/4fbc3e1ca2be55ea9b489ca4ac612317d9c68369
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M Source/WebKit/Platform/SharedMemory.h
    M Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp

  Log Message:
  -----------
  Cocoa readPixels is slower in GPUP WebGL than in-process WebGL
https://bugs.webkit.org/show_bug.cgi?id=250899
rdar://104475196

Reviewed by Matt Woodrow.

Avoid excessive memcpy'ing during readPixels by using mach capability
to send virtual memory mappings between processes. Improves
use-cases that read large regions.

Add SharedMemory::Handle::create(void*, size, Protection) to create
a handle to the virtual memory region. This is the same as
SharedMemory::wrapMap(), except the wrapMap is confusing because
the intention is to not use SharedMemory, rather create the handle. The
wrapMap also creates a defunct SharedMemory instance (data() == nullptr).
Later commits will remove uses of wrapMap().

* Source/WebKit/Platform/SharedMemory.h:
* Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::toPointer):
(WebKit::toVMAddress):
(WebKit::machProtection):
(WebKit::makeMemoryEntry):
(WebKit::SharedMemory::Handle::Handle):
(WebKit::SharedMemory::Handle::create):
(WebKit::SharedMemory::Handle::decode):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):
(WebKit::SharedMemory::createSendRight const): Deleted.
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::readnPixelsSharedMemory):

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




More information about the webkit-changes mailing list