From af12a103ae9ad111084b41bc0e5344adfedeca1f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 15 Feb 2024 10:55:23 +0200 Subject: [PATCH] plugins/screencast: Make region screen cast nicer to memfd Set the FlipY flag so when the memfd code grabs the texture contents, it doesn't need to flip the texture on the cpu side. --- src/plugins/screencast/regionscreencastsource.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/screencast/regionscreencastsource.cpp b/src/plugins/screencast/regionscreencastsource.cpp index 567c5a652b..c81295942d 100644 --- a/src/plugins/screencast/regionscreencastsource.cpp +++ b/src/plugins/screencast/regionscreencastsource.cpp @@ -59,6 +59,7 @@ void RegionScreenCastSource::updateOutput(Output *output) ShaderBinder shaderBinder(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace); QMatrix4x4 projectionMatrix; + projectionMatrix.scale(1, -1); projectionMatrix.ortho(m_region); projectionMatrix.translate(outputGeometry.left(), outputGeometry.top()); @@ -82,6 +83,7 @@ void RegionScreenCastSource::ensureTexture() if (!m_renderedTexture) { return; } + m_renderedTexture->setContentTransform(OutputTransform::FlipY); m_renderedTexture->setFilter(GL_LINEAR); m_renderedTexture->setWrapMode(GL_CLAMP_TO_EDGE);