diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2015-07-29 16:24:40 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2015-07-31 12:08:32 +0000 |
commit | 084a1ed4e932b4ec30172397b9f109e4dd7d4466 (patch) | |
tree | 1849878756ff68b96db43bbf4c155ae2260ee212 /src/core/gl_context_qt.cpp | |
parent | 6af8a66af927677e65a5685b0fdee1e36eb93cd6 (diff) |
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 <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/gl_context_qt.cpp')
-rw-r--r-- | src/core/gl_context_qt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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) |