diff options
author | Jan Holesovsky <kendy@collabora.com> | 2019-04-12 17:50:52 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-10-09 10:38:55 +0200 |
commit | a4fc6e8d529ab4f90218188bef3515d0f04b50f1 (patch) | |
tree | 3b37beb91697e81d4a6ec800d8834ee7d81803bf /desktop | |
parent | 7bef173a057372ea1b51f7358fc7df439e59a10f (diff) |
android: Make the tiled rendering from the loolwsd actually work.
Not to break the 'old' Android app, introduce a bool that can indicate
if we are using the LOK from the 'old' (LOK-via-JNI-based) or from the
'new' (loolwsd-based) app.
Change-Id: I38bd665cc1d5bc88018574171443ecabc46763df
Reviewed-on: https://gerrit.libreoffice.org/70678
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/80273
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index aadafe279a43..463371414214 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2661,6 +2661,13 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, } } +#if defined(ANDROID) +/// For the distinction if the LOK is used for the 'old' (JNI-based) or the +/// 'new' (loolwsd-based) app. Default to the 'new', ie. not used from JNI as +/// implemented in sal/android/libreofficekit-jni.c. +bool android_lok_from_jni = false; +#endif + static void doc_paintTile(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, const int nCanvasWidth, const int nCanvasHeight, @@ -2704,10 +2711,15 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, #else ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT) ; -#if !defined(ANDROID) - // Set background to transparent by default. - pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); +#if defined(ANDROID) + if (!android_lok_from_jni) #endif + { + // Set background to transparent by default. + // [Unless it is the 'old' (JNI-based) Android app - no idea why it + // needs avoiding this.] + pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); + } pDevice->SetOutputSizePixelScaleOffsetAndBuffer( Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), |