[Webkit-unassigned] [Bug 253636] New: RemoteImageBufferProxy should be removed once redundant
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 9 00:42:01 PST 2023
https://bugs.webkit.org/show_bug.cgi?id=253636
Bug ID: 253636
Summary: RemoteImageBufferProxy should be removed once
redundant
Product: WebKit
Version: WebKit Local Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Canvas
Assignee: webkit-unassigned at lists.webkit.org
Reporter: kkinnunen at apple.com
CC: dino at apple.com
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();
}
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230309/f66c3eb0/attachment.htm>
More information about the webkit-unassigned
mailing list