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 <victoria.fischer@mbition.io>
This commit is contained in:
Kai Uwe Broulik 2023-01-13 09:04:27 +01:00 committed by Kai Uwe Broulik
parent dedae9e667
commit ecf3fa9f10

View file

@ -118,8 +118,13 @@ std::optional<OutputLayerBeginFrameInfo> 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;
}