summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0016-eglfs-Fix-quad-coordinates.patch
blob: 92785e459e219493c03896859ad4a1c4627b316b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 84756d94c73885803ad8044099ab47c0c49b5076 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@digia.com>
Date: Thu, 23 Jan 2014 11:45:22 +0100
Subject: [PATCH] eglfs: Fix quad coordinates

Prevent artifacts on raster windows by properly mapping
the coordinates to [-1,1].

Upstream-Status: Backport

Task-number: QTBUG-36370
Change-Id: I95d0d03952f597ef4ce6a950c6533a3af2df964a
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 src/plugins/platforms/eglfs/qeglfscompositor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/platforms/eglfs/qeglfscompositor.cpp b/src/plugins/platforms/eglfs/qeglfscompositor.cpp
index 845bb5b..1efc4f7 100644
--- a/src/plugins/platforms/eglfs/qeglfscompositor.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscompositor.cpp
@@ -153,10 +153,11 @@ void QEglFSCompositor::render(QEglFSWindow *window, uint texture, bool raster)
     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);
-- 
1.7.1