Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6472f8c3a899dc8f69a968062978a289fb9a2030
      
https://github.com/WebKit/WebKit/commit/6472f8c3a899dc8f69a968062978a289fb9a2030
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-04-03 (Fri, 03 Apr 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp
    M Source/WebCore/platform/graphics/gbm/DMABufBuffer.h
    M Source/WebCore/platform/graphics/gbm/DMABufBufferAttributes.h
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLTextureMapperGBM.cpp

  Log Message:
  -----------
  REGRESSION(310393@main): [GTK][WPE] WebGL context lost after dma-buf/EGLImage 
refactorization
https://bugs.webkit.org/show_bug.cgi?id=311335

Reviewed by Sergio Villar Senin.

The consolidation patch moved EGLImage creation into 
DMABufBuffer::createEGLImage(EGLDisplay),
which resolved eglCreateImageKHR via system eglGetProcAddress. However, the 
WebGL call sites in
GraphicsContextGLTextureMapperGBM pass ANGLE's EGLDisplay (m_displayObj), which 
is not valid for
the system EGL — causing image creation to fail and the WebGL context to be 
lost.

Fix by replacing the EGLDisplay overloads with a buildEGLImageAttributes() 
helper that returns
the EGL attribute list without creating the image. The ANGLE call sites now 
build attributes via
this helper, then call ANGLE's EGL_CreateImageKHR directly (resolved through 
ANGLEHeaders.h).

Also restore the EXT_image_dma_buf_import_modifiers extension check for 
createExternalImage,
which was dropped in the consolidation. The original code only added modifier 
EGL attributes
when the extension was advertised; the shared helper was unconditionally adding 
them.

* Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp:
(WebCore::DMABufBuffer::buildEGLImageAttributes):
* Source/WebCore/platform/graphics/gbm/DMABufBuffer.h:
* Source/WebCore/platform/graphics/gbm/DMABufBufferAttributes.h:
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLTextureMapperGBM.cpp:
(WebCore::GraphicsContextGLTextureMapperGBM::createDrawingBuffer const):
(WebCore::GraphicsContextGLTextureMapperGBM::createExternalImage):

Canonical link: https://commits.webkit.org/310506@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to