[arch-commits] Commit in electron10/trunk (4 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Sat Sep 18 19:44:18 UTC 2021


    Date: Saturday, September 18, 2021 @ 19:44:18
  Author: foutrelis
Revision: 1017071

upgpkg: electron10 10.4.7-2: harfbuzz 3.0.0 rebuild

Added:
  electron10/trunk/chromium-harfbuzz-3.0.0.patch
  electron10/trunk/disk_data_allocator-Metadata-constructor.patch
  electron10/trunk/skia-harfbuzz-3.0.0.patch
Modified:
  electron10/trunk/PKGBUILD

------------------------------------------------+
 PKGBUILD                                       |   11 ++
 chromium-harfbuzz-3.0.0.patch                  |   20 ++++
 disk_data_allocator-Metadata-constructor.patch |   18 ++++
 skia-harfbuzz-3.0.0.patch                      |  100 +++++++++++++++++++++++
 4 files changed, 148 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-09-18 19:26:56 UTC (rev 1017070)
+++ PKGBUILD	2021-09-18 19:44:18 UTC (rev 1017071)
@@ -4,7 +4,7 @@
 pkgver=10.4.7
 _commit=9fc28e2296b99a970cc58cdcbf17b0f2a743617a
 _chromiumver=85.0.4183.121
-pkgrel=1
+pkgrel=2
 pkgdesc='Build cross platform desktop apps with web technologies'
 arch=('x86_64')
 url='https://electronjs.org/'
@@ -27,10 +27,13 @@
         'v8-icu68.patch'
         'v8-call-new-ListFormatter-createInstance.patch'
         'qt5-webengine-glibc-2.33.patch'
+        'chromium-harfbuzz-3.0.0.patch'
+        'skia-harfbuzz-3.0.0.patch'
         'chromium-include-limits.patch'
         'chromium-skia-harmony.patch'
         'media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch'
         'sql-make-VirtualCursor-standard-layout-type.patch'
+        'disk_data_allocator-Metadata-constructor.patch'
        )
 sha256sums=('SKIP'
             'SKIP'
@@ -41,10 +44,13 @@
             '6e919c9712d8fe6c2918778df1f8c2ee0675a87a48be5d2aaa54e320703ced4b'
             '44ebcff050a1c849819d66399c14bd711801d0eb64f518d292d3d6efedce3b3a'
             '5600cfa40254fa3fa2cb541d3b55cc8f7a9231de8d2830c25a7651aa392de16f'
+            '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
+            'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
             'cb8e4c347169f145d2f08329e25125eb2a3682bfc3530c674cf1ffad89431bdf'
             '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1'
             '0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c'
             'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+            '52a63a84a10dc501a0712a76170cfa12abc02ed4efe93486a1e6139b1670f90c'
            )
 
 _system_libs=('ffmpeg'
@@ -131,7 +137,10 @@
   patch -Np1 -i ../chromium-include-limits.patch
   patch -Np0 -i ../chromium-skia-harmony.patch
   patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+  patch -Np0 -i ../disk_data_allocator-Metadata-constructor.patch
   patch -Np4 -i ../qt5-webengine-glibc-2.33.patch
+  patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
+  patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
   patch -Np1 -i ../media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
   patch -Np1 -i ../use-system-libraries-in-node.patch
   patch -Np1 -i ../default_app-icon.patch  # Icon from .desktop file

Added: chromium-harfbuzz-3.0.0.patch
===================================================================
--- chromium-harfbuzz-3.0.0.patch	                        (rev 0)
+++ chromium-harfbuzz-3.0.0.patch	2021-09-18 19:44:18 UTC (rev 1017071)
@@ -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;

Added: disk_data_allocator-Metadata-constructor.patch
===================================================================
--- disk_data_allocator-Metadata-constructor.patch	                        (rev 0)
+++ disk_data_allocator-Metadata-constructor.patch	2021-09-18 19:44:18 UTC (rev 1017071)
@@ -0,0 +1,18 @@
+# Modeled after https://github.com/chromium/chromium/commit/d62de64e2fd2
+
+--- third_party/blink/renderer/platform/disk_data_allocator.h.orig	2021-09-18 15:20:46.550131515 +0000
++++ third_party/blink/renderer/platform/disk_data_allocator.h	2021-09-18 15:21:20.868676978 +0000
+@@ -36,12 +36,12 @@ class PLATFORM_EXPORT DiskDataAllocator
+    public:
+     int64_t start_offset() const { return start_offset_; }
+     size_t size() const { return size_; }
+-    Metadata(Metadata&& other) = delete;
+ 
+    private:
+     Metadata(int64_t start_offset, size_t size)
+         : start_offset_(start_offset), size_(size) {}
+     Metadata(const Metadata& other) = default;
++    Metadata(Metadata&& other) = default;
+     Metadata& operator=(const Metadata& other) = default;
+ 
+     int64_t start_offset_;

Added: skia-harfbuzz-3.0.0.patch
===================================================================
--- skia-harfbuzz-3.0.0.patch	                        (rev 0)
+++ skia-harfbuzz-3.0.0.patch	2021-09-18 19:44:18 UTC (rev 1017071)
@@ -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") {



More information about the arch-commits mailing list