summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfshooks_stub.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
index d0e3e4546d..fbc02d1a01 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
@@ -61,6 +61,39 @@ QSize QEglFSHooks::screenSize() const
return QSize();
}
+int QEglFSHooks::screenDepth() const
+{
+ static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
+ return depth == 16 ? 16 : 32;
+}
+
+QImage::Format QEglFSHooks::screenFormat() const
+{
+ return screenDepth() == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32;
+}
+
+QSurfaceFormat QEglFSHooks::defaultSurfaceFormat() const
+{
+ QSurfaceFormat format;
+ if (screenDepth() == 16) {
+ format.setDepthBufferSize(16);
+ format.setRedBufferSize(5);
+ format.setGreenBufferSize(6);
+ format.setBlueBufferSize(5);
+ } else {
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ format.setRedBufferSize(8);
+ format.setGreenBufferSize(8);
+ format.setBlueBufferSize(8);
+ }
+
+ static int samples = qgetenv("QT_QPA_EGLFS_MULTISAMPLE").toInt();
+ format.setSamples(samples);
+
+ return format;
+}
+
EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size)
{
Q_UNUSED(size);