diff --git a/src/plugins/qpa/eglplatformcontext.cpp b/src/plugins/qpa/eglplatformcontext.cpp index 0d8b89439d..3c0cc78c4d 100644 --- a/src/plugins/qpa/eglplatformcontext.cpp +++ b/src/plugins/qpa/eglplatformcontext.cpp @@ -58,18 +58,9 @@ EGLPlatformContext::~EGLPlatformContext() } } -static EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) -{ - if (surface->surface()->surfaceClass() == QSurface::Window) { - return EGL_NO_SURFACE; // EGL_KHR_surfaceless_context is required - } else { - return static_cast(surface)->eglSurface(); - } -} - bool EGLPlatformContext::makeCurrent(QPlatformSurface *surface) { - const bool ok = m_eglContext->makeCurrent(eglSurfaceForPlatformSurface(surface)); + const bool ok = m_eglContext->makeCurrent(); if (!ok) { qCWarning(KWIN_QPA, "eglMakeCurrent failed: %x", eglGetError()); return false; diff --git a/src/plugins/qpa/offscreensurface.cpp b/src/plugins/qpa/offscreensurface.cpp index a0e5413d84..866cb8d582 100644 --- a/src/plugins/qpa/offscreensurface.cpp +++ b/src/plugins/qpa/offscreensurface.cpp @@ -22,34 +22,8 @@ namespace QPA OffscreenSurface::OffscreenSurface(QOffscreenSurface *surface) : QPlatformOffscreenSurface(surface) - , m_eglDisplay(kwinApp()->outputBackend()->sceneEglDisplayObject()) + , m_format(surface->requestedFormat()) { - const QSize size = surface->size(); - - EGLConfig config = configFromFormat(m_eglDisplay, surface->requestedFormat(), EGL_PBUFFER_BIT); - if (config == EGL_NO_CONFIG_KHR) { - return; - } - - const EGLint attributes[] = { - EGL_WIDTH, size.width(), - EGL_HEIGHT, size.height(), - EGL_NONE}; - - m_surface = eglCreatePbufferSurface(m_eglDisplay, config, attributes); - if (m_surface == EGL_NO_SURFACE) { - return; - } - - // Requested and actual surface format might be different. - m_format = formatFromConfig(m_eglDisplay, config); -} - -OffscreenSurface::~OffscreenSurface() -{ - if (m_surface != EGL_NO_SURFACE) { - eglDestroySurface(m_eglDisplay, m_surface); - } } QSurfaceFormat OffscreenSurface::format() const @@ -59,12 +33,7 @@ QSurfaceFormat OffscreenSurface::format() const bool OffscreenSurface::isValid() const { - return m_surface != EGL_NO_SURFACE; -} - -EGLSurface OffscreenSurface::eglSurface() const -{ - return m_surface; + return true; } } // namespace QPA diff --git a/src/plugins/qpa/offscreensurface.h b/src/plugins/qpa/offscreensurface.h index 8782fe207b..9e27fc9dbe 100644 --- a/src/plugins/qpa/offscreensurface.h +++ b/src/plugins/qpa/offscreensurface.h @@ -25,18 +25,12 @@ class OffscreenSurface : public QPlatformOffscreenSurface { public: explicit OffscreenSurface(QOffscreenSurface *surface); - ~OffscreenSurface() override; QSurfaceFormat format() const override; bool isValid() const override; - EGLSurface eglSurface() const; - private: QSurfaceFormat m_format; - - EglDisplay *m_eglDisplay = nullptr; - EGLSurface m_surface = EGL_NO_SURFACE; }; } // namespace QPA