[Webkit-unassigned] [Bug 240058] New: ImageBuffer subclasses should not be templates

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 4 02:20:12 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=240058

            Bug ID: 240058
           Summary: ImageBuffer subclasses should not be templates
           Product: WebKit
           Version: WebKit Nightly 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

ImageBuffer subclasses should not be templates. Current ConcreteImageBuffer<ImageBufferBackend> causes the final subclass to be templated. This is overly complicated class hierarchy.

This causes the holders not being able to hold image buffer subclasses generically. This causes all the needed generic subclass properties to leak into main WebCore::ImageBuffer.

Concrete examples:
ImageBuffer::clearBackend only makes sense for RemoteImageBufferProxy<>. However, it must be in ImageBuffer, since RemoteResourceCache cannot hold on to RemoteImageBufferProxy<>

RemoteImageBufferProxy would need IPC messages, but cannot have such as there's no such class RemoteImageBufferProxy, rather RemoteImageBufferProxy<>. IPC system cannot generate messages for templates, and it wouldn't make sense if it could.

ImageBuffer is already doing work with virtual methods.
ImageBufferBackend is already doing work with virtual methods.
It's pointless to provide a mixin ConcreteImageBuffer that just complicates things.

There's no ImageBuffers without ConcreteImageBuffer. 

To fix:
Merge ImageBuffer and ConcreteImageBuffer
The new ImageBuffer calls virtual functions of ImageBufferBackend


imageBuffer = DisplayListAcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, purpose, creationContext);
->
imageBuffer = DisplayListImageBuffer::create(AcceleratedImageBufferBackend::create(size, resolutionScale, colorSpace, pixelFormat, purpose, creationContext));


imageBuffer = AcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, purpose, creationContext);
->
imageBuffer = PlatformImageBuffer::create(AcceleratedImageBufferBackend::create(size, resolutionScale, colorSpace, pixelFormat, purpose, creationContext));


imageBuffer = ConcreteImageBuffer<ImageBufferShareableBitmapBackend>::create(size, resolutionScale, colorSpace, PixelFormat::BGRA8, RenderingPurpose::ShareableSnapshot, { });
->
imageBuffer = ImageBuffer::create(ImageBufferShareableBitmapBackend::create(size, resolutionScale, colorSpace, PixelFormat::BGRA8, RenderingPurpose::ShareableSnapshot, { }));



Ref<RemoteImageBufferProxy> imageBuffer = AcceleratedRemoteImageBufferMappedProxy::create(size, resolutionScale, colorSpace, pixelFormat, purpose, *this);
->
Ref<RemoteImageBufferProxy> imageBuffer = RemoteImageBufferProxy::create(size, resolutionScale, colorSpace, pixelFormat, purpose, renderingMode, *this));

-- 
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/20220504/69ceed90/attachment-0001.htm>


More information about the webkit-unassigned mailing list