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

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 26 11:33:12 UTC 2021


 config_host.mk.in                       |    1 
 configure.ac                            |    7 ++++++
 external/skia/Library_skia.mk           |   36 ++++++++++++++++++++++++++++++++
 external/skia/swap-buffers-rect.patch.1 |   27 +++++++++++++++++-------
 4 files changed, 64 insertions(+), 7 deletions(-)

New commits:
commit 5d051f443bcd4b79041ef379bf032b76616f9ce2
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Jul 21 21:39:23 2021 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Jul 26 13:32:37 2021 +0200

    build Skia also on Mac
    
    This only builds the library, without using it.
    
    Change-Id: I54e940bcaa61852b831dbe7ae5660a5daf5fe609
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119356
    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 f2117f306615..d74fecae9522 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -550,6 +550,7 @@ export SERF_CFLAGS=$(gb_SPACE)@SERF_CFLAGS@
 export SERF_LIBS=$(gb_SPACE)@SERF_LIBS@
 export SHA256SUM=@SHA256SUM@
 export SHOWINCLUDES_PREFIX=@SHOWINCLUDES_PREFIX@
+export SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX=@SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX@
 export SOLARINC=@SOLARINC@
 export SORT=@SORT@
 export SPLIT_APP_MODULES=@SPLIT_APP_MODULES@
diff --git a/configure.ac b/configure.ac
index b2ca6f8d4edd..675a6a1e8395 100644
--- a/configure.ac
+++ b/configure.ac
@@ -928,6 +928,7 @@ cygwin*|wsl*)
 darwin*|macos*) # macOS
     using_freetype_fontconfig=no
     using_x11=no
+    build_skia=yes
     if test -n "$LODE_HOME" ; then
         mac_sanitize_path
         AC_MSG_NOTICE([sanitized the PATH to $PATH])
@@ -11968,6 +11969,12 @@ if test "$enable_skia" != "no" -a "$build_skia" = "yes" -a -z "$DISABLE_GUI"; th
     ENABLE_SKIA=TRUE
     AC_DEFINE(HAVE_FEATURE_SKIA)
     BUILD_TYPE="$BUILD_TYPE SKIA"
+
+    if test -n "$MAC_OS_X_VERSION_MIN_REQUIRED" -a "$MAC_OS_X_VERSION_MIN_REQUIRED" -lt "101200"; then
+        SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX=1
+        AC_SUBST(SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX)
+    fi
+
 else
     AC_MSG_RESULT([no])
 fi
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index a1f1f1c30ef6..ad55400a24e5 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -59,6 +59,19 @@ $(eval $(call gb_Library_use_system_win32_libs,skia,\
     usp10 \
     gdi32 \
 ))
+else ifeq ($(OS),MACOSX)
+
+$(eval $(call gb_Library_use_system_darwin_frameworks,skia,\
+    Carbon \
+))
+
+ifneq ($(SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX),)
+# Disable std::shared_mutex usage on MacOSX < 10.12.
+$(eval $(call gb_Library_add_defs,skia,\
+    -DVMA_USE_STL_SHARED_MUTEX=0 \
+))
+endif
+
 else
 $(eval $(call gb_Library_use_externals,skia,\
     freetype \
@@ -876,6 +889,29 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/tools/sk_app/win/RasterWindowContext_win \
     UnpackedTarball/skia/tools/sk_app/win/VulkanWindowContext_win \
 ))
+
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+    UnpackedTarball/skia/src/ports/SkDebug_stdio \
+    UnpackedTarball/skia/src/ports/SkImageEncoder_CG \
+    UnpackedTarball/skia/src/ports/SkImageGeneratorCG \
+    UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct \
+    UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct_factory \
+    UnpackedTarball/skia/src/ports/SkScalerContext_mac_ct \
+    UnpackedTarball/skia/src/ports/SkTypeface_mac_ct \
+    UnpackedTarball/skia/src/ports/SkOSFile_posix \
+    UnpackedTarball/skia/src/ports/SkOSLibrary_posix \
+    UnpackedTarball/skia/src/utils/mac/SkCTFont \
+    UnpackedTarball/skia/src/utils/mac/SkCreateCGImageRef \
+))
+
+$(eval $(call gb_Library_add_generated_objcxxobjects,skia,\
+    UnpackedTarball/skia/tools/sk_app/mac/RasterWindowContext_mac \
+))
+
+#    UnpackedTarball/skia/tools/sk_app/mac/VulkanWindowContext_mac \
+#    UnpackedTarball/skia/tools/sk_app/mac/MetalWindowContext_mac \
+
 else
 $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/ports/SkDebug_stdio \
diff --git a/external/skia/swap-buffers-rect.patch.1 b/external/skia/swap-buffers-rect.patch.1
index d04ea91c0bc9..7673a358ebc4 100644
--- a/external/skia/swap-buffers-rect.patch.1
+++ b/external/skia/swap-buffers-rect.patch.1
@@ -1,8 +1,21 @@
+diff --git a/tools/sk_app/GLWindowContext.h b/tools/sk_app/GLWindowContext.h
+index c519903006..5dc5bcd180 100644
+--- a/tools/sk_app/GLWindowContext.h
++++ b/tools/sk_app/GLWindowContext.h
+@@ -25,7 +25,7 @@ public:
+     bool isValid() override { return SkToBool(fBackendContext.get()); }
+ 
+     void resize(int w, int h) override;
+-    void swapBuffers() override;
++    void swapBuffers(const SkIRect* rect = nullptr) override;
+ 
+     void setDisplayParams(const DisplayParams& params) override;
+ 
 diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
-index 66670c892e..3a6804166f 100644
+index 2b36d60076..d73978c9e4 100644
 --- a/tools/sk_app/VulkanWindowContext.cpp
 +++ b/tools/sk_app/VulkanWindowContext.cpp
-@@ -553,7 +553,7 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
+@@ -572,7 +572,7 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
      return sk_ref_sp(surface);
  }
  
@@ -12,7 +25,7 @@ index 66670c892e..3a6804166f 100644
      BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex;
      SkSurface* surface = fSurfaces[backbuffer->fImageIndex].get();
 diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h
-index 07a18a46a9..aa6f95e2a1 100644
+index 16f6b3fd51..39b035215b 100644
 --- a/tools/sk_app/VulkanWindowContext.h
 +++ b/tools/sk_app/VulkanWindowContext.h
 @@ -48,7 +48,7 @@ public:
@@ -25,7 +38,7 @@ index 07a18a46a9..aa6f95e2a1 100644
      bool isValid() override { return fSurface != VK_NULL_HANDLE; }
  
 diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h
-index 6920e5ba89..219330a61b 100644
+index 68bb84b988..e15c1a3cf3 100644
 --- a/tools/sk_app/WindowContext.h
 +++ b/tools/sk_app/WindowContext.h
 @@ -8,6 +8,7 @@
@@ -36,7 +49,7 @@ index 6920e5ba89..219330a61b 100644
  #include "include/core/SkSurfaceProps.h"
  #include "include/gpu/GrTypes.h"
  #include "include/gpu/GrDirectContext.h"
-@@ -29,7 +30,7 @@ public:
+@@ -25,7 +26,7 @@ public:
  
      virtual sk_sp<SkSurface> getBackbufferSurface() = 0;
  
@@ -46,7 +59,7 @@ index 6920e5ba89..219330a61b 100644
      virtual bool isValid() = 0;
  
 diff --git a/tools/sk_app/unix/RasterWindowContext_unix.cpp b/tools/sk_app/unix/RasterWindowContext_unix.cpp
-index e8ae942308..fc06b40069 100644
+index 6ac20962b7..2ea9e07588 100644
 --- a/tools/sk_app/unix/RasterWindowContext_unix.cpp
 +++ b/tools/sk_app/unix/RasterWindowContext_unix.cpp
 @@ -19,7 +19,7 @@ public:
@@ -79,7 +92,7 @@ index e8ae942308..fc06b40069 100644
  
  }  // anonymous namespace
 diff --git a/tools/sk_app/win/RasterWindowContext_win.cpp b/tools/sk_app/win/RasterWindowContext_win.cpp
-index 49f1f9ed17..f0db1f6f06 100644
+index d80c6fbeec..72df8d5170 100644
 --- a/tools/sk_app/win/RasterWindowContext_win.cpp
 +++ b/tools/sk_app/win/RasterWindowContext_win.cpp
 @@ -22,7 +22,7 @@ public:


More information about the Libreoffice-commits mailing list