summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_engine_context.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 3289a3c23..629490440 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -265,7 +265,7 @@ WebEngineContext::WebEngineContext()
const char *glType = 0;
if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) {
- if (qt_gl_global_share_context()) {
+ if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) {
if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) {
if (qt_gl_global_share_context()->isOpenGLES()) {
glType = gfx::kGLImplementationEGLName;
@@ -299,16 +299,7 @@ WebEngineContext::WebEngineContext()
glType = gfx::kGLImplementationDesktopName;
}
} else {
- qWarning("WebEngineContext used before QtWebEngine::initialize()");
- // We have to assume the default OpenGL module type will be used.
- switch (QOpenGLContext::openGLModuleType()) {
- case QOpenGLContext::LibGL:
- glType = gfx::kGLImplementationDesktopName;
- break;
- case QOpenGLContext::LibGLES:
- glType = gfx::kGLImplementationEGLName;
- break;
- }
+ qWarning("WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.");
}
}