screencasting: only invert the texture manually when it's not marked as inverted

In the cases where isYInverted(), the texture will be properly placed.
It's only when not that we need to mirror it vertically.
This commit is contained in:
Aleix Pol 2023-02-21 03:04:21 +01:00 committed by Aleix Pol Gonzalez
parent 1be2b8868c
commit 93815aede4

View file

@ -27,9 +27,10 @@ static void mirrorVertically(uchar *data, int height, int stride)
static void grabTexture(GLTexture *texture, QImage *image)
{
const bool invert = !texture->isYInverted();
Q_ASSERT(texture->size() == image->size());
bool isGLES = GLPlatform::instance()->isGLES();
bool invertNeeded = isGLES ^ texture->isYInverted();
bool invertNeeded = isGLES ^ invert;
const bool invertNeededAndSupported = invertNeeded && GLPlatform::instance()->supports(PackInvert);
GLboolean prev;
if (invertNeededAndSupported) {