summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/opengl/qopengltextureblitter.cpp5
-rw-r--r--tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp
index 8085089bce..b776444347 100644
--- a/src/gui/opengl/qopengltextureblitter.cpp
+++ b/src/gui/opengl/qopengltextureblitter.cpp
@@ -210,6 +210,7 @@ void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
if (textureMatrixUniformState != IdentityFlipped) {
QMatrix3x3 flipped;
flipped(1,1) = -1;
+ flipped(1,2) = 1;
program->setUniformValue(textureTransformUniformPos, flipped);
textureMatrixUniformState = IdentityFlipped;
}
@@ -375,8 +376,8 @@ QMatrix3x3 QOpenGLTextureBlitter::sourceTransform(const QRectF &subTexture,
qreal y_translate = topLeft.y() / textureSize.height();
if (origin == OriginTopLeft) {
- y_translate += (y_translate * 2) + y_scale;
- y_scale = y_scale - 1;
+ y_scale = -y_scale;
+ y_translate = 1 - y_translate;
}
QMatrix3x3 matrix;
diff --git a/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp b/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
index 503e326f38..8f51f511c9 100644
--- a/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
+++ b/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
@@ -81,6 +81,7 @@ void QOpenGLTextureBlitWindow::render()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
QOpenGLTexture texture(m_image);
+ texture.setWrapMode(QOpenGLTexture::ClampToEdge);
texture.create();
QOpenGLTexture texture_mirrored(m_image_mirrord);