diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-11-11 11:24:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-11-11 11:24:20 +0100 |
commit | c254868dc2bd5772494a48686ebbc3e867a86adf (patch) | |
tree | 76c33df85ab2ef13e44f7677b43439c7b0d3b36a /src/webengine/api/qtwebengineglobal.cpp | |
parent | fca9015175950b04bafb9b3af7d4e693eb0243d9 (diff) | |
parent | aa1b2d20a80f53ce5e7f6097114d41a018d9350b (diff) | |
download | qtwebengine-c254868dc2bd5772494a48686ebbc3e867a86adf.tar.gz |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/core/browser_context_qt.cpp
src/webengine/api/qquickwebengineview_p.h
Change-Id: I73bdec03b627b282851d7dda12006d4ab631072c
Diffstat (limited to 'src/webengine/api/qtwebengineglobal.cpp')
-rw-r--r-- | src/webengine/api/qtwebengineglobal.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index ea119bba6..b179da2fe 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context); +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); namespace QtWebEngine { @@ -54,8 +55,20 @@ static void deleteShareContext() shareContext = 0; } +// ### 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 +// the same need but the flag has to be set earlier. void initialize() { +#ifdef Q_OS_WIN32 + qputenv("QT_D3DCREATE_MULTITHREADED", "1"); +#endif + + // No need to override the shared context if QApplication already set one (e.g with Qt::AA_ShareOpenGLContexts). + if (qt_gl_global_share_context()) + return; + QCoreApplication *app = QCoreApplication::instance(); if (!app) { qFatal("QWebEngine(Widgets)::initialize() must be called after the construction of the application object."); @@ -69,10 +82,6 @@ void initialize() if (shareContext) return; -#ifdef Q_OS_WIN32 - qputenv("QT_D3DCREATE_MULTITHREADED", "1"); -#endif - shareContext = new QOpenGLContext; shareContext->create(); qAddPostRoutine(deleteShareContext); |