diff options
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | config_host/config_features.h.in | 6 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | external/cairo/UnpackedTarball_cairo.mk | 3 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 4 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 4 |
6 files changed, 34 insertions, 3 deletions
diff --git a/config_host.mk.in b/config_host.mk.in index be3ba171c703..a8fba104e23f 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -118,6 +118,7 @@ export DO_FETCH_TARBALLS=@DO_FETCH_TARBALLS@ export DPKG=@DPKG@ export EBOOK_CFLAGS=$(gb_SPACE)@EBOOK_CFLAGS@ export EBOOK_LIBS=$(gb_SPACE)@EBOOK_LIBS@ +export ENABLE_ANDROID_LOK=@ENABLE_ANDROID_LOK@ export ENABLE_ANDROID_EDITING=@ENABLE_ANDROID_EDITING@ export ENABLE_AVAHI=@ENABLE_AVAHI@ export ENABLE_BREAKPAD=@ENABLE_BREAKPAD@ diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in index 85196574021b..c0d24e392eae 100644 --- a/config_host/config_features.h.in +++ b/config_host/config_features.h.in @@ -151,4 +151,10 @@ */ #define HAVE_FEATURE_UPDATE_MAR 0 +/* + * Whether we are avoiding the tweaks needed for the Android app from the + * android/ subdir. + */ +#define HAVE_FEATURE_ANDROID_LOK 0 + #endif diff --git a/configure.ac b/configure.ac index 04f8330a9ac8..624fcaae5213 100644 --- a/configure.ac +++ b/configure.ac @@ -544,6 +544,25 @@ if test -n "$with_android_sdk"; then fi AC_SUBST(ANDROID_SDK_HOME) +AC_ARG_ENABLE([android-lok], + AS_HELP_STRING([--enable-android-lok], + [The Android app from the android/ subdir needs several tweaks all + over the place that break the LOK when used in the Online-based + Android app. This switch indicates that the intent of this build is + actually the Online-based, non-modified LOK.]) +) +ENABLE_ANDROID_LOK= +if test -n "$ANDROID_NDK_HOME" ; then + if test "$enable_android_lok" = yes; then + ENABLE_ANDROID_LOK=TRUE + AC_DEFINE(HAVE_FEATURE_ANDROID_LOK) + AC_MSG_NOTICE([building the Android version... for the Online-based Android app]) + else + AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir]) + fi +fi +AC_SUBST([ENABLE_ANDROID_LOK]) + libo_FUZZ_ARG_ENABLE([android-editing], AS_HELP_STRING([--enable-android-editing], [Enable the experimental editing feature on Android.]) diff --git a/external/cairo/UnpackedTarball_cairo.mk b/external/cairo/UnpackedTarball_cairo.mk index 9cd795fc4a0b..8e45e9c28c1d 100644 --- a/external/cairo/UnpackedTarball_cairo.mk +++ b/external/cairo/UnpackedTarball_cairo.mk @@ -23,7 +23,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,cairo,\ )) endif -ifeq ($(OS),ANDROID) +# To be applied only when ENABLE_ANDROID_LOK is not defined +ifeq ($(OS)$(ENABLE_ANDROID_LOK),ANDROID) $(eval $(call gb_UnpackedTarball_add_patches,cairo,\ external/cairo/cairo/cairo.GL_RGBA.patch \ )) diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 02d1373b7ef3..bef205b45e6b 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <memory> #ifndef IOS #include <headless/svpgdi.hxx> @@ -216,7 +218,7 @@ namespace sal_uInt8* pD = pDst->mpBits + y * pDst->mnScanlineSize; for (long x = 0; x < nWidth; ++x) { -#if defined ANDROID +#if defined(ANDROID) && !HAVE_FEATURE_ANDROID_LOK static_assert((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcRgba, "Expected SVP_CAIRO_FORMAT set to N32BitTcBgra"); static_assert((SVP_24BIT_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N24BitTcRgb, "Expected SVP_24BIT_FORMAT set to N24BitTcRgb"); pD[0] = pS[0]; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 444169009e5e..bb0d3d5f4233 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -24,6 +24,8 @@ #error This file is not for iOS #endif +#include <config_features.h> + #include <osl/endian.h> #include <vcl/sysdata.hxx> #include <config_cairo_canvas.h> @@ -40,7 +42,7 @@ //cairo then matches the OpenGL GL_RGBA format so we can use it there //where we don't have GL_BGRA support. // SVP_24BIT_FORMAT is used to store 24-bit images in 3-byte pixels to conserve memory. -#if defined ANDROID +#if defined(ANDROID) && !HAVE_FEATURE_ANDROID_LOK # define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown) # define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcRgba | ScanlineFormat::TopDown) # define SVP_CAIRO_BLUE 1 |