diff options
-rw-r--r-- | src/core/core_gyp_generator.pro | 2 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 34 |
2 files changed, 20 insertions, 16 deletions
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index 4ab1b7b98..90d748c4b 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -18,7 +18,7 @@ DEFINES += QT_NO_KEYWORDS \ # Assume that we want mobile touch and low-end hardware behaviors # whenever we are cross compiling. -cross_compile: DEFINES += QTWEBENGINE_MOBILE_SWITCHES +cross_compile: DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES contains(QT_CONFIG, egl): CONFIG += egl else: DEFINES += QT_NO_EGL diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 10d6bdd74..f3659a7d2 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -185,6 +185,11 @@ WebEngineContext::WebEngineContext() Q_FOREACH (const QString& arg, QCoreApplication::arguments()) args << arg.toUtf8(); + bool useEmbeddedSwitches = args.removeAll("--enable-embedded-switches"); +#if defined(QTWEBENGINE_EMBEDDED_SWITCHES) + useEmbeddedSwitches = !args.removeAll("--disable-embedded-switches"); +#endif + QVector<const char*> argv(args.size()); for (int i = 0; i < args.size(); ++i) argv[i] = args[i].constData(); @@ -198,21 +203,20 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing); parsedCommandLine->AppendSwitch(switches::kInProcessGPU); -#if defined(QTWEBENGINE_MOBILE_SWITCHES) - // Inspired by the Android port's default switches - parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); - parsedCommandLine->AppendSwitch(switches::kEnablePinch); - parsedCommandLine->AppendSwitch(switches::kEnableViewport); - parsedCommandLine->AppendSwitch(switches::kEnableViewportMeta); - parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); - parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode); - parsedCommandLine->AppendSwitch(switches::kDisableGpuShaderDiskCache); - parsedCommandLine->AppendSwitch(switches::kDisable2dCanvasAntialiasing); - parsedCommandLine->AppendSwitch(switches::kEnableImplSidePainting); - parsedCommandLine->AppendSwitch(cc::switches::kDisableCompositedAntialiasing); - - parsedCommandLine->AppendSwitchASCII(switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); -#endif + if (useEmbeddedSwitches) { + // Inspired by the Android port's default switches + parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); + parsedCommandLine->AppendSwitch(switches::kEnablePinch); + parsedCommandLine->AppendSwitch(switches::kEnableViewport); + parsedCommandLine->AppendSwitch(switches::kEnableViewportMeta); + parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); + parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode); + parsedCommandLine->AppendSwitch(switches::kDisableGpuShaderDiskCache); + parsedCommandLine->AppendSwitch(switches::kDisable2dCanvasAntialiasing); + parsedCommandLine->AppendSwitch(switches::kEnableImplSidePainting); + parsedCommandLine->AppendSwitch(cc::switches::kDisableCompositedAntialiasing); + parsedCommandLine->AppendSwitchASCII(switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); + } GLContextHelper::initialize(); |