Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b47541a2e00178526fb3e5827f8d17260dac09eb
https://github.com/WebKit/WebKit/commit/b47541a2e00178526fb3e5827f8d17260dac09eb
Author: Alejandro G. Castro <[email protected]>
Date: 2026-05-17 (Sun, 17 May 2026)
Changed paths:
M Source/WebCore/platform/graphics/skia/SkiaReplayAtlas.cpp
M Source/WebCore/platform/graphics/skia/SkiaUtilities.cpp
M Source/WebCore/platform/graphics/skia/SkiaUtilities.h
M Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferExternalOES.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferRGB.cpp
Log Message:
-----------
[WPE][GTK] Atlas textures use spec-violating glTexImage2D(internal=GL_RGBA,
format=GL_BGRA), render black on strict GLES drivers
https://bugs.webkit.org/show_bug.cgi?id=314719
Reviewed by Nikolas Zimmermann.
SkiaGPUAtlas allocates BitmapTextures with UseBGRALayout, intended to give
them GL_BGRA storage. BitmapTexture uploaded them via
glTexImage2D(internal=GL_RGBA, format=GL_BGRA), which is undefined per
EXT_texture_format_BGRA8888 — the spec mandates internalFormat == format.
Mesa accepts it (TextureMapper's shaders swizzle BGRA→RGBA at sample time);
Adreno rejects every upload with GL_INVALID_OPERATION, leaving the atlas
texture undefined and rendering solid-black photos after a scroll burst.
Pass textureFormat() for both internalFormat and format in glTexImage2D so
UseBGRALayout textures upload as internal=format=GL_BGRA. On the Skia side,
declare fFormat=GL_BGRA on the GrBackendTexture for UseBGRALayout textures.
Tile textures (createBuffer) don't have UseBGRALayout, so they remain
GL_RGBA — no-op.
Drop the helper borrowBackendTextureAsImage and inline
SkImages::BorrowTextureFrom
at each call site with the SkColorType matching that site's backend texture.
* Source/WebCore/platform/graphics/skia/SkiaReplayAtlas.cpp:
(WebCore::SkiaReplayAtlas::create): Inline SkImages::BorrowTextureFrom with
kBGRA_8888_SkColorType (atlas has UseBGRALayout).
* Source/WebCore/platform/graphics/skia/SkiaUtilities.cpp:
(WebCore::SkiaUtilities::createBackendTexture): Declare fFormat=GL_BGRA for
UseBGRALayout textures.
(WebCore::SkiaUtilities::borrowBackendTextureAsImage): Deleted.
* Source/WebCore/platform/graphics/skia/SkiaUtilities.h: Drop
borrowBackendTextureAsImage declaration.
* Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::allocateTexture): Use textureFormat() for both
internalFormat and format.
(WebCore::BitmapTexture::reset): Same.
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferExternalOES.cpp:
(WebCore::CoordinatedPlatformLayerBufferExternalOES::skiaImage): Inline
SkImages::BorrowTextureFrom with kRGBA_8888_SkColorType (backend is GL_RGBA8).
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferRGB.cpp:
(WebCore::CoordinatedPlatformLayerBufferRGB::skiaImage): Inline
SkImages::BorrowTextureFrom with kRGBA_8888_SkColorType (backend is GL_RGBA8).
Canonical link: https://commits.webkit.org/313395@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications