From 84ecc17152968f7fafe2de27599fb10589534c78 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Fri, 1 Jun 2018 09:36:37 -0400 Subject: QNX: Add the ability to disable EGL_KHR_surfaceless_context use QML fails to draw when this is used on at least one jacinto6 platform. Works when it's disabled. Task-number: QTBUG-68227 Change-Id: I7b3c081d4d5a4fe22136f4bdd8ad1f34495cd94a Reviewed-by: Adam Treat Reviewed-by: Janne Koskinen Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxglcontext.cpp | 13 ++++++++++++- src/plugins/platforms/qnx/qqnxintegration.cpp | 4 ++++ src/plugins/platforms/qnx/qqnxintegration.h | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index d4493943e2..2031de308c 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qqnxglcontext.h" +#include "qqnxintegration.h" #include "qqnxscreen.h" #include "qqnxeglwindow.h" @@ -59,8 +60,18 @@ QT_BEGIN_NAMESPACE EGLDisplay QQnxGLContext::ms_eglDisplay = EGL_NO_DISPLAY; +static QEGLPlatformContext::Flags makeFlags() +{ + QEGLPlatformContext::Flags result = 0; + + if (!QQnxIntegration::options().testFlag(QQnxIntegration::SurfacelessEGLContext)) + result |= QEGLPlatformContext::NoSurfaceless; + + return result; +} + QQnxGLContext::QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share) - : QEGLPlatformContext(format, share, ms_eglDisplay) + : QEGLPlatformContext(format, share, ms_eglDisplay, 0, QVariant(), makeFlags()) { } diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 6085cd34c0..dc4ebdf699 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -117,6 +117,10 @@ static inline QQnxIntegration::Options parseOptions(const QStringList ¶mList options |= QQnxIntegration::RootWindow; } + if (!paramList.contains(QLatin1String("disable-EGL_KHR_surfaceless_context"))) { + options |= QQnxIntegration::SurfacelessEGLContext; + } + return options; } diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h index f11afa1748..f844a7508c 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.h +++ b/src/plugins/platforms/qnx/qqnxintegration.h @@ -81,7 +81,8 @@ public: NoOptions = 0x0, FullScreenApplication = 0x1, RootWindow = 0x2, - AlwaysFlushScreenContext = 0x4 + AlwaysFlushScreenContext = 0x4, + SurfacelessEGLContext = 0x8 }; Q_DECLARE_FLAGS(Options, Option) explicit QQnxIntegration(const QStringList ¶mList); -- cgit v1.2.3