Fix textureForOutput for the EglWaylandBackend
Ensure we get our texture from the right output
This commit is contained in:
parent
eb760505ac
commit
4c814590fe
2 changed files with 12 additions and 0 deletions
|
@ -309,6 +309,17 @@ static QVector<EGLint> regionToRects(const QRegion ®ion, AbstractWaylandOutpu
|
||||||
return rects;
|
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)
|
void EglWaylandBackend::aboutToStartPainting(AbstractOutput *output, const QRegion &damagedRegion)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(output, "aboutToStartPainting", "not using per screen rendering");
|
Q_ASSERT_X(output, "aboutToStartPainting", "not using per screen rendering");
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
return m_havePlatformBase;
|
return m_havePlatformBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<KWin::GLTexture> textureForOutput(KWin::AbstractOutput *output) const override;
|
||||||
void aboutToStartPainting(AbstractOutput *output, const QRegion &damage) override;
|
void aboutToStartPainting(AbstractOutput *output, const QRegion &damage) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue