Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EGL] Merge GLContext and GLContextEGL #11806

Merged
merged 1 commit into from Mar 24, 2023

Conversation

carlosgcampos
Copy link
Contributor

@carlosgcampos carlosgcampos commented Mar 22, 2023

e322dc6

[EGL] Merge GLContext and GLContextEGL
https://bugs.webkit.org/show_bug.cgi?id=254270

Reviewed by Adrian Perez de Castro.

GLContextEGL is now the only implementation of GLContext, so there's no
reason to have a base abstract class.

* Source/WebCore/Headers.cmake:
* Source/WebCore/PlatformPlayStation.cmake:
* Source/WebCore/PlatformWin.cmake:
* Source/WebCore/SourcesGTK.txt:
* Source/WebCore/SourcesWPE.txt:
* Source/WebCore/platform/graphics/GLContext.cpp: Removed.
* Source/WebCore/platform/graphics/GLContext.h: Removed.
* Source/WebCore/platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharingGLContext):
(WebCore::PlatformDisplay::initializeEGLDisplay):
* Source/WebCore/platform/graphics/egl/GLContext.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGL.cpp.
(WebCore::initializeOpenGLShimsIfNeeded):
(WebCore::GLContext::errorString):
(WebCore::GLContext::lastErrorString):
(WebCore::GLContext::getEGLConfig):
(WebCore::GLContext::createWindowContext):
(WebCore::GLContext::createPbufferContext):
(WebCore::GLContext::createSurfacelessContext):
(WebCore::GLContext::createContext):
(WebCore::GLContext::createOffscreen):
(WebCore::GLContext::createSharing):
(WebCore::GLContext::GLContext):
(WebCore::GLContext::~GLContext):
(WebCore::GLContext::createContextForEGLVersion):
(WebCore::GLContext::makeContextCurrent):
(WebCore::GLContext::current):
(WebCore::GLContext::swapBuffers):
(WebCore::GLContext::platformContext):
(WebCore::GLContext::isExtensionSupported):
(WebCore::GLContext::version):
* Source/WebCore/platform/graphics/egl/GLContext.h: Added.
(WebCore::GLContext::display const):
(WebCore::GLContext::config const):
* Source/WebCore/platform/graphics/egl/GLContextEGL.h: Removed.
* Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceWPE):
(WebCore::GLContext::createWPEContext):
(WebCore::GLContext::destroyWPETarget):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceWPE): Deleted.
(WebCore::GLContextEGL::createWPEContext): Deleted.
(WebCore::GLContextEGL::destroyWPETarget): Deleted.
* Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceWayland):
(WebCore::GLContext::createWaylandContext):
(WebCore::GLContext::destroyWaylandWindow):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceWayland): Deleted.
(WebCore::GLContextEGL::createWaylandContext): Deleted.
(WebCore::GLContextEGL::destroyWaylandWindow): Deleted.
* Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceX11):
(WebCore::GLContext::createPixmapContext):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceX11): Deleted.
(WebCore::GLContextEGL::createPixmapContext): Deleted.
* Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:
* Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::initialize):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerDmabuf.cpp:
(WebCore::TextureMapperPlatformLayerDmabuf::validateTexture):
* Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp:
* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::initializeTrackingAndRendering):
* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h:
* Source/WebKit/GPUProcess/graphics/wc/WCSceneContext.cpp:
(WebKit::WCSceneContext::WCSceneContext):
* Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::createGLContext):
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::tryInitializeEGL):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp:
(WebKit::LayerTreeHost::LayerTreeHost):

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

74aa531

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2 ⏳ πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@carlosgcampos carlosgcampos self-assigned this Mar 22, 2023
@carlosgcampos carlosgcampos added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label Mar 22, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 22, 2023
Copy link
Contributor

@mcatanzaro mcatanzaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should rename GLContextEGLLibWPE.cpp, GLContextEGLWayland.cpp, and GLContextEGLX11.cpp as well.

Source/WebCore/platform/graphics/egl/GLContext.cpp Outdated Show resolved Hide resolved
@carlosgcampos carlosgcampos removed the merging-blocked Applied to prevent a change from being merged label Mar 23, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 23, 2023
@mcatanzaro
Copy link
Contributor

LGTM, but I'm sure you'll want a graphics developer to review this.

@aperezdc
Copy link
Contributor

After squinting a bit at this in the end it's cleanup/refactors without any real change in functionality, so r=me (and yay! for simpler code).

@carlosgcampos carlosgcampos added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Mar 24, 2023
https://bugs.webkit.org/show_bug.cgi?id=254270

Reviewed by Adrian Perez de Castro.

GLContextEGL is now the only implementation of GLContext, so there's no
reason to have a base abstract class.

* Source/WebCore/Headers.cmake:
* Source/WebCore/PlatformPlayStation.cmake:
* Source/WebCore/PlatformWin.cmake:
* Source/WebCore/SourcesGTK.txt:
* Source/WebCore/SourcesWPE.txt:
* Source/WebCore/platform/graphics/GLContext.cpp: Removed.
* Source/WebCore/platform/graphics/GLContext.h: Removed.
* Source/WebCore/platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharingGLContext):
(WebCore::PlatformDisplay::initializeEGLDisplay):
* Source/WebCore/platform/graphics/egl/GLContext.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGL.cpp.
(WebCore::initializeOpenGLShimsIfNeeded):
(WebCore::GLContext::errorString):
(WebCore::GLContext::lastErrorString):
(WebCore::GLContext::getEGLConfig):
(WebCore::GLContext::createWindowContext):
(WebCore::GLContext::createPbufferContext):
(WebCore::GLContext::createSurfacelessContext):
(WebCore::GLContext::createContext):
(WebCore::GLContext::createOffscreen):
(WebCore::GLContext::createSharing):
(WebCore::GLContext::GLContext):
(WebCore::GLContext::~GLContext):
(WebCore::GLContext::createContextForEGLVersion):
(WebCore::GLContext::makeContextCurrent):
(WebCore::GLContext::current):
(WebCore::GLContext::swapBuffers):
(WebCore::GLContext::platformContext):
(WebCore::GLContext::isExtensionSupported):
(WebCore::GLContext::version):
* Source/WebCore/platform/graphics/egl/GLContext.h: Added.
(WebCore::GLContext::display const):
(WebCore::GLContext::config const):
* Source/WebCore/platform/graphics/egl/GLContextEGL.h: Removed.
* Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceWPE):
(WebCore::GLContext::createWPEContext):
(WebCore::GLContext::destroyWPETarget):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceWPE): Deleted.
(WebCore::GLContextEGL::createWPEContext): Deleted.
(WebCore::GLContextEGL::destroyWPETarget): Deleted.
* Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceWayland):
(WebCore::GLContext::createWaylandContext):
(WebCore::GLContext::destroyWaylandWindow):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceWayland): Deleted.
(WebCore::GLContextEGL::createWaylandContext): Deleted.
(WebCore::GLContextEGL::destroyWaylandWindow): Deleted.
* Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContext::GLContext):
(WebCore::GLContext::createWindowSurfaceX11):
(WebCore::GLContext::createPixmapContext):
(WebCore::GLContextEGL::GLContextEGL): Deleted.
(WebCore::GLContextEGL::createWindowSurfaceX11): Deleted.
(WebCore::GLContextEGL::createPixmapContext): Deleted.
* Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:
* Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::initialize):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerDmabuf.cpp:
(WebCore::TextureMapperPlatformLayerDmabuf::validateTexture):
* Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp:
* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::initializeTrackingAndRendering):
* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h:
* Source/WebKit/GPUProcess/graphics/wc/WCSceneContext.cpp:
(WebKit::WCSceneContext::WCSceneContext):
* Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::createGLContext):
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::tryInitializeEGL):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp:
(WebKit::LayerTreeHost::LayerTreeHost):

Canonical link: https://commits.webkit.org/262074@main
@webkit-commit-queue
Copy link
Collaborator

Committed 262074@main (e322dc6): https://commits.webkit.org/262074@main

Reviewed commits have been landed. Closing PR #11806 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 24, 2023
@webkit-commit-queue webkit-commit-queue merged commit e322dc6 into WebKit:main Mar 24, 2023
@carlosgcampos carlosgcampos deleted the egl-context branch March 24, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
6 participants