[webkit-changes] [WebKit/WebKit] 50cb02: [GTK][WPE][Skia] Use RGBA as the pixel format for ...
Miguel Gómez
noreply at github.com
Thu Aug 8 06:06:14 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 50cb029965f14968a01715e5335a1381b7f2e9b6
https://github.com/WebKit/WebKit/commit/50cb029965f14968a01715e5335a1381b7f2e9b6
Author: Miguel Gomez <magomez at igalia.com>
Date: 2024-08-08 (Thu, 08 Aug 2024)
Changed paths:
M Source/WebCore/platform/graphics/skia/GraphicsContextGLSkia.cpp
M Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp
M Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.cpp
Log Message:
-----------
[GTK][WPE][Skia] Use RGBA as the pixel format for texture backed SkSurfaces
https://bugs.webkit.org/show_bug.cgi?id=277702
Reviewed by Carlos Garcia Campos.
Currently SkSurfaces are always created using BGRA as the color format. But
when a SkSurface is backed by a texture, this texture has RGBA format because
GLES doesn't support BGRA. Due to this, skia needs perform constant format
conversions when drawing to that SkSurface, which has a big performance penalty.
This change modifies SkSurfaces backed by textures (used for tiles and accelerated
ImageBuffers) to use RGBA instead BGRA.
The format change for the tile SkSurfaces is not problematic, because the
content of those surfaces is always accessed directly from the texture during
the composition, whose format was and is still RGBA.
The ImageBuffer case is a bit more problematic because it's expected to always use
BGRA format, so we need to perform a format conversion when the internal pixels
are accessed by any mean that's not skia (because skia will perform the appropriate
format conversion). This means that we need to perform a format conversion in the
getPixelBuffer() and putPixelBuffer() methods, and also specify in the image
extractor that pixels gotten from a texture backed SkSurface are in RGBA format.
* Source/WebCore/platform/graphics/skia/GraphicsContextGLSkia.cpp:
(WebCore::GraphicsContextGLImageExtractor::extractImage):
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::create):
(WebCore::ImageBufferSkiaAcceleratedBackend::getPixelBuffer):
(WebCore::ImageBufferSkiaAcceleratedBackend::putPixelBuffer):
* Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.cpp:
(WebCore::SkiaAcceleratedBufferPool::createAcceleratedBuffer):
Canonical link: https://commits.webkit.org/281985@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list