diff --git a/src/plugins/screencast/pipewirestream.cpp b/src/plugins/screencast/pipewirestream.cpp index 4b1eabd733..2b02b3a9c9 100644 --- a/src/plugins/screencast/pipewirestream.cpp +++ b/src/plugins/screencast/pipewirestream.cpp @@ -301,11 +301,7 @@ bool PipeWireStream::createStream() if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded) { connect(Cursors::self(), &Cursors::positionChanged, this, [this] { - if (m_cursor.lastFrameTexture) { - m_repainting = true; - recordFrame(QRegion{m_cursor.lastRect} | cursorGeometry(Cursors::self()->currentCursor())); - m_repainting = false; - } + recordFrame(QRegion{m_cursor.lastRect} | cursorGeometry(Cursors::self()->currentCursor())); }); } @@ -323,19 +319,6 @@ void PipeWireStream::stop() delete this; } -static GLTexture *copyTexture(GLTexture *texture) -{ - const QSize size = texture->size(); - GLTexture *copy = new GLTexture(texture->internalFormat(), size); - copy->setFilter(GL_LINEAR); - copy->setWrapMode(GL_CLAMP_TO_EDGE); - - copy->bind(); - glCopyTextureSubImage2D(copy->texture(), 0, 0, 0, 0, 0, size.width(), size.height()); - copy->unbind(); - return copy; -} - // in-place vertical mirroring static void mirrorVertically(uchar *data, int height, int stride) { @@ -461,9 +444,6 @@ void PipeWireStream::recordFrame(const QRegion &damagedRegion) mvp.ortho(r); shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp); - if (!m_repainting) //We need to copy the last version of the stream to render the moved cursor on top - m_cursor.lastFrameTexture.reset(copyTexture(buf->texture())); - if (!m_cursor.texture || m_cursor.lastKey != cursor->image().cacheKey()) m_cursor.texture.reset(new GLTexture(cursor->image())); diff --git a/src/plugins/screencast/pipewirestream.h b/src/plugins/screencast/pipewirestream.h index 08428d7577..1b3e4ec282 100644 --- a/src/plugins/screencast/pipewirestream.h +++ b/src/plugins/screencast/pipewirestream.h @@ -99,9 +99,7 @@ private: qint64 lastKey = 0; QRect lastRect; QScopedPointer texture; - QScopedPointer lastFrameTexture; } m_cursor; - bool m_repainting = false; QRect cursorGeometry(Cursor *cursor) const; QHash> m_dmabufDataForPwBuffer;