summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@digia.com>2014-02-13 21:59:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-16 11:06:40 +0100
commit44ee7984fccbeae57e108c1a152050e9d3437174 (patch)
treee7585f49a20f2e27742f40a7058cf5ab97bdc22b /src/gui
parent937a4f5443603b0ad1d1558ac9a9a59db8ce299f (diff)
QOpenGLTextureBlitter: fix source rect when origin is top left
This fixes the issue that the blitter required sometimes the texture wrapping to be repeat Change-Id: I86150d008422facf9040873b0983b0e44be9ad24 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/opengl/qopengltextureblitter.cpp5
1 files changed, 3 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;