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@collabora.com>
This commit is contained in:
Luboš Luňák 2021-07-21 21:39:23 +02:00
parent 2fb06e18ae
commit 5d051f443b
4 changed files with 64 additions and 7 deletions

View file

@ -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@

View file

@ -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

View file

@ -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 \

View file

@ -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: