From 67ec16c335a2c37bc64bdf464b090233904ff734 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 11 Oct 2021 15:54:19 +0200 Subject: [PATCH] pipewire: No need to create a QRect when we just need its size --- src/plugins/screencast/pipewirestream.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/screencast/pipewirestream.cpp b/src/plugins/screencast/pipewirestream.cpp index 6fb0e3f364..f014644c20 100644 --- a/src/plugins/screencast/pipewirestream.cpp +++ b/src/plugins/screencast/pipewirestream.cpp @@ -316,14 +316,13 @@ void PipeWireStream::stop() static GLTexture *copyTexture(GLTexture *texture) { - GLTexture *copy = new GLTexture(texture->internalFormat(), texture->size()); + const QSize size = texture->size(); + GLTexture *copy = new GLTexture(texture->internalFormat(), size); copy->setFilter(GL_LINEAR); copy->setWrapMode(GL_CLAMP_TO_EDGE); - const QRect r({}, texture->size()); - copy->bind(); - glCopyTextureSubImage2D(copy->texture(), 0, 0, 0, 0, 0, r.width(), r.height()); + glCopyTextureSubImage2D(copy->texture(), 0, 0, 0, 0, 0, size.width(), size.height()); copy->unbind(); return copy; }