summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-11 09:08:50 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-11 12:05:38 +0100
commit39f7ce19dbce34dfa7e730d6fa743d88109c3369 (patch)
tree8b99513fe8a906807a0e3fac2780b9d1e6a63827 /src/core/web_engine_context.cpp
parent6c941affb2dd263d929b69afae3a0b9664869a9d (diff)
parent2d49b1b20f3275316310df599f1363ac86b8f078 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/core/content_browser_client_qt.cpp src/core/content_browser_client_qt.h src/core/gl_surface_qt.cpp src/core/print_view_manager_qt.cpp src/core/web_contents_delegate_qt.cpp src/core/web_engine_context.cpp src/webengine/doc/src/qtwebengine-overview.qdoc src/webengine/doc/src/qtwebengine-platform-notes.qdoc src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp src/webenginewidgets/webenginewidgets.pro sync.profile Change-Id: I44495f4d899580c882d6b86d68d7f6b77c8e91f6
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp19
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