diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-11-11 11:55:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-11-11 15:37:35 +0000 |
commit | c27374541e289962df6947967b97178bfa63e9f7 (patch) | |
tree | 2f4254eb30b9c5c3eef8ac9f770ddf26c6a5d992 /src/core/web_engine_context.cpp | |
parent | e70b59112104b72e794c20f7c715482809780d32 (diff) | |
parent | 39f7ce19dbce34dfa7e730d6fa743d88109c3369 (diff) |
Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7fe8fb612..491835e45 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -309,8 +309,10 @@ WebEngineContext::WebEngineContext() if (useEmbeddedSwitches) { // Inspired by the Android port's default switches - parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); - parsedCommandLine->AppendSwitch(switches::kEnablePinch); + if (!parsedCommandLine->HasSwitch(switches::kDisableOverlayScrollbar)) + parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); + if (!parsedCommandLine->HasSwitch(switches::kDisablePinch)) + parsedCommandLine->AppendSwitch(switches::kEnablePinch); parsedCommandLine->AppendSwitch(switches::kEnableViewport); parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode); @@ -325,7 +327,7 @@ WebEngineContext::WebEngineContext() const char *glType = 0; #ifndef QT_NO_OPENGL 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 = gl::kGLImplementationEGLName; @@ -359,16 +361,7 @@ WebEngineContext::WebEngineContext() glType = gl::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 = gl::kGLImplementationDesktopName; - break; - case QOpenGLContext::LibGLES: - glType = gl::kGLImplementationEGLName; - break; - } + qWarning("WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed."); } } #endif |