diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-10-07 12:42:13 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-10-07 12:42:13 (GMT) |
commit | c235ecf5bae30fbd88845ec60e2ba2eaf2e8079e (patch) | |
tree | 1d5867ca78463e942498a75d4b818e4796ff6b46 | |
parent | 9cde8061eb5684285d086a03f0ee8de06f24c7e0 (diff) | |
download | Qt-c235ecf5bae30fbd88845ec60e2ba2eaf2e8079e.zip Qt-c235ecf5bae30fbd88845ec60e2ba2eaf2e8079e.tar.gz Qt-c235ecf5bae30fbd88845ec60e2ba2eaf2e8079e.tar.bz2 |
Make it possible to choose some EGLFS configuration options via envvars
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsscreen.cpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index b31b204..682f2f4 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE -//#define QEGL_EXTRA_DEBUG +// #define QEGL_EXTRA_DEBUG #ifdef QEGL_EXTRA_DEBUG struct AttrInfo { EGLint attr; const char *name; }; @@ -116,12 +116,36 @@ QEglFSScreen::QEglFSScreen(EGLNativeDisplayType display) qWarning("Initialized display %d %d\n", major, minor); QPlatformWindowFormat platformFormat; - platformFormat.setDepth(32); platformFormat.setWindowApi(QPlatformWindowFormat::OpenGL); - platformFormat.setRedBufferSize(8); - platformFormat.setGreenBufferSize(8); - platformFormat.setBlueBufferSize(8); - platformFormat.setSwapInterval(1); + + QByteArray depthString = qgetenv("QT_QPA_EGLFS_DEPTH"); + if (depthString.toInt() == 16) { + platformFormat.setDepth(16); + platformFormat.setRedBufferSize(5); + platformFormat.setGreenBufferSize(6); + platformFormat.setBlueBufferSize(5); + m_depth = 16; + m_format = QImage::Format_RGB16; + } else { + platformFormat.setDepth(32); + platformFormat.setRedBufferSize(8); + platformFormat.setGreenBufferSize(8); + platformFormat.setBlueBufferSize(8); + } + + if (!qgetenv("QT_QPA_EGLFS_MULTISAMPLE").isEmpty()) { + platformFormat.setSampleBuffers(true); + } + + int swapInterval = 1; + QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL"); + if (!swapIntervalString.isEmpty()) { + bool ok; + swapInterval = swapIntervalString.toInt(&ok); + if (!ok) + swapInterval = 1; + } + platformFormat.setSwapInterval(swapInterval); EGLConfig config = q_configFromQPlatformWindowFormat(m_dpy, platformFormat); |