[Webkit-unassigned] [Bug 213105] Refactor SVG Filter Image Data Pipeline

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 11 20:15:06 PDT 2020


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

Said Abou-Hallawa <sabouhallawa at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sabouhallawa at apple.com

--- Comment #2 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
>> Therefore, to simplify the color conversion process, one idea would be refactoring the code to only use ImageBuffers to store image information, without using ImageData.

There are two main differences between ImageBuffer and ImageData:

1) The pixels of the rows in the ImageBuffer are not necessarily contiguous. There might be gaps between the rows because of an alignment applied to each row. See

    ImageBufferCairoSurfaceBackend::bytesPerRow()
    ImageBufferIOSurfaceBackend::bytesPerRow()
    ImageBufferBackend::bytesPerRow()

For CG filters we create unaccelerated ImageBuffers which means the pixels of the rows are contagious. But for Cairo, the pixels of the rows are not contagious.

The pixels of ImageData have to be contiguous.

2) The color format of the ImageBuffer might be RGBA or BGRA. But the pixels of the ImageData have to be RGBA. See
    ImageBufferCairoBackend::backendColorFormat()
    ImageBufferCGBitmapBackend::backendColorFormat()
    ImageBufferIOSurfaceBackend::backendColorFormat()

Keep in mind, ImageBuffer can be backed by a memory buffer but the pixels of this buffer have to be arranged such that a GraphicsContext can be created on top of this buffer and we can draw to this GraphicsContext. But ImageData is simply a buffer where pixels can be enumerated easily.

So converting between ImageData and ImageBuffer is an expensive operation that we should avoid as much as we can.

-- 
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/20200612/061e802c/attachment.htm>


More information about the webkit-unassigned mailing list