diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-04 13:53:10 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 20:47:57 +0100 |
commit | 355ef66c35350c04147a0b05f3116dca7477aa2c (patch) | |
tree | 3c87489e9decf4fd5ff7f4870ca273ad56d70491 /src/core | |
parent | 5d66b66df1bc205a9ce3d25cfaaa84c961fa7a29 (diff) |
Add Android specific build settings and command line switches
Although this is an unsupported platfrom for QtWebEngine
it is needed for Boot2Qt-Android and can live upstream.
Change-Id: I21fea1fd00c1206e3b56373349b30df5ee121fda
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/backing_store_qt.cpp | 5 | ||||
-rw-r--r-- | src/core/gyp_run.pro | 10 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 7 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/core/backing_store_qt.cpp b/src/core/backing_store_qt.cpp index b12f09f18..613dfdbbc 100644 --- a/src/core/backing_store_qt.cpp +++ b/src/core/backing_store_qt.cpp @@ -121,7 +121,12 @@ void BackingStoreQt::PaintToBackingStore(content::RenderProcessHost *process, , copy_rect_dst.width() , copy_rect_dst.height()); +#if defined(OS_ANDROID) + // The received image format is BGRA with Android so we have to swizzle the image data. + painter.drawImage(destination, img.rgbSwapped(), source); +#else painter.drawImage(destination, img, source); +#endif } } diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index ae964ea1a..258d2f7c2 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -8,6 +8,16 @@ GYP_ARGS = "-D qt_cross_compile=0" cross_compile { GYP_ARGS = "-D qt_cross_compile=1 -D os_posix=1" TOOLCHAIN_SYSROOT = $$[QT_SYSROOT] + + linux-android { + CC = $$which($$QMAKE_CC) + ANDROID_TOOLCHAIN = $$dirname(CC) + TOOLCHAIN_SYSROOT = $$ANDROID_BUILD_TOP + + GYP_ARGS += "-D android_src=\"$${ANDROID_BUILD_TOP}\" -D android_toolchain=\"$${ANDROID_TOOLCHAIN}\"" \ + "-D android_ndk_root=\"$${ANDROID_BUILD_TOP}\" -D android_product_out=\"$${ANDROID_PRODUCT_OUT}\"" + } + !isEmpty(TOOLCHAIN_SYSROOT): GYP_ARGS += "-D sysroot=\"$${TOOLCHAIN_SYSROOT}\"" contains(QT_ARCH, "arm") { diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index dbaa948bf..03da61643 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -122,6 +122,13 @@ WebEngineContext::WebEngineContext(WebContentsAdapterClient::RenderingMode rende parsedCommandLine->AppendSwitch(switches::kInProcessGPU); } +#if defined(OS_ANDROID) + // Force single-process mode for now. + parsedCommandLine->AppendSwitch(switches::kSingleProcess); + // This is needed so that we do not assert in single process mode. + parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing); +#endif + // Tell Chromium to use EGL instead of GLX if the Qt xcb plugin also does. if (qApp->platformName() == QStringLiteral("xcb") && qApp->platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("egldisplay"), 0)) parsedCommandLine->AppendSwitchASCII(switches::kUseGL, gfx::kGLImplementationEGLName); |