summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-10-07 14:42:13 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-10-07 14:42:13 +0200
commitc235ecf5bae30fbd88845ec60e2ba2eaf2e8079e (patch)
tree1d5867ca78463e942498a75d4b818e4796ff6b46 /src/plugins/platforms/eglfs
parent9cde8061eb5684285d086a03f0ee8de06f24c7e0 (diff)
Make it possible to choose some EGLFS configuration options via envvars
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
index b31b204c2f..682f2f4a67 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);