7
0
Files
nodejs-electron/harfbuzz-replace-HbScopedPointer.patch
Bruno Pitrus d2352147a4 Accepting request 1152479 from home:dziobian:gulgul-ultron:19
- Update to version 28.2.4:
  * ABI break: NODE_MODULE_VERSION is now 119
  * Chromium 120.0.6099.291
  * Node 18.18.2
  * V8 12.0
  * The ipcRenderer.sendTo() method has been removed.
  * The scroll-touch-{begin,end,edge} events have been removed.
  * Setting backgroundThrottling to false will disable frames throttling in the BrowserWindow for all WebContents displayed by it.
  * Enabled ESM support.
  * The UtilityProcess API now supports ESM entrypoints.
  * Added several properties to the display object including detected, maximumCursorSize, and nativeOrigin.
  * Added support for ELECTRON_OZONE_PLATFORM_HINT environment variable on Linux.
  * see https://www.electronjs.org/blog/electron-28-0 and https://github.com/electron/electron/releases/tag/v28.0.0 for more
- Drop upstreamed patches:
  * absl-make_unique-missing-include.patch
  * async_shared_storage_database_impl-missing-absl-WrapUnique.patch
  * autofill_i18n_parsing_expressions-constexpr.patch
  * chromium-system-libusb.patch
  * computed_style_base-nbsp.patch
  * CVE-2023-38552-node-integrity-checks-according-to-policies.patch
  * CVE-2023-39333-node-create_dynamic_module-code-injection.patch
  * CVE-2023-45143-undici-cookie-leakage.patch
  * decoder_buffer_side_data-missing-uint8_t.patch
  * electron_api_app-GetPathConstant-non-constexpr.patch
  * electron_browser_context-missing-variant.patch
  * flatbuffers.gn
  * libsecret.gn
  * highway.gn
  * kwallet_dbus-missing-uint8_t.patch
  * mojo_ukm_recorder-missing-WrapUnique.patch
  * page_content_annotations_common-remove-tflite.patch
  * Partial-migration-from-imp-to-importlib.patch
  * partition_root-attribute.patch
  * quiche-missing-absl-includes.patch
  * replace_gn_files-system-libs.patch
  * sensor_reading-missing-int64_t-size_t.patch
  * services-network-optional-explicit-constructor.patch
  * simple_font_data-freetype-include.patch
  * utf_string_conversion_utils-missing-numeric_limits.patch
  * vulkan_memory_allocator.gn
  * vulkan_memory_allocator-upgrade.patch
  * vulkan_memory_allocator-vk_mem_alloc-missing-snprintf.patch
- Add patches to fix build errors:
  * atspi.patch
  * local_frame-local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
  * v8-instance-type-inl-constexpr-used-before-its-definition.patch
- Adjust brotli-remove-shared-dictionary.patch to disable the offending code which is now live,
  and enable this patch only on systems with old brotli.
- Conditionally add pending_task_safety_flag-abseil-2022-nullability.patch
  to make electron buildable with old abseil.
- Use bundled avif everywhereas chromium now uses features available only in development snapshots.

OBS-URL: https://build.opensuse.org/request/show/1152479
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=126
2024-02-27 19:01:54 +00:00

94 lines
3.3 KiB
Diff

From 5fcaeafcab5460ea65e4a7bdee6589002adf74d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20R=C3=B6ttsches?= <drott@chromium.org>
Date: Mon, 13 Feb 2023 13:26:16 +0000
Subject: [PATCH] Use hb::unique_ptr instead of custom HbScopedPointer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This was an earlier local RAII implementation that we no longer need now
that HarfBuzz provides helpers for this.
Change-Id: Idc47ce2717c75556acb03e2ccccb50ec87ed3cca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4239980
Reviewed-by: Munira Tursunova <moonira@google.com>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1104453}
---
.../platform/fonts/shaping/harfbuzz_shaper.cc | 39 ++++---------------
1 file changed, 7 insertions(+), 32 deletions(-)
diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc
index c165a1703395a..dc1377a90a9f7 100644
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc
@@ -35,6 +35,7 @@
#include <unicode/uchar.h>
#include <unicode/uscript.h>
#include <algorithm>
+#include <hb-cplusplus.hh>
#include <memory>
#include <utility>
@@ -194,33 +195,6 @@ struct ReshapeQueueItem {
: action_(action), start_index_(start), num_characters_(num) {}
};
-template <typename T>
-class HarfBuzzScopedPtr {
- STACK_ALLOCATED();
-
- public:
- typedef void (*DestroyFunction)(T*);
-
- HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy)
- : ptr_(ptr), destroy_(destroy) {
- DCHECK(destroy_);
- }
- HarfBuzzScopedPtr(const HarfBuzzScopedPtr&) = delete;
- HarfBuzzScopedPtr& operator=(const HarfBuzzScopedPtr&) = delete;
- ~HarfBuzzScopedPtr() {
- if (ptr_)
- (*destroy_)(ptr_);
- }
-
- T* Get() const{ return ptr_; }
- operator T *() const {return ptr_;}
- void Set(T* ptr) { ptr_ = ptr; }
-
- private:
- T* ptr_;
- DestroyFunction destroy_;
-};
-
//
// Represents a context while shaping a range.
//
@@ -239,7 +214,7 @@ struct RangeContext {
text_direction(direction),
start(start),
end(end),
- buffer(hb_buffer_create(), hb_buffer_destroy),
+ buffer(hb_buffer_create()),
options(options) {
DCHECK_GE(end, start);
font_features.Initialize(font->GetFontDescription());
@@ -249,7 +224,7 @@ struct RangeContext {
const TextDirection text_direction;
const unsigned start;
const unsigned end;
- const HarfBuzzScopedPtr<hb_buffer_t> buffer;
+ const hb::unique_ptr<hb_buffer_t> buffer;
FontFeatures font_features;
Deque<ReshapeQueueItem> reshape_queue;
const ShapeOptions options;
@@ -1032,7 +1007,7 @@ void HarfBuzzShaper::GetGlyphData(const
UScriptCode script,
bool is_horizontal,
GlyphDataList& glyphs) {
- HarfBuzzScopedPtr<hb_buffer_t> hb_buffer(hb_buffer_create(), hb_buffer_destroy);
+ hb::unique_ptr<hb_buffer_t> hb_buffer(hb_buffer_create());
hb_buffer_set_language(hb_buffer, locale.HarfbuzzLanguage());
hb_buffer_set_script(hb_buffer, ICUScriptToHBScript(script));
hb_buffer_set_direction(hb_buffer,