From 11a6270079657e40ff57d47be1eef6cb09a40d23 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 24 Mar 2014 20:03:22 +0100 Subject: [PATCH] eglfs: Add a way to force 24/32 bit configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some embedded devices do not play nicely with 16-bit (565) EGL configurations, resulting in ugly banding in Quick apps. Add a QT_QPA_EGLFS_FORCE888 environment variable that can be set on systems where it is known that only 24 or 32 bit configs provide acceptable results. Change-Id: I7b8d7b9a2cd40b51a844d0795b7156b735e18ebb Reviewed-by: Jørgen Lind --- src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index dfb766db32..4aa3f29260 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -141,7 +141,16 @@ QImage::Format QEglFSHooks::screenFormat() const QSurfaceFormat QEglFSHooks::surfaceFormatFor(const QSurfaceFormat &inputFormat) const { - return inputFormat; + QSurfaceFormat format = inputFormat; + + static const bool force888 = qgetenv("QT_QPA_EGLFS_FORCE888").toInt(); + if (force888) { + format.setRedBufferSize(8); + format.setGreenBufferSize(8); + format.setBlueBufferSize(8); + } + + return format; } bool QEglFSHooks::filterConfig(EGLDisplay, EGLConfig) const