summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-11-20 16:06:13 +0100
committerAndras Timar <andras.timar@collabora.com>2020-05-18 17:43:03 +0200
commite688b4259deacd8005d98f8497ea3101ffe4fd11 (patch)
tree9da19854a35fdc0901e4527f13ec0bf1a952b5bf
parent68fc9688f36f420e16f87de4da3b3ce75288b76c (diff)
android: Introduce --enable-android-lok configure switch to fix RGB vs. BGR.
This indicates that the build targets the Online-based Android app, for which we need to avoid various tweaks that are needed for the 'old' Android app present in the android/ subdir of core.git. In particular, the switch used in this patch fixes a RGBA vs. BGRA confusion that caused yellow <-> cyan switch in the Online-based Android app. Change-Id: I5f394868f51ce87013677834cfafb967b9bb333e Reviewed-on: https://gerrit.libreoffice.org/83342 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 49002a143a4534df5f6139e07fefd06174621c59) Reviewed-on: https://gerrit.libreoffice.org/83718 Tested-by: Jenkins
-rw-r--r--config_host.mk.in1
-rw-r--r--config_host/config_features.h.in6
-rw-r--r--configure.ac19
-rw-r--r--external/cairo/UnpackedTarball_cairo.mk3
-rw-r--r--vcl/headless/svpgdi.cxx4
-rw-r--r--vcl/inc/headless/svpgdi.hxx4
6 files changed, 34 insertions, 3 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index e47ca617845d..de1e44dc657b 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 90536560c0b4..42fc0efaa144 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -146,4 +146,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 29e7a815dd25..47714298a438 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,6 +545,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 b6f59a29d6be..b6571382ccd9 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>
@@ -228,7 +230,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 d06c138a0284..083ab54a30a9 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