[webkit-changes] [WebKit/WebKit] b30a03: [GTK][WPE] Stop using DMA-BUF for WebGL in the web...

Carlos Garcia Campos noreply at github.com
Wed Jun 21 03:41:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b30a03a4c8a229deacb72a6e4fa46f6469df634f
      https://github.com/WebKit/WebKit/commit/b30a03a4c8a229deacb72a6e4fa46f6469df634f
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2023-06-21 (Wed, 21 Jun 2023)

  Changed paths:
    M LayoutTests/platform/glib/TestExpectations
    A LayoutTests/platform/glib/inspector/canvas/recording-webgl-full-expected.txt
    M Source/WebCore/PlatformWin.cmake
    M Source/WebCore/SourcesGTK.txt
    M Source/WebCore/SourcesWPE.txt
    M Source/WebCore/platform/TextureMapper.cmake
    M Source/WebCore/platform/graphics/PlatformDisplay.cpp
    M Source/WebCore/platform/graphics/PlatformDisplay.h
    A Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp
    M Source/WebCore/platform/graphics/egl/GLContext.h
    M Source/WebCore/platform/graphics/egl/PlatformDisplaySurfaceless.cpp
    R Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
    R Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.cpp
    R Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.h
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBMTextureMapper.cpp
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBMTextureMapper.h
    M Source/WebCore/platform/graphics/gbm/PlatformDisplayGBM.cpp
    M Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp
    M Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp
    M Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h
    M Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
    M Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h
    M Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp
    M Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h
    A Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLENicosia.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
    M Source/cmake/OptionsWPE.cmake

  Log Message:
  -----------
  [GTK][WPE] Stop using DMA-BUF for WebGL in the web process
https://bugs.webkit.org/show_bug.cgi?id=258119

Reviewed by Alejandro G. Castro.

DMA-BUF and GBM are not available in all the platforms, so we can
extract the drawing texture from the ANGLE context and pass it to the
texture mapper to be composited like we did before switching to ANGLE.

To be able to use the texture directly we need to make sure that the
context created by ANGLE uses the same EGLDisplay and sharing context as
the compositor context. To get the same EGLDisplay we only need to
ensure we pass the same parameters to EGL_GetPlatformDisplayEXT than the
ones used by the shared display for compositing. To use the same sharing
context we need to create an ANGLE context wrapping the sharing context
used by the compositor context. That's possible by using
EGL_EXTERNAL_CONTEXT_ANGLE context parameter when creating the ANGLE
sharing context and EGL_CONTEXT_VIRTUALIZATION_GROUP_ANGLE when creating
the WebGL ANGLE context.

By using the texture directly we no longer need to use DMA-BUF for WebGL
in the web process, but we keep the GBM implementation for the GPU
process.

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/glib/inspector/canvas/recording-webgl-full-expected.txt: Added.
* Source/WebCore/PlatformWin.cmake:
* Source/WebCore/SourcesGTK.txt:
* Source/WebCore/SourcesWPE.txt:
* Source/WebCore/platform/TextureMapper.cmake:
* Source/WebCore/platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::clearSharingGLContext):
* Source/WebCore/platform/graphics/PlatformDisplay.h:
* Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp: Added.
(WebCore::PlatformDisplay::angleEGLDisplay const):
(WebCore::PlatformDisplay::angleSharingGLContext):
(WebCore::PlatformDisplay::clearANGLESharingGLContext):
* Source/WebCore/platform/graphics/egl/PlatformDisplaySurfaceless.cpp:
(WebCore::PlatformDisplaySurfaceless::PlatformDisplaySurfaceless):
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp: Removed.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.cpp: Removed.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.h: Removed.
* Source/WebCore/platform/graphics/gbm/PlatformDisplayGBM.cpp:
(WebCore::PlatformDisplayGBM::PlatformDisplayGBM):
* Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::initialize):
* Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
(Nicosia::GCGLANGLELayer::GCGLANGLELayer):
* Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h:
* Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::setPendingContents): Deleted.
(WebCore::BitmapTextureGL::updatePendingContents): Deleted.
* Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h:
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::copyTextureFromMedia):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitializeContext):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitialize):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTexture):
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDrawingBuffer):
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLENicosia.cpp: Added.
(WebCore::GraphicsContextGLTextureMapperANGLE::setupCurrentTexture):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):

Co-authored-by: Miguel Gómez <magomez at igalia.com>
Canonical link: https://commits.webkit.org/265349@main




More information about the webkit-changes mailing list