From ecf3fa9f10e30f5ccd7766bc66b79f0e2a10a913 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 13 Jan 2023 09:04:27 +0100 Subject: [PATCH] backends/x11: Remove dependency on GLTexture::toImage It is being phased out. Instead, read the pixels from the cursor's framebuffer using `glReadPixels`. Signed-off-by: Victoria Fischer --- src/backends/x11/windowed/x11_windowed_egl_backend.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp index c577917fe9..33777b152e 100644 --- a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp @@ -118,8 +118,13 @@ std::optional X11WindowedEglCursorLayer::beginFrame() bool X11WindowedEglCursorLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - const QImage buffer = m_texture->toImage().mirrored(false, true); - m_output->cursor()->update(buffer, m_hotspot); + QImage buffer(m_framebuffer->size(), QImage::Format_RGBA8888_Premultiplied); + + GLFramebuffer::pushFramebuffer(m_framebuffer.get()); + glReadPixels(0, 0, buffer.width(), buffer.height(), GL_RGBA, GL_UNSIGNED_BYTE, buffer.bits()); + GLFramebuffer::popFramebuffer(); + + m_output->cursor()->update(buffer.mirrored(false, true), m_hotspot); return true; }