[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - config_host/config_features.h.in config_host.mk.in configure.ac external/cairo vcl/headless vcl/inc

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 25 21:32:02 UTC 2019


 config_host.mk.in                       |    1 +
 config_host/config_features.h.in        |    6 ++++++
 configure.ac                            |   19 +++++++++++++++++++
 external/cairo/UnpackedTarball_cairo.mk |    3 ++-
 vcl/headless/svpgdi.cxx                 |    4 +++-
 vcl/inc/headless/svpgdi.hxx             |    4 +++-
 6 files changed, 34 insertions(+), 3 deletions(-)

New commits:
commit 49002a143a4534df5f6139e07fefd06174621c59
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Nov 20 16:06:13 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon Nov 25 22:31:17 2019 +0100

    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 at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 044b3222f304..b05ad09efed0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -113,6 +113,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 3d504b945ddc..4d17f7417fc0 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -173,4 +173,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 3c3291d8a5b2..1d848685cfef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -525,6 +525,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 2807cebd177c..7d3537bbc4fb 100644
--- a/external/cairo/UnpackedTarball_cairo.mk
+++ b/external/cairo/UnpackedTarball_cairo.mk
@@ -24,7 +24,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 ae605252abe7..1b89dde1fac0 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>
@@ -211,7 +213,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 d4f03355258b..9ee269aa18a5 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 <vcl/metric.hxx>
@@ -41,7 +43,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


More information about the Libreoffice-commits mailing list