[Webkit-unassigned] [Bug 277702] New: [GTK][WPE][Skia] Use RGBA as the pixel format for texture backed SkSurfaces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 6 12:05:25 PDT 2024


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

            Bug ID: 277702
           Summary: [GTK][WPE][Skia] Use RGBA as the pixel format for
                    texture backed SkSurfaces
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: magomez at igalia.com
                CC: bugs-noreply at webkitgtk.org

There are 2 places in the code where we're allocating texture backed SkSurfaces:
- SkiaAcceleratedBufferPool, where we use them for tile rendering when the gpu backend is enabled.
- ImageBufferSkiaAcceleratedBackend, where we use them for ImageBuffers (for accelerated canvas and ImageBitmap)

In both of these cases, the SkSurfaces are created with pixelFormat BGRA, which is the default. The problem with this is that the underlying texture has RGBA format, which means that skia is constantly performing format conversions, which hurts the performance a lot. To avoid this, we should create the surfaces with RGBA format.

This is pretty easy in the SkiaAcceleratedBufferPool, where the content of the surface is only accessed through the texture to update the tile textures during the composition, and the texture is always RGBA.

For the ImageBuffer this is a bit trickier, as the content of the surface can be accessed in several ways (I think I'm not missing any):
- through the texture during the call to swapBuffersIfNeeded. No problem here as the texture is RGBA.
- through ImageBuffer::getPixelBuffer() and ImageBuffer::putPixelBuffer(). In both cases we need to convert the format of the pixels as needed.
- by painting the contents of the ImageBuffer into a GraphicsContext, which is done through skia, so skia takes care of the format conversions when needed.

I'll create a patch based on these assumptions and check whether there's some case that I might be missing.

-- 
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/20240806/bab0fff0/attachment.htm>


More information about the webkit-unassigned mailing list