summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@digia.com>2014-02-13 22:03:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-16 11:06:19 +0100
commit937a4f5443603b0ad1d1558ac9a9a59db8ce299f (patch)
tree6d3ea438cc9245f5f22bd0f34746b1dc3384a59d /src/gui/painting
parent6fbef080a07f5b9b5a3bda985fd020a0bf064973 (diff)
QOpenGLTextureBlitter: Remove Origin location for the Target rect
The Origin for Target rect was deemed a confusing concept. The current implementation would translate the target rect to the coordinate system specified. However, the order and "direction" of the vertices would always be the same. So drawing a texture in for one target rect defined in one coordinate system would paint the texture the same way as it would when a texture was drawn for a target rect drawn in the "opposite" coordinate system. The point with this was that if you wanted to "flip" the texture you would specify that with the source coordinate system. However, this approach breaks on different levels, such as QRect has functions which expects a top left coordinate system (ie. top() and bottom()). In the end Qt uses a top left coordinate system, hence QWindow specifies a top left coordinate system, and hence the api becomes easier if it is not possible to define the coordinate system of the target viewport. Change-Id: I7dd59b3718380876e87a4bff88381d7a1c7d58c1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 58fe28bb48..15459dd748 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -218,8 +218,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
GLuint textureId = textures->textureId(i);
glBindTexture(GL_TEXTURE_2D, textureId);
- QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), windowRect,
- QOpenGLTextureBlitter::OriginTopLeft);
+ QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), windowRect);
d_ptr->blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginBottomLeft);
}
@@ -230,8 +229,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(windowRect, windowRect,
- QOpenGLTextureBlitter::OriginTopLeft);
+ QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(windowRect, windowRect);
d_ptr->blitter->setSwizzleRB(true);
d_ptr->blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
d_ptr->blitter->setSwizzleRB(false);