wayland: Fix initialization of dmabuf textures
Commit e459c8bf54
added a sanity check to
prevent recomputing the texture matrix if the y-inverted hint hasn't been
changed, which is totally reasonable!
However, code that initializes dmabuf textures implicitly assumes that
calling setYInverted() always results in updating the matrix. But it may
be not the case if the passed value matches current isYInverted().
This change adds missing calls to force updating the texture matrix.
Note that we don't need to check the buffer size every time the dmabuf
image has been modified externally because the window pixmap is going to
be re-created if the dimensions of the attached buffer have changed.
I've seen some reports on the internet about Firefox displaying garbage
instead of videos. 99% that bug is caused by this issue. But it seems
like Firefox no longer displays corrupted videos on my machine, so it's
hard to tell.
This commit is contained in:
parent
7546af6b4c
commit
f247e35c6d
1 changed files with 2 additions and 5 deletions
|
@ -392,11 +392,7 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap)
|
|||
m_image = EGL_NO_IMAGE_KHR; // The wl_buffer has ownership of the image
|
||||
// The origin in a dmabuf-buffer is at the upper-left corner, so the meaning
|
||||
// of Y-inverted is the inverse of OpenGL.
|
||||
const bool yInverted = !(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted);
|
||||
if (m_size != dmabuf->size() || yInverted != q->isYInverted()) {
|
||||
m_size = dmabuf->size();
|
||||
q->setYInverted(yInverted);
|
||||
}
|
||||
q->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted));
|
||||
if (s) {
|
||||
s->resetTrackedDamage();
|
||||
}
|
||||
|
@ -552,6 +548,7 @@ bool AbstractEglTexture::loadDmabufTexture(const QPointer< KWaylandServer::Buffe
|
|||
|
||||
m_size = dmabuf->size();
|
||||
q->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted));
|
||||
updateMatrix();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue