Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4ca156ae3080e424f8c1c7237b43d39235dbfdf5
https://github.com/WebKit/WebKit/commit/4ca156ae3080e424f8c1c7237b43d39235dbfdf5
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-04-01 (Wed, 01 Apr 2026)
Changed paths:
M Source/WTF/wtf/unix/UnixFileDescriptor.h
M Source/WebCore/platform/TextureMapper.cmake
M Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp
M Source/WebCore/platform/graphics/gbm/DMABufBuffer.h
A Source/WebCore/platform/graphics/gbm/DMABufBufferAttributes.h
M Source/WebCore/platform/graphics/gbm/GraphicsContextGLTextureMapperGBM.cpp
M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp
M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.h
M Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.h
M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
M Source/WebKit/Shared/gbm/DMABufBuffer.serialization.in
M Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.cpp
M Source/WebKit/UIProcess/glib/AcceleratedBackingStore.messages.in
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h
M Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp
M Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h
M Source/WebKit/WPEPlatform/wpe/WPEBufferDMABuf.cpp
M
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.cpp
M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h
Log Message:
-----------
[GTK][WPE] Consolidate dma-buf / EGL image creation code into DMABufBuffer
methods
https://bugs.webkit.org/show_bug.cgi?id=311251
Reviewed by Adrian Perez de Castro.
Eliminate duplicated ADD_PLANE_ATTRIBUTES macros across many call sites by
introducing shared helpers: DMABufBufferAttributes::constructFromGBMBufferObject
for GBM buffer attribute extraction, and DMABufBuffer::createEGLImage overloads
for both GLDisplay and raw EGLDisplay (ANGLE) contexts.
Extract DMABufBufferAttributes into its own header without USE(GBM) guard
so non-GBM builds can use the struct as well.
Also modernize WPEBufferDMABuf.cpp to use the same std::array + loop
pattern. As a WPEPlatform class it cannot use the WebCore functionality
but it should still use the same approach as implemented in
DMABufBufferAttributes.
Covered by existing tests.
* Source/WTF/wtf/unix/UnixFileDescriptor.h:
(WTF::UnixFileDescriptor::UnixFileDescriptor):
(WTF::UnixFileDescriptor::~UnixFileDescriptor):
* Source/WebCore/platform/TextureMapper.cmake:
* Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp:
(WebCore::DMABufBuffer::DMABufBuffer):
(WebCore::DMABufBufferAttributes::fromGBMBufferObject):
(WebCore::DMABufBuffer::createEGLImage const):
(WebCore::buildEGLAttributesForDMABuf):
(WebCore::DMABufBuffer::createEGLImage):
* Source/WebCore/platform/graphics/gbm/DMABufBuffer.h:
* Source/WebCore/platform/graphics/gbm/DMABufBufferAttributes.h: Copied from
Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLTextureMapperGBM.cpp:
(WebCore::GraphicsContextGLTextureMapperGBM::createDrawingBuffer const):
(WebCore::GraphicsContextGLTextureMapperGBM::createExternalImage):
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp:
(WebCore::MemoryMappedGPUBuffer::createDMABufFromGBMBufferObject):
(WebCore::MemoryMappedGPUBuffer::createEGLImageFromDMABuf):
(WebCore::MemoryMappedGPUBuffer::exportGBMBufferObjectAsDMABuf): Deleted.
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.h:
* Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp:
(WebCore::VideoFrameGStreamer::getDMABuf):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.cpp:
(WebCore::importToTexture):
(WebCore::CoordinatedPlatformLayerBufferDMABuf::importYUV const):
(WebCore::CoordinatedPlatformLayerBufferDMABuf::importDMABuf const):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferDMABuf.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
* Source/WebKit/Shared/gbm/DMABufBuffer.serialization.in:
* Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.cpp:
(WebKit::OpenXRLayer::exportOpenXRTextureGBM):
* Source/WebKit/UIProcess/glib/AcceleratedBackingStore.messages.in:
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::BufferDMABuf::create):
(WebKit::AcceleratedBackingStore::BufferEGLImage::create):
(WebKit::AcceleratedBackingStore::BufferEGLImage::BufferEGLImage):
(WebKit::AcceleratedBackingStore::BufferEGLImage::description const):
(WebKit::AcceleratedBackingStore::didCreateDMABufBuffer):
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h:
* Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::didCreateDMABufBuffer):
* Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h:
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABuf.cpp:
(wpeBufferDMABufImportToEGLImage):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::RenderTargetEGLImage::create):
(WebKit::AcceleratedSurface::RenderTargetEGLImage::RenderTargetEGLImage):
(WebKit::AcceleratedSurface::RenderTargetTexture::RenderTargetTexture):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h:
Canonical link: https://commits.webkit.org/310393@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications