diff options
author | Andy Nichols <andy.nichols@qt.io> | 2016-08-10 17:56:10 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-10-02 08:40:22 +0000 |
commit | 7d19f3b647f4e5ac4b5f0d2278703476f5a9ed1c (patch) | |
tree | 8f770c11fe270d71be7ab712ffc33df9d7bec53c /src/core/api | |
parent | 2ec47c9921a1e381943159f540b45c105d2ff1db (diff) |
Fix building when QT_NO_OPENGL is defined
Task-number: QTBUG-54327
Change-Id: I759598d56aa0a74b64092365b422a743fb508ac6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/api')
-rw-r--r-- | src/core/api/qtwebenginecoreglobal.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 <QGuiApplication> -#include <QOpenGLContext> +#ifndef QT_NO_OPENGL +# include <QOpenGLContext> +#endif #include <QThread> +#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 |