Fix transformation in eglfs backingstore
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Wed, 15 Aug 2012 15:17:38 +0000 (18:17 +0300)
committerQt by Nokia <qt-info@nokia.com>
Wed, 22 Aug 2012 20:08:54 +0000 (22:08 +0200)
While not visible with forced-fullscreen windows, the formula
used to set up positioning on the Y axis is wrong. (with the GL
coordinate system Y goes 1..-1 when moving top-to-bottom)

Taken from kms' version of the backingstore which had the formulas
corrected.

Change-Id: I460a4eec925e47b08453af4e093d719567af22ea
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/plugins/platforms/eglfs/qeglfsbackingstore.cpp

index 2caf106..8ad0aab 100644 (file)
@@ -124,8 +124,8 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
 
     GLfloat x1 = (r.left() / sr.width()) * 2 - 1;
     GLfloat x2 = (r.right() / sr.width()) * 2 - 1;
-    GLfloat y1 = (r.top() / sr.height()) * 2 - 1;
-    GLfloat y2 = (r.bottom() / sr.height()) * 2 - 1;
+    GLfloat y1 = -1 * ((r.top() / sr.height()) * 2 - 1);
+    GLfloat y2 = -1 * ((r.bottom() / sr.height()) * 2 - 1);
 
     const GLfloat vertexCoordinates[] = {
         x1, y1,