Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: d2424c0fc67f6a46921edb52874720bb99c0c699 https://github.com/WebKit/WebKit/commit/d2424c0fc67f6a46921edb52874720bb99c0c699 Author: Carlos Garcia Campos <cgar...@igalia.com> Date: 2023-03-28 (Tue, 28 Mar 2023)
Changed paths: M Source/WebCore/PlatformGTK.cmake M Source/WebCore/SourcesGTK.txt M Source/WebCore/platform/graphics/PlatformDisplay.cpp M Source/WebCore/platform/graphics/PlatformDisplay.h M Source/WebCore/platform/graphics/egl/GLContext.cpp M Source/WebCore/platform/graphics/egl/GLContext.h M Source/WebCore/platform/graphics/egl/GLContextLibWPE.cpp M Source/WebCore/platform/graphics/egl/GLContextWayland.cpp M Source/WebCore/platform/graphics/egl/GLContextX11.cpp A Source/WebCore/platform/graphics/egl/PlatformDisplayHeadless.cpp A Source/WebCore/platform/graphics/egl/PlatformDisplayHeadless.h M Source/WebKit/PlatformGTK.cmake M Source/WebKit/Scripts/webkit/messages.py M Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp M Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h M Source/WebKit/Shared/WebProcessCreationParameters.cpp M Source/WebKit/Shared/WebProcessCreationParameters.h M Source/WebKit/SourcesGTK.txt M Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp M Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp A Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp A Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h A Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.messages.in M Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp M Source/WebKit/WebProcess/WebPage/AcceleratedSurface.h M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h A Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceDMABuf.cpp A Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceDMABuf.h M Source/WebKit/WebProcess/WebProcess.h M Source/WebKit/WebProcess/glib/WebProcessGLib.cpp Log Message: ----------- [GTK] Use DMABuf and WebKit IPC for rendering instead of wpe/x11 https://bugs.webkit.org/show_bug.cgi?id=252988 Reviewed by Žan Doberšek. Instead of the wpe rendered, which uses a nested wayland compositor, and x11, which uses a redirected xcomposite window, we can make the web process render always into a pbuffer using mesa surfaceless platform and export the rendered texture using DMAbuf to be consumed by the UI process. This way the rendering is independent from the platform (wayland/x11), and in the UI process we just import the DMABuf into a texture that we pass to GTK for rendering into the web view widget. If under X11 GTK uses GLX instead of EGL we manually import the DMABuf using libgbm to create a cairo surface that we can pass to GTK without using GL. * Source/WebCore/PlatformGTK.cmake: * Source/WebCore/SourcesGTK.txt: * Source/WebCore/platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::initializeEGLDisplay): * Source/WebCore/platform/graphics/PlatformDisplay.h: * Source/WebCore/platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::getEGLConfig): (WebCore::GLContextEGL::createWindowContext): (WebCore::GLContextEGL::createPbufferContext): (WebCore::GLContextEGL::createSurfacelessContext): (WebCore::GLContextEGL::createContext): (WebCore::GLContextEGL::createSharingContext): * Source/WebCore/platform/graphics/egl/GLContextEGL.h: * Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp: (WebCore::GLContextEGL::createWPEContext): * Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp: (WebCore::GLContextEGL::createWaylandContext): * Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp: (WebCore::GLContextEGL::createPixmapContext): * Source/WebCore/platform/graphics/egl/PlatformDisplayHeadless.cpp: Added. (WebCore::PlatformDisplayHeadless::create): (WebCore::PlatformDisplayHeadless::PlatformDisplayHeadless): (WebCore::PlatformDisplayHeadless::~PlatformDisplayHeadless): * Source/WebCore/platform/graphics/egl/PlatformDisplayHeadless.h: Added. * Source/WebKit/PlatformGTK.cmake: * Source/WebKit/Scripts/webkit/messages.py: (headers_for_type): * Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::createGLContext): (WebKit::ThreadedCompositor::invalidate): * Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Source/WebKit/Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Source/WebKit/Shared/WebProcessCreationParameters.h: * Source/WebKit/SourcesGTK.txt: * Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): * Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): * Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp: (WebKit::AcceleratedBackingStore::checkRequirements): (WebKit::AcceleratedBackingStore::create): * Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp: Added. (WebKit::gtkGLContextIsEGL): (WebKit::AcceleratedBackingStoreDMABuf::checkRequirements): (WebKit::AcceleratedBackingStoreDMABuf::create): (WebKit::AcceleratedBackingStoreDMABuf::AcceleratedBackingStoreDMABuf): (WebKit::AcceleratedBackingStoreDMABuf::~AcceleratedBackingStoreDMABuf): (WebKit::AcceleratedBackingStoreDMABuf::RenderSource::RenderSource): (WebKit::AcceleratedBackingStoreDMABuf::Texture::Texture): (WebKit::AcceleratedBackingStoreDMABuf::Texture::~Texture): (WebKit::AcceleratedBackingStoreDMABuf::Texture::swap): (WebKit::AcceleratedBackingStoreDMABuf::Texture::snapshot const): (WebKit::AcceleratedBackingStoreDMABuf::Texture::paint const): (WebKit::AcceleratedBackingStoreDMABuf::Surface::Surface): (WebKit::AcceleratedBackingStoreDMABuf::Surface::~Surface): (WebKit::AcceleratedBackingStoreDMABuf::Surface::map const): (WebKit::AcceleratedBackingStoreDMABuf::Surface::swap): (WebKit::AcceleratedBackingStoreDMABuf::Surface::snapshot const): (WebKit::AcceleratedBackingStoreDMABuf::Surface::paint const): (WebKit::AcceleratedBackingStoreDMABuf::configure): (WebKit::AcceleratedBackingStoreDMABuf::frame): (WebKit::AcceleratedBackingStoreDMABuf::unrealize): (WebKit::AcceleratedBackingStoreDMABuf::ensureGLContext): (WebKit::AcceleratedBackingStoreDMABuf::makeContextCurrent): (WebKit::AcceleratedBackingStoreDMABuf::update): (WebKit::AcceleratedBackingStoreDMABuf::snapshot): (WebKit::AcceleratedBackingStoreDMABuf::paint): * Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h: Added. * Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.messages.in: Added. * Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp: (WebKit::AcceleratedSurface::create): * Source/WebKit/WebProcess/WebPage/AcceleratedSurface.h: (WebKit::AcceleratedSurface::didCreateGLContext): (WebKit::AcceleratedSurface::willDestroyGLContext): * Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::didCreateGLContext): (WebKit::LayerTreeHost::willDestroyGLContext): * Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: * Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceDMABuf.cpp: Added. (WebKit::AcceleratedSurfaceDMABuf::create): (WebKit::AcceleratedSurfaceDMABuf::AcceleratedSurfaceDMABuf): (WebKit::AcceleratedSurfaceDMABuf::~AcceleratedSurfaceDMABuf): (WebKit::AcceleratedSurfaceDMABuf::didCreateGLContext): (WebKit::AcceleratedSurfaceDMABuf::willDestroyGLContext): (WebKit::AcceleratedSurfaceDMABuf::surfaceID const): (WebKit::AcceleratedSurfaceDMABuf::clientResize): (WebKit::AcceleratedSurfaceDMABuf::willRenderFrame): (WebKit::AcceleratedSurfaceDMABuf::didRenderFrame): * Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceDMABuf.h: Added. * Source/WebKit/WebProcess/WebProcess.h: * Source/WebKit/WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Canonical link: https://commits.webkit.org/262210@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes