From 170c41681d28edb0a1f4bb069682c633e5932032 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 19 Oct 2020 13:11:02 +0300 Subject: [PATCH] Drop unused EGLSurface getter and setter in Platform Besides being unused, we should avoid making OpenGL contexts current against the EGLSurface of the first output because it's a slippery road that may end up in leaking context-specific resources in the mid of a compositing restart. --- platform.h | 14 -------------- .../scenes/opengl/abstract_egl_backend.cpp | 2 -- 2 files changed, 16 deletions(-) diff --git a/platform.h b/platform.h index 9b96065d9a..506801af3d 100644 --- a/platform.h +++ b/platform.h @@ -131,19 +131,6 @@ public: * by rendering backends. */ void setSceneEglGlobalShareContext(EGLContext context); - /** - * The first (in case of multiple) EGLSurface used by the compositing scene. - */ - EGLSurface sceneEglSurface() const { - return m_surface; - } - /** - * Sets the first @p surface used by the compositing scene. - * @see sceneEglSurface - */ - void setSceneEglSurface(EGLSurface surface) { - m_surface = surface; - } /** * The EglConfig used by the compositing scene. @@ -558,7 +545,6 @@ private: EGLConfig m_eglConfig = nullptr; EGLContext m_context = EGL_NO_CONTEXT; EGLContext m_globalShareContext = EGL_NO_CONTEXT; - EGLSurface m_surface = EGL_NO_SURFACE; int m_hideCursorCounter = 0; ColorCorrect::Manager *m_colorCorrect = nullptr; bool m_supportsGammaControl = false; diff --git a/platformsupport/scenes/opengl/abstract_egl_backend.cpp b/platformsupport/scenes/opengl/abstract_egl_backend.cpp index 5022645598..abcc7ec9f4 100644 --- a/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -118,7 +118,6 @@ void AbstractEglBackend::cleanup() cleanupSurfaces(); eglReleaseThread(); kwinApp()->platform()->setSceneEglContext(EGL_NO_CONTEXT); - kwinApp()->platform()->setSceneEglSurface(EGL_NO_SURFACE); kwinApp()->platform()->setSceneEglConfig(nullptr); } @@ -359,7 +358,6 @@ void AbstractEglBackend::setConfig(const EGLConfig &config) void AbstractEglBackend::setSurface(const EGLSurface &surface) { m_surface = surface; - kwinApp()->platform()->setSceneEglSurface(surface); } QSharedPointer AbstractEglBackend::textureForOutput(AbstractOutput *requestedOutput) const