[Libreoffice-commits] core.git: config_host/config_skia.h.in config_host.mk.in configure.ac external/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed May 6 12:20:58 UTC 2020


 config_host.mk.in             |    1 +
 config_host/config_skia.h.in  |    2 ++
 configure.ac                  |   11 +++++++++--
 external/skia/Library_skia.mk |   10 ++++++++++
 4 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit da2116dd2eeaedbd8d22f6f46da56ce212e2be15
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed May 6 10:35:54 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed May 6 14:20:19 2020 +0200

    always build Skia optimized, unless --enable-skia=debug
    
    In raster mode the performance may make quite a difference, this is
    the drawing library (that's now the Windows default) and LO developers
    mostly do not need to debug Skia itself.
    
    Change-Id: I42f0407d37a2294b062a41d94566e8a4f5f4354b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93557
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 51fc419414e6..7df26713a1dd 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -207,6 +207,7 @@ export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@
 export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@
 export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
 export ENABLE_SKIA=@ENABLE_SKIA@
+export ENABLE_SKIA_DEBUG=@ENABLE_SKIA_DEBUG@
 export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
 export ENABLE_VALGRIND=@ENABLE_VALGRIND@
 export ENABLE_VLC=@ENABLE_VLC@
diff --git a/config_host/config_skia.h.in b/config_host/config_skia.h.in
index 2f39dbd13c29..f079e26cab8f 100644
--- a/config_host/config_skia.h.in
+++ b/config_host/config_skia.h.in
@@ -39,6 +39,8 @@ are the same.
 #define SK_ASSUME_GL_ES 0
 
 
+// Enable Skia's internal checks depending on DBG_UTIL mode. ENABLE_SKIA_DEBUG
+// controls whether to build with or without optimizations (set in Makefile).
 #ifdef DBG_UTIL
 
 #define SK_DEBUG
diff --git a/configure.ac b/configure.ac
index 1c7dff3f5d0d..40a5a2e62ed5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1076,7 +1076,7 @@ libo_FUZZ_ARG_ENABLE(pdfium,
 
 libo_FUZZ_ARG_ENABLE(skia,
     AS_HELP_STRING([--disable-skia],
-        [Disable building Skia.])
+        [Disable building Skia. Use --enable-skia=debug to build without optimizations.])
 )
 
 ###############################################################################
@@ -11119,7 +11119,13 @@ AC_SUBST(POPPLER_LIBS)
 AC_MSG_CHECKING([whether to build Skia])
 ENABLE_SKIA=
 if test "$enable_skia" != "no" -a "$build_skia" = "yes"; then
-    AC_MSG_RESULT([yes])
+    if test "$enable_skia" = "debug"; then
+        AC_MSG_RESULT([yes (debug)])
+        ENABLE_SKIA_DEBUG=TRUE
+    else
+        AC_MSG_RESULT([yes])
+        ENABLE_SKIA_DEBUG=
+    fi
     ENABLE_SKIA=TRUE
     AC_DEFINE(HAVE_FEATURE_SKIA)
     BUILD_TYPE="$BUILD_TYPE SKIA"
@@ -11127,6 +11133,7 @@ else
     AC_MSG_RESULT([no])
 fi
 AC_SUBST(ENABLE_SKIA)
+AC_SUBST(ENABLE_SKIA_DEBUG)
 
 CLANG_CXXFLAGS_INTRINSICS_SSE2=
 CLANG_CXXFLAGS_INTRINSICS_SSSE3=
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 941f92bd9238..6047de0b864b 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -22,6 +22,16 @@ $(eval $(call gb_Library_add_defs,skia,\
     -DSK_USER_CONFIG_HEADER="<$(BUILDDIR)/config_host/config_skia.h>" \
 ))
 
+# SK_DEBUG controls runtime checks and is controlled by config_skia.h and depends on DBG_UTIL.
+# This controls whether to build with compiler optimizations, normally yes, --enable-skia=debug
+# allows to build non-optimized. We normally wouldn't debug a 3rd-party library, and Skia
+# performance is relatively important (it may be the drawing engine used in software mode).
+ifeq ($(ENABLE_SKIA_DEBUG),)
+$(eval $(call gb_Library_add_cxxflags,skia, \
+    $(gb_COMPILEROPTFLAGS) \
+))
+endif
+
 ifeq ($(OS),WNT)
 # Skia can be built with or without UNICODE set, in LO sources we explicitly use the *W unicode
 # variants, so build Skia with UNICODE to make it also use the *W variants.


More information about the Libreoffice-commits mailing list