summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-01-23 11:45:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-24 11:32:56 +0100
commit84756d94c73885803ad8044099ab47c0c49b5076 (patch)
treef7799a6c2659b3d2195975c5afb84e7527cecf1f
parent717d39ac083e80c2aaf90d38d36345ef92bd57a9 (diff)
eglfs: Fix quad coordinates
Prevent artifacts on raster windows by properly mapping the coordinates to [-1,1]. Task-number: QTBUG-36370 Change-Id: I95d0d03952f597ef4ce6a950c6533a3af2df964a Reviewed-by: Andy Nichols <andy.nichols@digia.com>
-rw-r--r--src/platformsupport/eglconvenience/qeglcompositor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/platformsupport/eglconvenience/qeglcompositor.cpp b/src/platformsupport/eglconvenience/qeglcompositor.cpp
index c8b768ae48..f81d72c4bd 100644
--- a/src/platformsupport/eglconvenience/qeglcompositor.cpp
+++ b/src/platformsupport/eglconvenience/qeglcompositor.cpp
@@ -144,10 +144,11 @@ void QEGLCompositor::render(QEGLPlatformWindow *window, uint texture, bool raste
QPoint tl = r.topLeft();
QPoint br = r.bottomRight();
+ // Map to [-1,1]
GLfloat x1 = (tl.x() / sr.width()) * 2 - 1;
- GLfloat x2 = (br.x() / sr.width()) * 2 - 1;
GLfloat y1 = ((sr.height() - tl.y()) / sr.height()) * 2 - 1;
- GLfloat y2 = ((sr.height() - br.y()) / sr.height()) * 2 - 1;
+ GLfloat x2 = ((br.x() + 1) / sr.width()) * 2 - 1;
+ GLfloat y2 = ((sr.height() - (br.y() + 1)) / sr.height()) * 2 - 1;
if (!raster)
qSwap(y1, y2);