diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-28 11:59:06 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-08-01 15:29:38 +0000 |
commit | c4b4eba188d2fc0273aaa38533e19dcbd4cfc7be (patch) | |
tree | be5d7b72874a17bded380b8da9535de01be2edc4 /src/plugins/platforms/eglfs/api/qeglfswindow.cpp | |
parent | 97c00e66c8ce3fff0f3bb748d3f3c290b30dd296 (diff) | |
download | qtbase-c4b4eba188d2fc0273aaa38533e19dcbd4cfc7be.tar.gz |
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 <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/api/qeglfswindow.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfswindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index f602c1b976..74723955c6 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -142,7 +142,8 @@ void QEglFSWindow::create() context->setScreen(window()->screen()); if (Q_UNLIKELY(!context->create())) qFatal("EGLFS: Failed to create compositing context"); - compositor->setTarget(context, window()); + compositor->setTarget(context, window(), screen->geometryForSurface()); + compositor->setRotation(qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION")); // If there is a "root" window into which raster and QOpenGLWidget content is // composited, all other contexts must share with its context. if (!qt_gl_global_share_context()) { @@ -189,7 +190,8 @@ void QEglFSWindow::resetSurface() m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat); m_format = q_glFormatFromConfig(display, m_config, platformFormat); - m_window = qt_egl_device_integration()->createNativeWindow(this, screen()->geometry().size(), m_format); + const QSize surfaceSize = screen()->geometryForSurface().size(); + m_window = qt_egl_device_integration()->createNativeWindow(this, surfaceSize, m_format); m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL); } |