From c4b4eba188d2fc0273aaa38533e19dcbd4cfc7be Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 28 Jul 2016 11:59:06 +0200 Subject: eglfs: Add support for raster content rotation Running QWidget or other raster window-based apps with QT_QPA_EGLFS_ROTATION=180 will now flip the screen as expected. In addition, 90 and -90 are supported too. These will affect the reported screen geometry as well. The OpenGL mouse cursor is repositioned and rotated accordingly. For true OpenGL content the rotation is ignored. Hardware mouse cursors (DRM) ignore it as well for the time being. [ChangeLog][Platform Specific Changes] QWidget-based applications running on the eglfs platform plugin can now request 180 or 90 degrees rotated output by setting the QT_QPA_EGLFS_ROTATION environment variable. Task-number: QTBUG-39959 Change-Id: I3570b515d0233c6c6a0e813899b935ee222eab62 Reviewed-by: Andy Nichols --- src/platformsupport/platformcompositor/qopenglcompositor_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/platformsupport/platformcompositor/qopenglcompositor_p.h') diff --git a/src/platformsupport/platformcompositor/qopenglcompositor_p.h b/src/platformsupport/platformcompositor/qopenglcompositor_p.h index 90651b807f..dece41f676 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositor_p.h +++ b/src/platformsupport/platformcompositor/qopenglcompositor_p.h @@ -53,6 +53,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -78,7 +79,8 @@ public: static QOpenGLCompositor *instance(); static void destroy(); - void setTarget(QOpenGLContext *context, QWindow *window); + void setTarget(QOpenGLContext *context, QWindow *window, const QRect &nativeTargetGeometry); + void setRotation(int degrees); QOpenGLContext *context() const { return m_context; } QWindow *targetWindow() const { return m_targetWindow; } @@ -106,6 +108,9 @@ private: QOpenGLContext *m_context; QWindow *m_targetWindow; + QRect m_nativeTargetGeometry; + int m_rotation; + QMatrix4x4 m_rotationMatrix; QTimer m_updateTimer; QOpenGLTextureBlitter m_blitter; QList m_windows; -- cgit v1.2.3