From 7d19f3b647f4e5ac4b5f0d2278703476f5a9ed1c Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Wed, 10 Aug 2016 17:56:10 +0200 Subject: Fix building when QT_NO_OPENGL is defined Task-number: QTBUG-54327 Change-Id: I759598d56aa0a74b64092365b422a743fb508ac6 Reviewed-by: Qt CI Bot Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qtwebenginecoreglobal.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/api') diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp index f5d1e6d39..072f27967 100644 --- a/src/core/api/qtwebenginecoreglobal.cpp +++ b/src/core/api/qtwebenginecoreglobal.cpp @@ -40,16 +40,20 @@ #include "qtwebenginecoreglobal_p.h" #include -#include +#ifndef QT_NO_OPENGL +# include +#endif #include +#ifndef QT_NO_OPENGL QT_BEGIN_NAMESPACE Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context); Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); QT_END_NAMESPACE +#endif namespace QtWebEngineCore { - +#ifndef QT_NO_OPENGL static QOpenGLContext *shareContext; static void deleteShareContext() @@ -58,6 +62,7 @@ static void deleteShareContext() shareContext = 0; } +#endif // ### Qt 6: unify this logic and Qt::AA_ShareOpenGLContexts. // QtWebEngine::initialize was introduced first and meant to be called // after the QGuiApplication creation, when AA_ShareOpenGLContexts fills @@ -65,6 +70,7 @@ static void deleteShareContext() QWEBENGINE_PRIVATE_EXPORT void initialize() { +#ifndef QT_NO_OPENGL #ifdef Q_OS_WIN32 qputenv("QT_D3DCREATE_MULTITHREADED", "1"); #endif @@ -100,5 +106,6 @@ QWEBENGINE_PRIVATE_EXPORT void initialize() // Classes like QOpenGLWidget check for the attribute app->setAttribute(Qt::AA_ShareOpenGLContexts); +#endif // QT_NO_OPENGL } } // namespace QtWebEngineCore -- cgit v1.2.3