Reload Shm texture when buffer size changes

Summary: Shm textures via Gl must be reloaded in case their size changes.

Test Plan: testShmBufferSizeChangeOnSubSurface passes.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18453
This commit is contained in:
Roman Gilg 2019-01-22 18:20:52 +01:00
parent d0422eb79f
commit d6f98d1ecc

View file

@ -391,6 +391,12 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap)
if (image.isNull() || !s) { if (image.isNull() || !s) {
return; return;
} }
if (image.size() != m_size) {
// buffer size has changed, reload shm texture
if (!loadTexture(pixmap)) {
return;
}
}
Q_ASSERT(image.size() == m_size); Q_ASSERT(image.size() == m_size);
q->bind(); q->bind();
const QRegion damage = s->trackedDamage(); const QRegion damage = s->trackedDamage();