Fix textureForOutput for the EglWaylandBackend

Ensure we get our texture from the right output
This commit is contained in:
Aleix Pol 2022-03-03 17:46:19 +01:00
parent eb760505ac
commit 4c814590fe
2 changed files with 12 additions and 0 deletions

View file

@ -309,6 +309,17 @@ static QVector<EGLint> regionToRects(const QRegion &region, AbstractWaylandOutpu
return rects;
}
QSharedPointer<KWin::GLTexture> EglWaylandBackend::textureForOutput(KWin::AbstractOutput *output) const
{
QSharedPointer<GLTexture> texture(new GLTexture(GL_RGBA8, output->pixelSize()));
GLRenderTarget::pushRenderTarget(m_outputs[output]->renderTarget());
GLRenderTarget renderTarget(texture.data());
renderTarget.blitFromFramebuffer(QRect(0, texture->height(), texture->width(), -texture->height()));
GLRenderTarget::popRenderTarget();
return texture;
}
void EglWaylandBackend::aboutToStartPainting(AbstractOutput *output, const QRegion &damagedRegion)
{
Q_ASSERT_X(output, "aboutToStartPainting", "not using per screen rendering");

View file

@ -83,6 +83,7 @@ public:
return m_havePlatformBase;
}
QSharedPointer<KWin::GLTexture> textureForOutput(KWin::AbstractOutput *output) const override;
void aboutToStartPainting(AbstractOutput *output, const QRegion &damage) override;
private: