mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-27 23:44:04 +00:00
added extra/qt6-webengine
This commit is contained in:
parent
c45969e721
commit
395f4589b6
7 changed files with 405 additions and 0 deletions
58
extra/qt6-webengine/0001-ARM-toolchain-fixes.patch
Normal file
58
extra/qt6-webengine/0001-ARM-toolchain-fixes.patch
Normal file
|
@ -0,0 +1,58 @@
|
|||
From e3433bcca3f78b5a2d5b1c1aff0ae415475c9e32 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
Date: Tue, 4 Jul 2017 11:54:39 -0600
|
||||
Subject: [PATCH 1/4] ARM toolchain fixes
|
||||
|
||||
---
|
||||
chromium/build/toolchain/linux/BUILD.gn | 24 ++++++++++--------------
|
||||
1 file changed, 10 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/chromium/build/toolchain/linux/BUILD.gn b/chromium/build/toolchain/linux/BUILD.gn
|
||||
index e562f5a5f26..6defaf00db2 100644
|
||||
--- a/chromium/build/toolchain/linux/BUILD.gn
|
||||
+++ b/chromium/build/toolchain/linux/BUILD.gn
|
||||
@@ -31,15 +31,13 @@ clang_toolchain("clang_arm64") {
|
||||
}
|
||||
|
||||
gcc_toolchain("arm64") {
|
||||
- toolprefix = "aarch64-linux-gnu-"
|
||||
-
|
||||
- cc = "${toolprefix}gcc"
|
||||
- cxx = "${toolprefix}g++"
|
||||
+ cc = "gcc"
|
||||
+ cxx = "g++"
|
||||
|
||||
- ar = "${toolprefix}ar"
|
||||
+ ar = "ar"
|
||||
ld = cxx
|
||||
- readelf = "${toolprefix}readelf"
|
||||
- nm = "${toolprefix}nm"
|
||||
+ readelf = "readelf"
|
||||
+ nm = "nm"
|
||||
|
||||
toolchain_args = {
|
||||
current_cpu = "arm64"
|
||||
@@ -52,15 +50,13 @@ gcc_toolchain("arm64") {
|
||||
}
|
||||
|
||||
gcc_toolchain("arm") {
|
||||
- toolprefix = "arm-linux-gnueabihf-"
|
||||
-
|
||||
- cc = "${toolprefix}gcc"
|
||||
- cxx = "${toolprefix}g++"
|
||||
+ cc = "gcc"
|
||||
+ cxx = "g++"
|
||||
|
||||
- ar = "${toolprefix}ar"
|
||||
+ ar = "ar"
|
||||
ld = cxx
|
||||
- readelf = "${toolprefix}readelf"
|
||||
- nm = "${toolprefix}nm"
|
||||
+ readelf = "readelf"
|
||||
+ nm = "nm"
|
||||
|
||||
toolchain_args = {
|
||||
current_cpu = "arm"
|
||||
--
|
||||
2.33.0
|
||||
|
25
extra/qt6-webengine/0002-Fix-ARM-skia-ICE.patch
Normal file
25
extra/qt6-webengine/0002-Fix-ARM-skia-ICE.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
From 719510740eaab4137d089ab9ea7463903c411271 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
Date: Mon, 1 Jul 2019 07:10:36 -0600
|
||||
Subject: [PATCH 2/4] Fix ARM skia ICE
|
||||
|
||||
---
|
||||
chromium/third_party/skia/third_party/skcms/src/Transform_inl.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h b/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
|
||||
index 4ec175c245e..26b61d02035 100644
|
||||
--- a/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
|
||||
+++ b/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
|
||||
@@ -690,7 +690,7 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
|
||||
// GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
|
||||
// when targeting MIPS 64, i386, or s390x, I think attempting to inline clut() into exec_ops().
|
||||
#if 1 && defined(__GNUC__) && !defined(__clang__) \
|
||||
- && (defined(__mips64) || defined(__i386) || defined(__s390x__))
|
||||
+ && (defined(__mips64) || defined(__i386) || defined(__s390x__) || defined(__arm__))
|
||||
#define MAYBE_NOINLINE __attribute__((noinline))
|
||||
#else
|
||||
#define MAYBE_NOINLINE
|
||||
--
|
||||
2.33.0
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
From c8d5726f28ef66408dd8b9278fc755abda16e99f Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
Date: Tue, 2 Feb 2021 13:58:59 -0700
|
||||
Subject: [PATCH 3/4] Run blink bindings generation single threaded
|
||||
|
||||
When not single threaded this process will eat all the RAM.
|
||||
---
|
||||
chromium/third_party/blink/renderer/bindings/BUILD.gn | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/chromium/third_party/blink/renderer/bindings/BUILD.gn b/chromium/third_party/blink/renderer/bindings/BUILD.gn
|
||||
index 61c9e7f59da..a33c9e4144d 100644
|
||||
--- a/chromium/third_party/blink/renderer/bindings/BUILD.gn
|
||||
+++ b/chromium/third_party/blink/renderer/bindings/BUILD.gn
|
||||
@@ -178,6 +178,7 @@ template("generate_bindings") {
|
||||
outputs = invoker.outputs
|
||||
|
||||
args = [
|
||||
+ "--single_process",
|
||||
"--web_idl_database",
|
||||
rebase_path(web_idl_database, root_build_dir),
|
||||
"--root_src_dir",
|
||||
--
|
||||
2.33.0
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
From 5b87fed684ddc9c881e5f2a68ba59f24cf2d5a44 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
Date: Tue, 2 Feb 2021 13:58:21 -0700
|
||||
Subject: [PATCH 4/4] Fix sandbox 'Aw snap' for sycalls 403 and 407
|
||||
|
||||
---
|
||||
.../sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | 9 ++++++++-
|
||||
.../syscall_parameters_restrictions_unittests.cc | 6 ++++++
|
||||
.../sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | 6 ++++++
|
||||
.../sandbox/linux/system_headers/arm_linux_syscalls.h | 8 ++++++++
|
||||
.../sandbox/linux/system_headers/mips_linux_syscalls.h | 8 ++++++++
|
||||
5 files changed, 36 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
|
||||
index 89450d6d4eb..531334672b3 100644
|
||||
--- a/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
|
||||
+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
|
||||
@@ -159,7 +159,14 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
|
||||
return Allow();
|
||||
#endif
|
||||
|
||||
- if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep) {
|
||||
+ if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep
|
||||
+#if defined(__NR_clock_gettime64)
|
||||
+ || sysno == __NR_clock_gettime64
|
||||
+#endif
|
||||
+#if defined(__NR_clock_nanosleep_time64)
|
||||
+ || sysno == __NR_clock_nanosleep_time64
|
||||
+#endif
|
||||
+ ) {
|
||||
return RestrictClockID();
|
||||
}
|
||||
|
||||
diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
|
||||
index 4bbfc7e53b6..540149b67d9 100644
|
||||
--- a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
|
||||
+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
|
||||
@@ -61,6 +61,12 @@ class RestrictClockIdPolicy : public bpf_dsl::Policy {
|
||||
case __NR_clock_gettime:
|
||||
case __NR_clock_getres:
|
||||
case __NR_clock_nanosleep:
|
||||
+#if defined(__NR_clock_nanosleep_time64)
|
||||
+ case __NR_clock_nanosleep_time64:
|
||||
+#endif
|
||||
+#if defined(__NR_clock_gettime64)
|
||||
+ case __NR_clock_gettime64:
|
||||
+#endif
|
||||
return RestrictClockID();
|
||||
default:
|
||||
return Allow();
|
||||
diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
|
||||
index f40d436edfb..c712b00f617 100644
|
||||
--- a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
|
||||
+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
|
||||
@@ -39,6 +39,12 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
|
||||
// filtered by RestrictClokID().
|
||||
case __NR_clock_gettime: // Parameters filtered by RestrictClockID().
|
||||
case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID().
|
||||
+#if defined(__NR_clock_gettime64)
|
||||
+ case __NR_clock_gettime64: // Parameters filtered by RestrictClockID().
|
||||
+#endif
|
||||
+#if defined(__NR_clock_nanosleep_time64)
|
||||
+ case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID().
|
||||
+#endif
|
||||
case __NR_clock_settime: // Privileged.
|
||||
#if defined(__i386__) || \
|
||||
(defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
|
||||
diff --git a/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h b/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
|
||||
index 85e2110b4c2..c39c22b5114 100644
|
||||
--- a/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
|
||||
+++ b/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
|
||||
@@ -1441,6 +1441,14 @@
|
||||
#define __NR_io_pgetevents (__NR_SYSCALL_BASE+399)
|
||||
#endif
|
||||
|
||||
+#if !defined(__NR_clock_gettime64)
|
||||
+#define __NR_clock_gettime64 (__NR_SYSCALL_BASE+403)
|
||||
+#endif
|
||||
+
|
||||
+#if !defined(__NR_clock_nanosleep_time64)
|
||||
+#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE+407)
|
||||
+#endif
|
||||
+
|
||||
// ARM private syscalls.
|
||||
#if !defined(__ARM_NR_BASE)
|
||||
#define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
|
||||
diff --git a/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h b/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
|
||||
index ddbf97f3d8b..fa01b3bbc66 100644
|
||||
--- a/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
|
||||
+++ b/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
|
||||
@@ -1433,4 +1433,12 @@
|
||||
#define __NR_memfd_create (__NR_Linux + 354)
|
||||
#endif
|
||||
|
||||
+#if !defined(__NR_clock_gettime64)
|
||||
+#define __NR_clock_gettime64 (__NR_Linux + 403)
|
||||
+#endif
|
||||
+
|
||||
+#if !defined(__NR_clock_nanosleep_time64)
|
||||
+#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
|
||||
+#endif
|
||||
+
|
||||
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
|
||||
--
|
||||
2.33.0
|
||||
|
71
extra/qt6-webengine/PKGBUILD
Normal file
71
extra/qt6-webengine/PKGBUILD
Normal file
|
@ -0,0 +1,71 @@
|
|||
# Maintainer: Antonio Rojas <arojas@archlinux.org>
|
||||
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
||||
|
||||
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
# - patch for chromium GN
|
||||
# - patch for chromium skia
|
||||
# - patch for chromium to run blink bindings generation single threaded
|
||||
# - patch for chromium aw snap on ARM
|
||||
|
||||
buildarch=12
|
||||
highmem=1
|
||||
|
||||
pkgname=qt6-webengine
|
||||
_qtver=6.2.0
|
||||
pkgver=${_qtver/-/}
|
||||
pkgrel=1
|
||||
arch=(x86_64)
|
||||
url='https://www.qt.io'
|
||||
license=(GPL3 LGPL3 FDL custom)
|
||||
pkgdesc='Provides support for web applications using the Chromium browser project'
|
||||
depends=(qt6-webchannel qt6-location libxcomposite libxrandr pciutils libxss libxkbfile
|
||||
libevent snappy nss libxslt minizip ffmpeg re2 libvpx libxtst ttf-font)
|
||||
makedepends=(cmake ninja python2 python gperf jsoncpp qt6-tools pipewire nodejs)
|
||||
optdepends=('pipewire: WebRTC desktop sharing under Wayland')
|
||||
groups=(qt6)
|
||||
_pkgfn="${pkgname/6-/}-everywhere-src-$_qtver"
|
||||
source=(https://download.qt.io/official_releases/qt/${pkgver%.*}/$_qtver/submodules/$_pkgfn.tar.xz
|
||||
chromium-harfbuzz-3.0.0.patch
|
||||
skia-harfbuzz-3.0.0.patch
|
||||
0001-ARM-toolchain-fixes.patch
|
||||
0002-Fix-ARM-skia-ICE.patch
|
||||
0003-Run-blink-bindings-generation-single-threaded.patch
|
||||
0004-Fix-sandbox-Aw-snap-for-sycalls-403-and-407.patch)
|
||||
sha256sums=('c6e530a61bea2e7fbb50308a2b4e7fdb4f7c7b61a28797973270acffc020809d'
|
||||
'7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
|
||||
'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
|
||||
'2f9388902350b706d85181e8a5864efe577b665afefb7328ad213a6c71b09d27'
|
||||
'd7bfd8ed1db238c540935ff31539a54e4e807eb8c3013ed98f7dcc7367d35784'
|
||||
'a24170d4576adebbfb8ee19dccd892f4038b9848765036b2ff78dbf590fc8138'
|
||||
'9aed8036ca3d287fe86824e88e197f09fb2da45841e7a8cd87b6492b95cfdb3a')
|
||||
|
||||
prepare() {
|
||||
cd $_pkgfn
|
||||
|
||||
# Fix build with harfbuzz 3.0.0
|
||||
patch -p1 -d src/3rdparty/chromium -i "$srcdir"/chromium-harfbuzz-3.0.0.patch
|
||||
patch -p1 -d src/3rdparty/chromium/third_party/skia -i "$srcdir"/skia-harfbuzz-3.0.0.patch
|
||||
|
||||
cd "$srcdir/$_pkgfn/src/3rdparty"
|
||||
patch -p1 -i ${srcdir}/0001-ARM-toolchain-fixes.patch
|
||||
patch -p1 -i ${srcdir}/0002-Fix-ARM-skia-ICE.patch
|
||||
patch -p1 -i ${srcdir}/0003-Run-blink-bindings-generation-single-threaded.patch
|
||||
patch -p1 -i ${srcdir}/0004-Fix-sandbox-Aw-snap-for-sycalls-403-and-407.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cmake -B build -S $_pkgfn -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/usr/lib/cmake/Qt6/qt.toolchain.cmake \
|
||||
-DQT_FEATURE_webengine_system_ffmpeg=ON \
|
||||
-DQT_FEATURE_webengine_system_icu=ON \
|
||||
-DQT_FEATURE_webengine_proprietary_codecs=ON \
|
||||
-DQT_FEATURE_webengine_kerberos=ON \
|
||||
-DQT_FEATURE_webengine_webrtc_pipewire=ON
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
|
||||
install -Dm644 "$srcdir"/${_pkgfn}/src/3rdparty/chromium/LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE.chromium
|
||||
}
|
20
extra/qt6-webengine/chromium-harfbuzz-3.0.0.patch
Normal file
20
extra/qt6-webengine/chromium-harfbuzz-3.0.0.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
# https://github.com/chromium/chromium/commit/b289f6f3fcbc
|
||||
|
||||
diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
|
||||
index 8ff0540d9a..20a7d37474 100644
|
||||
--- a/components/paint_preview/common/subset_font.cc
|
||||
+++ b/components/paint_preview/common/subset_font.cc
|
||||
@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
|
||||
hb_set_t* glyphs =
|
||||
hb_subset_input_glyph_set(input.get()); // Owned by |input|.
|
||||
usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
|
||||
- hb_subset_input_set_retain_gids(input.get(), true);
|
||||
+ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
|
||||
|
||||
- HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
|
||||
+ HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
|
||||
+ if (!subset_face)
|
||||
+ return nullptr;
|
||||
HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
|
||||
if (!subset_blob)
|
||||
return nullptr;
|
100
extra/qt6-webengine/skia-harfbuzz-3.0.0.patch
Normal file
100
extra/qt6-webengine/skia-harfbuzz-3.0.0.patch
Normal file
|
@ -0,0 +1,100 @@
|
|||
# Minimal diff for harfbuzz 3.0.0 support; based on:
|
||||
# https://github.com/google/skia/commit/66684b17b382
|
||||
# https://github.com/google/skia/commit/51d83abcd24a
|
||||
|
||||
diff --git a/gn/skia.gni b/gn/skia.gni
|
||||
index d98fdc19ee..199335d5c4 100644
|
||||
--- a/gn/skia.gni
|
||||
+++ b/gn/skia.gni
|
||||
@@ -34,8 +34,6 @@ declare_args() {
|
||||
skia_include_multiframe_procs = false
|
||||
skia_lex = false
|
||||
skia_libgifcodec_path = "third_party/externals/libgifcodec"
|
||||
- skia_pdf_subset_harfbuzz =
|
||||
- false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
|
||||
skia_qt_path = getenv("QT_PATH")
|
||||
skia_skqp_global_error_tolerance = 0
|
||||
skia_tools_require_resources = false
|
||||
@@ -99,6 +97,10 @@ declare_args() {
|
||||
skia_use_libfuzzer_defaults = true
|
||||
}
|
||||
|
||||
+declare_args() {
|
||||
+ skia_pdf_subset_harfbuzz = skia_use_harfbuzz
|
||||
+}
|
||||
+
|
||||
declare_args() {
|
||||
skia_compile_sksl_tests = skia_compile_processors
|
||||
skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
|
||||
diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
|
||||
index 81c37eef3a..2340a7937b 100644
|
||||
--- a/src/pdf/SkPDFSubsetFont.cpp
|
||||
+++ b/src/pdf/SkPDFSubsetFont.cpp
|
||||
@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
|
||||
blob.release());
|
||||
}
|
||||
|
||||
+template<typename...> using void_t = void;
|
||||
+template<typename T, typename = void>
|
||||
+struct SkPDFHarfBuzzSubset {
|
||||
+ // This is the HarfBuzz 3.0 interface.
|
||||
+ // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of
|
||||
+ // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
|
||||
+ static HBFace Make(T input, hb_face_t* face) {
|
||||
+ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
|
||||
+ // If it isn't known if a font is 'tricky', retain the hints.
|
||||
+ hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
|
||||
+ return HBFace(hb_subset_or_fail(face, input));
|
||||
+ }
|
||||
+};
|
||||
+template<typename T>
|
||||
+struct SkPDFHarfBuzzSubset<T, void_t<
|
||||
+ decltype(hb_subset_input_set_retain_gids(std::declval<T>(), std::declval<bool>())),
|
||||
+ decltype(hb_subset_input_set_drop_hints(std::declval<T>(), std::declval<bool>())),
|
||||
+ decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
|
||||
+ >>
|
||||
+{
|
||||
+ // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
|
||||
+ // This code should be removed as soon as all users are migrated to the newer API.
|
||||
+ static HBFace Make(T input, hb_face_t* face) {
|
||||
+ hb_subset_input_set_retain_gids(input, true);
|
||||
+ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
|
||||
+ // If it isn't known if a font is 'tricky', retain the hints.
|
||||
+ hb_subset_input_set_drop_hints(input, false);
|
||||
+ return HBFace(hb_subset(face, input));
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
|
||||
const SkPDFGlyphUse& glyphUsage,
|
||||
int ttcIndex) {
|
||||
@@ -71,11 +102,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
|
||||
hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
|
||||
glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});
|
||||
|
||||
- hb_subset_input_set_retain_gids(input.get(), true);
|
||||
- // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
|
||||
- // If it isn't known if a font is 'tricky', retain the hints.
|
||||
- hb_subset_input_set_drop_hints(input.get(), false);
|
||||
- HBFace subset(hb_subset(face.get(), input.get()));
|
||||
+ HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), face.get());
|
||||
+ if (!subset) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
HBBlob result(hb_face_reference_blob(subset.get()));
|
||||
return to_data(std::move(result));
|
||||
}
|
||||
diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
|
||||
index 173830de62..4156607ef9 100644
|
||||
--- a/third_party/harfbuzz/BUILD.gn
|
||||
+++ b/third_party/harfbuzz/BUILD.gn
|
||||
@@ -14,6 +14,9 @@ if (skia_use_system_harfbuzz) {
|
||||
"harfbuzz",
|
||||
"harfbuzz-icu",
|
||||
]
|
||||
+ if (skia_pdf_subset_harfbuzz) {
|
||||
+ libs += [ "harfbuzz-subset" ]
|
||||
+ }
|
||||
}
|
||||
} else {
|
||||
third_party("harfbuzz") {
|
Loading…
Reference in a new issue