From 084a1ed4e932b4ec30172397b9f109e4dd7d4466 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 29 Jul 2015 16:24:40 +0200 Subject: Fix error message for OpenGL resource sharing Method nativeResourceForContext() fails if share context is not set. It may be called earlier than method ShareGroupQtQuick::AboutToAddFirstContext() that performs the same check. Change-Id: Ib1eaabc83e59c75a7610ba214b81e50aa4984baa Reviewed-by: Andras Becsi --- src/core/gl_context_qt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp index baccddc9d..b350c3c5b 100644 --- a/src/core/gl_context_qt.cpp +++ b/src/core/gl_context_qt.cpp @@ -60,7 +60,11 @@ namespace { inline void *resourceForContext(const QByteArray &resource) { - return qApp->platformNativeInterface()->nativeResourceForContext(resource, qt_gl_global_share_context()); + QOpenGLContext *shareContext = qt_gl_global_share_context(); + if (!shareContext) { + qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function."); + } + return qApp->platformNativeInterface()->nativeResourceForContext(resource, shareContext); } inline void *resourceForIntegration(const QByteArray &resource) -- cgit v1.2.3