diff options
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/api/qtwebengineglobal.cpp | 12 | ||||
-rw-r--r-- | src/webengine/render_widget_host_view_qt_delegate_quick.cpp | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index 4aa72ba6f..7340d32d1 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -41,8 +41,10 @@ #include "qtwebengineglobal.h" -#include <private/qsgcontext_p.h> #include <QGuiApplication> +#include <QThread> +#include <private/qopenglcontext_p.h> +#include <private/qsgcontext_p.h> static QOpenGLContext *shareContext; @@ -56,11 +58,11 @@ void QWebEngine::initialize() { QCoreApplication *app = QCoreApplication::instance(); if (!app) { - qFatal("QWebEngine::initialize() must be called after the construction of the application object."); + qFatal("QWebEngine(Widgets)::initialize() must be called after the construction of the application object."); return; } if (app->thread() != QThread::currentThread()) { - qFatal("QWebEngine::initialize() must be called from the Qt gui thread."); + qFatal("QWebEngine(Widgets)::initialize() must be called from the Qt gui thread."); return; } @@ -70,6 +72,10 @@ void QWebEngine::initialize() shareContext = new QOpenGLContext; shareContext->create(); qAddPostRoutine(deleteShareContext); +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) QSGContext::setSharedOpenGLContext(shareContext); +#else + QOpenGLContextPrivate::setGlobalShareContext(shareContext); +#endif } diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index 693b12e07..e2804ef9b 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -66,7 +66,7 @@ void RenderWidgetHostViewQtDelegateQuick::itemChange(ItemChange change, const It QSGNode *RenderWidgetHostViewQtDelegateQuick::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { - return m_client->updatePaintNode(oldNode, QQuickItem::window()); + return m_client->updatePaintNode(oldNode, QQuickWindowPrivate::get(QQuickItem::window())->context); } RenderWidgetHostViewQtDelegateQuickPainted::RenderWidgetHostViewQtDelegateQuickPainted(RenderWidgetHostViewQtDelegateClient *client, bool isPopup) |