Skip to content

Commit

Permalink
All rendering work queues for a content process should share the IOSu…
Browse files Browse the repository at this point in the history
…rfacePool

https://bugs.webkit.org/show_bug.cgi?id=274247
rdar://128183319

Reviewed by Matt Woodrow.

Move the IOSurfacePool and ProcessIdentity to SharedResourceCache. This
way all the work queues, image buffer rendering, WebGL, WebGPU can use
the same resources.

* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::sharedResourceCache):
(WebKit::GPUConnectionToWebProcess::lowMemoryHandler):
* Source/WebKit/GPUProcess/RemoteSharedResourceCache.cpp:
(WebKit::RemoteSharedResourceCache::create):
(WebKit::RemoteSharedResourceCache::RemoteSharedResourceCache):
(WebKit::RemoteSharedResourceCache::lowMemoryHandler):
* Source/WebKit/GPUProcess/RemoteSharedResourceCache.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::RemoteDisplayListRecorder):
(WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL):
(WebKit::RemoteGraphicsContextGL::readPixelsSharedMemory):
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp:
(WebKit::RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize):
* Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.cpp:
(WebKit::RemoteImageBuffer::getShareableBitmap):
(WebKit::RemoteImageBuffer::filteredNativeImage):
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp:
(WebKit::RemoteImageBufferSet::ensureBufferForDisplay):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::RemoteRenderingBackend):
(WebKit::adjustImageBufferCreationContext):
(WebKit::RemoteRenderingBackend::moveToImageBuffer):
(WebKit::RemoteRenderingBackend::allocateImageBuffer):
(WebKit::RemoteRenderingBackend::lowMemoryHandler): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h:
(WebKit::RemoteRenderingBackend::sharedResourceCache):
(WebKit::RemoteRenderingBackend::ioSurfacePool const): Deleted.
(WebKit::RemoteRenderingBackend::resourceOwner const): Deleted.

Canonical link: https://commits.webkit.org/278993@main
  • Loading branch information
kkinnunen-apple committed May 20, 2024
1 parent 04a4f4a commit 1adb237
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 59 deletions.
6 changes: 3 additions & 3 deletions Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Ref<LibWebRTCCodecsProxy> GPUConnectionToWebProcess::protectedLibWebRTCCodecsPro
Ref<RemoteSharedResourceCache> GPUConnectionToWebProcess::sharedResourceCache()
{
if (!m_sharedResourceCache)
m_sharedResourceCache = RemoteSharedResourceCache::create();
m_sharedResourceCache = RemoteSharedResourceCache::create(*this);
return *m_sharedResourceCache;
}

Expand Down Expand Up @@ -553,8 +553,8 @@ void GPUConnectionToWebProcess::terminateWebProcess()

void GPUConnectionToWebProcess::lowMemoryHandler(Critical critical, Synchronous synchronous)
{
for (auto& remoteRenderingBackend : m_remoteRenderingBackendMap.values())
remoteRenderingBackend->lowMemoryHandler(critical, synchronous);
if (m_sharedResourceCache)
m_sharedResourceCache->lowMemoryHandler();
#if ENABLE(VIDEO)
protectedVideoFrameObjectHeap()->lowMemoryHandler();
#endif
Expand Down
23 changes: 20 additions & 3 deletions Source/WebKit/GPUProcess/RemoteSharedResourceCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,27 @@
#if ENABLE(GPU_PROCESS)
#include "RemoteSharedResourceCache.h"

#if HAVE(IOSURFACE)
#include <WebCore/IOSurfacePool.h>
#endif

namespace WebKit {
using namespace WebCore;

constexpr Seconds defaultRemoteSharedResourceCacheTimeout = 15_s;

Ref<RemoteSharedResourceCache> RemoteSharedResourceCache::create()
Ref<RemoteSharedResourceCache> RemoteSharedResourceCache::create(GPUConnectionToWebProcess& gpuConnectionToWebProcess)
{
return adoptRef(*new RemoteSharedResourceCache());
return adoptRef(*new RemoteSharedResourceCache(gpuConnectionToWebProcess));
}

RemoteSharedResourceCache::RemoteSharedResourceCache() = default;
RemoteSharedResourceCache::RemoteSharedResourceCache(GPUConnectionToWebProcess& gpuConnectionToWebProcess)
: m_resourceOwner(gpuConnectionToWebProcess.webProcessIdentity())
#if HAVE(IOSURFACE)
, m_ioSurfacePool(IOSurfacePool::create())
#endif
{
}

RemoteSharedResourceCache::~RemoteSharedResourceCache() = default;

Expand All @@ -57,6 +67,13 @@ void RemoteSharedResourceCache::releaseSerializedImageBuffer(WebCore::RenderingR
m_serializedImageBuffers.remove({ { identifier, 0 }, 0 });
}

void RemoteSharedResourceCache::lowMemoryHandler()
{
#if HAVE(IOSURFACE)
m_ioSurfacePool->discardAllSurfaces();
#endif
}

} // namespace WebKit

#endif // ENABLE(GPU_PROCESS)
21 changes: 19 additions & 2 deletions Source/WebKit/GPUProcess/RemoteSharedResourceCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,25 @@
#include "RemoteSerializedImageBufferIdentifier.h"
#include "ThreadSafeObjectHeap.h"
#include <WebCore/ImageBuffer.h>
#include <WebCore/ProcessIdentity.h>
#include <WebCore/RenderingResourceIdentifier.h>
#include <wtf/FastMalloc.h>
#include <wtf/Ref.h>
#include <wtf/ThreadSafeRefCounted.h>

#if USE(IOSURFACE)
#include <WebCore/IOSurfacePool.h>
#endif

namespace WebKit {

class GPUConnectionToWebProcess;
// Class holding GPU process resources per Web Process.
// Thread-safe.
class RemoteSharedResourceCache final : public ThreadSafeRefCounted<RemoteSharedResourceCache>, IPC::MessageReceiver {
WTF_MAKE_FAST_ALLOCATED;
public:
static Ref<RemoteSharedResourceCache> create();
static Ref<RemoteSharedResourceCache> create(GPUConnectionToWebProcess&);
virtual ~RemoteSharedResourceCache();

void addSerializedImageBuffer(WebCore::RenderingResourceIdentifier, Ref<WebCore::ImageBuffer>);
Expand All @@ -52,13 +58,24 @@ class RemoteSharedResourceCache final : public ThreadSafeRefCounted<RemoteShared
// IPC::MessageReceiver
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;

const WebCore::ProcessIdentity& resourceOwner() const { return m_resourceOwner; }
#if HAVE(IOSURFACE)
WebCore::IOSurfacePool& ioSurfacePool() const { return m_ioSurfacePool; }
#endif

void lowMemoryHandler();

private:
RemoteSharedResourceCache();
RemoteSharedResourceCache(GPUConnectionToWebProcess&);

// Messages
void releaseSerializedImageBuffer(WebCore::RenderingResourceIdentifier);

IPC::ThreadSafeObjectHeap<RemoteSerializedImageBufferIdentifier, RefPtr<WebCore::ImageBuffer>> m_serializedImageBuffers;
WebCore::ProcessIdentity m_resourceOwner;
#if HAVE(IOSURFACE)
Ref<WebCore::IOSurfacePool> m_ioSurfacePool;
#endif
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ImageBufferShareableAllocator.h"
#include "RemoteDisplayListRecorderMessages.h"
#include "RemoteImageBuffer.h"
#include "RemoteSharedResourceCache.h"
#include "SharedVideoFrame.h"
#include <WebCore/BitmapImage.h>
#include <WebCore/FEImage.h>
Expand All @@ -54,9 +55,12 @@ RemoteDisplayListRecorder::RemoteDisplayListRecorder(ImageBuffer& imageBuffer, R
: m_imageBuffer(imageBuffer)
, m_imageBufferIdentifier(imageBufferIdentifier)
, m_renderingBackend(&renderingBackend)
, m_sharedResourceCache(renderingBackend.sharedResourceCache())
{
}

RemoteDisplayListRecorder::~RemoteDisplayListRecorder() = default;

RemoteResourceCache& RemoteDisplayListRecorder::resourceCache() const
{
return m_renderingBackend->remoteResourceCache();
Expand Down Expand Up @@ -273,7 +277,7 @@ void RemoteDisplayListRecorder::drawFilteredImageBuffer(std::optional<RenderingR
RefPtr svgFilter = dynamicDowncast<SVGFilter>(filter);

if (!svgFilter || !svgFilter->hasValidRenderingResourceIdentifier()) {
FilterResults results(makeUnique<ImageBufferShareableAllocator>(m_renderingBackend->resourceOwner()));
FilterResults results(makeUnique<ImageBufferShareableAllocator>(m_sharedResourceCache->resourceOwner()));
drawFilteredImageBufferInternal(sourceImageIdentifier, sourceImageRect, filter, results);
return;
}
Expand All @@ -288,7 +292,7 @@ void RemoteDisplayListRecorder::drawFilteredImageBuffer(std::optional<RenderingR
cachedSVGFilter->mergeEffects(svgFilter->effects());

auto& results = cachedSVGFilter->ensureResults([&]() {
auto allocator = makeUnique<ImageBufferShareableAllocator>(m_renderingBackend->resourceOwner());
auto allocator = makeUnique<ImageBufferShareableAllocator>(m_sharedResourceCache->resourceOwner());
return makeUnique<FilterResults>(WTFMove(allocator));
});

Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class RemoteDisplayListRecorder : public IPC::StreamMessageReceiver, public CanM
instance->startListeningForIPC();
return instance;
}
~RemoteDisplayListRecorder();

void stopListeningForIPC();

Expand Down Expand Up @@ -169,6 +170,7 @@ class RemoteDisplayListRecorder : public IPC::StreamMessageReceiver, public CanM
Ref<WebCore::ImageBuffer> m_imageBuffer;
WebCore::RenderingResourceIdentifier m_imageBufferIdentifier;
RefPtr<RemoteRenderingBackend> m_renderingBackend;
Ref<RemoteSharedResourceCache> m_sharedResourceCache;
std::unique_ptr<WebCore::ControlFactory> m_controlFactory;
#if PLATFORM(COCOA) && ENABLE(VIDEO)
std::unique_ptr<SharedVideoFrameReader> m_sharedVideoFrameReader;
Expand Down
5 changes: 3 additions & 2 deletions Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "RemoteGraphicsContextGLInitializationState.h"
#include "RemoteGraphicsContextGLMessages.h"
#include "RemoteGraphicsContextGLProxyMessages.h"
#include "RemoteSharedResourceCache.h"
#include "StreamConnectionWorkQueue.h"
#include <WebCore/ByteArrayPixelBuffer.h>
#include <WebCore/GraphicsContext.h>
Expand Down Expand Up @@ -82,6 +83,7 @@ RemoteGraphicsContextGL::RemoteGraphicsContextGL(GPUConnectionToWebProcess& gpuC
, m_streamConnection(WTFMove(streamConnection))
, m_graphicsContextGLIdentifier(graphicsContextGLIdentifier)
, m_renderingBackend(renderingBackend)
, m_sharedResourceCache(gpuConnectionToWebProcess.sharedResourceCache())
#if ENABLE(VIDEO)
, m_videoFrameObjectHeap(gpuConnectionToWebProcess.videoFrameObjectHeap())
#if PLATFORM(COCOA)
Expand All @@ -90,7 +92,6 @@ RemoteGraphicsContextGL::RemoteGraphicsContextGL(GPUConnectionToWebProcess& gpuC
#endif
, m_renderingResourcesRequest(ScopedWebGLRenderingResourcesRequest::acquire())
, m_webProcessIdentifier(gpuConnectionToWebProcess.webProcessIdentifier())
, m_resourceOwner(gpuConnectionToWebProcess.webProcessIdentity())
{
assertIsMainRunLoop();
}
Expand Down Expand Up @@ -304,7 +305,7 @@ void RemoteGraphicsContextGL::readPixelsSharedMemory(WebCore::IntRect rect, uint
assertIsCurrent(workQueue());
std::optional<WebCore::IntSize> readArea;

handle.setOwnershipOfMemory(m_resourceOwner, WebKit::MemoryLedger::Default);
handle.setOwnershipOfMemory(m_sharedResourceCache->resourceOwner(), WebKit::MemoryLedger::Default);
if (auto buffer = SharedMemory::map(WTFMove(handle), SharedMemory::Protection::ReadWrite))
readArea = m_context->readPixelsWithStatus(rect, format, type, std::span<uint8_t>(static_cast<uint8_t*>(buffer->data()), buffer->size()));
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class RemoteGraphicsContextGL : private WebCore::GraphicsContextGL::Client, publ
RefPtr<GCGLContext> m_context WTF_GUARDED_BY_CAPABILITY(workQueue());
GraphicsContextGLIdentifier m_graphicsContextGLIdentifier;
Ref<RemoteRenderingBackend> m_renderingBackend;
Ref<RemoteSharedResourceCache> m_sharedResourceCache;
#if ENABLE(VIDEO)
Ref<RemoteVideoFrameObjectHeap> m_videoFrameObjectHeap;
#if PLATFORM(COCOA)
Expand All @@ -167,7 +168,6 @@ class RemoteGraphicsContextGL : private WebCore::GraphicsContextGL::Client, publ
#endif
ScopedWebGLRenderingResourcesRequest m_renderingResourcesRequest;
WebCore::ProcessIdentifier m_webProcessIdentifier;
const WebCore::ProcessIdentity m_resourceOwner;
HashMap<uint32_t, PlatformGLObject, IntHash<uint32_t>, WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> m_objectNames;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "GPUConnectionToWebProcess.h"
#include "IPCUtilities.h"
#include "RemoteSharedResourceCache.h"
#include <WebCore/ProcessIdentity.h>
#include <wtf/MachSendRight.h>

Expand Down Expand Up @@ -114,7 +115,7 @@ RemoteGraphicsContextGLCocoa::RemoteGraphicsContextGLCocoa(GPUConnectionToWebPro
void RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize(WebCore::GraphicsContextGLAttributes&& attributes)
{
assertIsCurrent(workQueue());
m_context = WebCore::GraphicsContextGLCocoa::create(WTFMove(attributes), WebCore::ProcessIdentity { m_resourceOwner });
m_context = WebCore::GraphicsContextGLCocoa::create(WTFMove(attributes), WebCore::ProcessIdentity { m_sharedResourceCache->resourceOwner() });
}

void RemoteGraphicsContextGLCocoa::prepareForDisplay(IPC::Semaphore&& finishedSemaphore, CompletionHandler<void(WTF::MachSendRight&&)>&& completionHandler)
Expand Down
8 changes: 4 additions & 4 deletions Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ void RemoteImageBuffer::getShareableBitmap(WebCore::PreserveResolution preserveR
if (!bitmap)
return std::nullopt;
auto handle = bitmap->createHandle();
if (m_backend->resourceOwner())
handle->setOwnershipOfMemory(m_backend->resourceOwner(), WebCore::MemoryLedger::Graphics);
if (m_backend->sharedResourceCache().resourceOwner())
handle->setOwnershipOfMemory(m_backend->sharedResourceCache().resourceOwner(), WebCore::MemoryLedger::Graphics);
auto context = bitmap->createGraphicsContext();
if (!context)
return std::nullopt;
Expand All @@ -147,8 +147,8 @@ void RemoteImageBuffer::filteredNativeImage(Ref<WebCore::Filter> filter, Complet
if (!bitmap)
return std::nullopt;
auto handle = bitmap->createHandle();
if (m_backend->resourceOwner())
handle->setOwnershipOfMemory(m_backend->resourceOwner(), WebCore::MemoryLedger::Graphics);
if (m_backend->sharedResourceCache().resourceOwner())
handle->setOwnershipOfMemory(m_backend->sharedResourceCache().resourceOwner(), WebCore::MemoryLedger::Graphics);
auto context = bitmap->createGraphicsContext();
if (!context)
return std::nullopt;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void RemoteImageBufferSet::ensureBufferForDisplay(ImageBufferSetPrepareBufferFor
creationContext.dynamicContentScalingResourceCache = ensureDynamicContentScalingResourceCache();
#endif

m_frontBuffer = m_backend->allocateImageBuffer(m_logicalSize, m_renderingMode, WebCore::RenderingPurpose::LayerBacking, m_resolutionScale, m_colorSpace, m_pixelFormat, creationContext, WebCore::RenderingResourceIdentifier::generate());
m_frontBuffer = m_backend->allocateImageBuffer(m_logicalSize, m_renderingMode, WebCore::RenderingPurpose::LayerBacking, m_resolutionScale, m_colorSpace, m_pixelFormat, WTFMove(creationContext), WebCore::RenderingResourceIdentifier::generate());
m_frontBufferIsCleared = true;
}

Expand Down
41 changes: 12 additions & 29 deletions Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ RemoteRenderingBackend::RemoteRenderingBackend(GPUConnectionToWebProcess& gpuCon
, m_streamConnection(WTFMove(streamConnection))
, m_gpuConnectionToWebProcess(gpuConnectionToWebProcess)
, m_sharedResourceCache(gpuConnectionToWebProcess.sharedResourceCache())
, m_resourceOwner(gpuConnectionToWebProcess.webProcessIdentity())
, m_renderingBackendIdentifier(creationParameters.identifier)
#if HAVE(IOSURFACE)
, m_ioSurfacePool(IOSurfacePool::create())
#endif
, m_shapeDetectionObjectHeap(ShapeDetection::ObjectHeap::create())
{
ASSERT(RunLoop::isMain());
Expand Down Expand Up @@ -230,6 +226,14 @@ void RemoteRenderingBackend::moveToSerializedBuffer(RenderingResourceIdentifier
m_sharedResourceCache->addSerializedImageBuffer(identifier, imageBuffer.releaseNonNull());
}

static void adjustImageBufferCreationContext(RemoteSharedResourceCache& sharedResourceCache, ImageBufferCreationContext& creationContext)
{
#if HAVE(IOSURFACE)
creationContext.surfacePool = &sharedResourceCache.ioSurfacePool();
#endif
creationContext.resourceOwner = sharedResourceCache.resourceOwner();
}

void RemoteRenderingBackend::moveToImageBuffer(RenderingResourceIdentifier identifier)
{
assertIsCurrent(workQueue());
Expand All @@ -242,10 +246,7 @@ void RemoteRenderingBackend::moveToImageBuffer(RenderingResourceIdentifier ident
ASSERT(identifier == imageBuffer->renderingResourceIdentifier());

ImageBufferCreationContext creationContext;
#if HAVE(IOSURFACE)
creationContext.surfacePool = &ioSurfacePool();
#endif
creationContext.resourceOwner = m_resourceOwner;
adjustImageBufferCreationContext(m_sharedResourceCache, creationContext);
imageBuffer->transferToNewContext(creationContext);
didCreateImageBuffer(imageBuffer.releaseNonNull());
}
Expand All @@ -269,20 +270,10 @@ static RefPtr<ImageBuffer> allocateImageBufferInternal(const FloatSize& logicalS
return imageBuffer;
}

RefPtr<ImageBuffer> RemoteRenderingBackend::allocateImageBuffer(const FloatSize& logicalSize, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const ImageBufferCreationContext& creationContext, RenderingResourceIdentifier imageBufferIdentifier)
RefPtr<ImageBuffer> RemoteRenderingBackend::allocateImageBuffer(const FloatSize& logicalSize, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, ImageBufferCreationContext creationContext, RenderingResourceIdentifier imageBufferIdentifier)
{
assertIsCurrent(workQueue());

ASSERT(!creationContext.resourceOwner);
#if HAVE(IOSURFACE)
ASSERT(!creationContext.surfacePool);
#endif
ImageBufferCreationContext adjustedCreationContext = creationContext;
adjustedCreationContext.resourceOwner = m_resourceOwner;
#if HAVE(IOSURFACE)
adjustedCreationContext.surfacePool = &ioSurfacePool();
#endif

adjustImageBufferCreationContext(m_sharedResourceCache, creationContext);
RefPtr<ImageBuffer> imageBuffer;

#if ENABLE(RE_DYNAMIC_CONTENT_SCALING)
Expand All @@ -291,7 +282,7 @@ RefPtr<ImageBuffer> RemoteRenderingBackend::allocateImageBuffer(const FloatSize&
#endif

if (!imageBuffer)
imageBuffer = allocateImageBufferInternal<ImageBuffer>(logicalSize, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat, adjustedCreationContext, imageBufferIdentifier);
imageBuffer = allocateImageBufferInternal<ImageBuffer>(logicalSize, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat, creationContext, imageBufferIdentifier);

return imageBuffer;
}
Expand Down Expand Up @@ -508,14 +499,6 @@ void RemoteRenderingBackend::finalizeRenderingUpdate(RenderingUpdateID rendering
send(Messages::RemoteRenderingBackendProxy::DidFinalizeRenderingUpdate(renderingUpdateID), m_renderingBackendIdentifier);
}

void RemoteRenderingBackend::lowMemoryHandler(Critical, Synchronous)
{
ASSERT(isMainRunLoop());
#if HAVE(IOSURFACE)
m_ioSurfacePool->discardAllSurfaces();
#endif
}

void RemoteRenderingBackend::createRemoteBarcodeDetector(ShapeDetectionIdentifier identifier, const WebCore::ShapeDetection::BarcodeDetectorOptions& barcodeDetectorOptions)
{
#if HAVE(SHAPE_DETECTION_API_IMPLEMENTATION)
Expand Down
13 changes: 2 additions & 11 deletions Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class RemoteRenderingBackend : private IPC::MessageSender, public IPC::StreamMes
void stopListeningForIPC();

RemoteResourceCache& remoteResourceCache() { return m_remoteResourceCache; }
RemoteSharedResourceCache& sharedResourceCache() { return m_sharedResourceCache; }

void didReceiveStreamMessage(IPC::StreamServerConnection&, IPC::Decoder&) final;

Expand All @@ -105,13 +106,6 @@ class RemoteRenderingBackend : private IPC::MessageSender, public IPC::StreamMes

IPC::StreamServerConnection& streamConnection() const { return m_streamConnection.get(); }

void lowMemoryHandler(WTF::Critical, WTF::Synchronous);

#if HAVE(IOSURFACE)
WebCore::IOSurfacePool& ioSurfacePool() const { return m_ioSurfacePool; }
#endif

const WebCore::ProcessIdentity& resourceOwner() const { return m_resourceOwner; }

GPUConnectionToWebProcess& gpuConnectionToWebProcess() { return m_gpuConnectionToWebProcess.get(); }

Expand All @@ -123,7 +117,7 @@ class RemoteRenderingBackend : private IPC::MessageSender, public IPC::StreamMes
RefPtr<WebCore::ImageBuffer> imageBuffer(WebCore::RenderingResourceIdentifier);
RefPtr<WebCore::ImageBuffer> takeImageBuffer(WebCore::RenderingResourceIdentifier);

RefPtr<WebCore::ImageBuffer> allocateImageBuffer(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat, const WebCore::ImageBufferCreationContext&, WebCore::RenderingResourceIdentifier);
RefPtr<WebCore::ImageBuffer> allocateImageBuffer(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat, WebCore::ImageBufferCreationContext, WebCore::RenderingResourceIdentifier);

void terminateWebProcess(ASCIILiteral message);

Expand Down Expand Up @@ -199,9 +193,6 @@ class RemoteRenderingBackend : private IPC::MessageSender, public IPC::StreamMes
WebCore::ProcessIdentity m_resourceOwner;
RenderingBackendIdentifier m_renderingBackendIdentifier;
RefPtr<WebCore::SharedMemory> m_getPixelBufferSharedMemory;
#if HAVE(IOSURFACE)
Ref<WebCore::IOSurfacePool> m_ioSurfacePool;
#endif

HashMap<WebCore::RenderingResourceIdentifier, IPC::ScopedActiveMessageReceiveQueue<RemoteDisplayListRecorder>> m_remoteDisplayLists WTF_GUARDED_BY_CAPABILITY(workQueue());
HashMap<WebCore::RenderingResourceIdentifier, IPC::ScopedActiveMessageReceiveQueue<RemoteImageBuffer>> m_remoteImageBuffers WTF_GUARDED_BY_CAPABILITY(workQueue());
Expand Down

0 comments on commit 1adb237

Please sign in to comment.