WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
253636
RemoteImageBufferProxy should be removed once redundant
https://bugs.webkit.org/show_bug.cgi?id=253636
Summary
RemoteImageBufferProxy should be removed once redundant
Kimmo Kinnunen
Reported
2023-03-09 00:42:01 PST
RemoteImageBufferProxy should be removed once redundant The point of polymorphism in ImageBuffer is ImageBufferBackend. RemoteImageBufferProxy does not implement anything that is not hard-coded to be routed via its ImageBufferBackend. This means RemoteImageBufferProxy is redundant. Each current RemoteImageBuffer message is specific to a particular specific backend type. The polymorphic behavior is implemented as follows: - ImageBuffer - ImageBufferBackend subclass suitable for the use-case - GraphicsContext subclass suitable for above So we should have: Mapped memory: - WP: RemoteImageBufferBackendSharedProxy - GPU: RemoteImageBufferBackendShared Mapped IOSurface: - WP: RemoteImageBufferBackendIOSurfaceProxy - GPUP: RemoteImageBufferBackendIOSurface Non-mapped IOSurface: - WP: RemoteImageBufferBackendUnmappedProxy (bad name) - GPUP: RemoteImageBufferBackendUnmapped or in case the code can be made so that RemoteImageBufferBackendShared references nicely ImageBufferBackendIOSurface - WP: RemoteImageBufferBackendSharedProxy - GPUP: RemoteImageBufferBackendShared Preferably the GPUP RemoteImageBufferBackend** types are normal types that are not ImageBufferBackends, rather hold a ref to those. Currently the RemoteImageBufferProxy has methods of form: void putImageData() { if (canMapBuffer()) backend->putByMapping() else putBySendingMessage() } That should be moved down to each individual backend as: void Backend1::putImageData() { putByMapping(); } void Backend2::putImageData() { putBySendingMessage(); } The RemoteImageBufferBackend*Proxy classes are of form class RemoteImageBufferBackendSharedProxy : public ImageBufferBackend { std::unique_ptr<RemoteDisplayListRecorderProxy> m_remoteContext; } GraphicsContext& RemoteImageBufferBackendSharedProxy::context() { if (!m_remoteContext) m_remoteContext = RemoteDisplayListRecorderProxy::create(m_connection, m_identifier, ...); return m_remoteContext; } void RemoteImageBufferBackendSharedProxy::putPixelBuffer(const PixelBuffer& pixelBuffer, const IntRect& srcRect, const IntPoint& destPoint, AlphaPremultiplication destFormat) { if (m_remoteContext) m_remoteContext->flush(); ImageBuffer::putPixelBuffer(pixelBuffer, srcRect, destPoint, destFormat); m_connection->send(RemoteImageBufferBackendShared::Messages::SharedStoreUpdated()); } class RemoteImageBufferBackendIOSurfaceProxy : public ImageBufferBackendIOSurfaceBase { std::unique_ptr<RemoteDisplayListRecorderProxy> m_remoteContext; } void RemoteImageBufferBackendISurfaceProxy::prepareForExternalWrite() { m_connection->send(RemoteImageBufferBackendIOSurface::Messages::PrepareForExternalWrite()); ImageBufferBackendIOSurfaceBase::prepareForExternalWrite(); }
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-03-16 01:42:14 PDT
<
rdar://problem/106797458
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug