Skip to content

Instantly share code, notes, and snippets.

@penk
Created March 19, 2014 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penk/9637176 to your computer and use it in GitHub Desktop.
Save penk/9637176 to your computer and use it in GitHub Desktop.
diff -ru qtbase-opensource-src-5.0.0-beta1/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp qtbase-opensource-src-5.0.0-beta1-hackeglfs/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
--- qtbase-opensource-src-5.0.0-beta1/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp 2012-08-28 21:40:54.000000000 +0200
+++ qtbase-opensource-src-5.0.0-beta1-hackeglfs/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp 2012-10-06 14:50:22.748034778 +0200
@@ -130,7 +130,20 @@
QSurfaceFormat QEglFSHooks::surfaceFormatFor(const QSurfaceFormat &inputFormat) const
{
- return inputFormat;
+ QSurfaceFormat newFormat = inputFormat;
+ QByteArray depthString = qgetenv("QT_QPA_EGLFS_DEPTH");
+ if (depthString.toInt() == 16) {
+ newFormat.setRedBufferSize(5);
+ newFormat.setGreenBufferSize(6);
+ newFormat.setBlueBufferSize(5);
+ } else {
+ newFormat.setStencilBufferSize(8);
+ newFormat.setRedBufferSize(8);
+ newFormat.setGreenBufferSize(8);
+ newFormat.setBlueBufferSize(8);
+ }
+
+ return newFormat;
}
EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment