Skip to content

Commit 85358f1

Browse files
committed
Merge pull request #101366 from akien-mga/harfbuzz-10.1.0
harfbuzz: Update to 10.1.0
2 parents e4a12a0 + 269b1df commit 85358f1

32 files changed

+1509
-1203
lines changed

modules/text_server_adv/SCsub

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ if env["builtin_harfbuzz"]:
6464
# "src/hb-cairo-utils.cc",
6565
# "src/hb-cairo.cc",
6666
"src/hb-common.cc",
67-
# "src/hb-coretext.cc",
67+
# "src/hb-coretext-font.cc",
68+
# "src/hb-coretext-shape.cc",
6869
# "src/hb-directwrite.cc",
6970
"src/hb-draw.cc",
7071
"src/hb-face-builder.cc",

modules/text_server_adv/gdextension_build/SConstruct

+2-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ thirdparty_harfbuzz_sources = [
298298
# "src/hb-cairo-utils.cc",
299299
# "src/hb-cairo.cc",
300300
"src/hb-common.cc",
301-
# "src/hb-coretext.cc",
301+
# "src/hb-coretext-font.cc",
302+
# "src/hb-coretext-shape.cc",
302303
# "src/hb-directwrite.cc",
303304
"src/hb-draw.cc",
304305
"src/hb-face-builder.cc",

thirdparty/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,15 @@ Files extracted from upstream source:
394394
## harfbuzz
395395

396396
- Upstream: https://github.com/harfbuzz/harfbuzz
397-
- Version: 10.0.1 (a1d9bfe62818ef0fa9cf63b6e6d51436b1c93cbc, 2024)
397+
- Version: 10.1.0 (9ef44a2d67ac870c1f7f671f6dc98d08a2579865, 2024)
398398
- License: MIT
399399

400400
Files extracted from upstream source:
401401

402402
- `AUTHORS`, `COPYING`, `THANKS`
403403
- From the `src` folder, recursively:
404404
- All the `.cc`, `.h`, `.hh` files
405-
- Except `main.cc`, `harfbuzz*.cc`, `failing-alloc.c`, `test*.cc`, `hb-wasm*.*`
405+
- Except `main.cc`, `harfbuzz*.cc`, `failing-alloc.c`, `test*.cc`, `hb-wasm*.*`, `wasm/*`
406406

407407

408408
## icu4c

thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh

+26-21
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ struct delta_set_index_map_subset_plan_t
20582058
unsigned outer = (*var_idx) >> 16;
20592059
unsigned bit_count = (outer == 0) ? 1 : hb_bit_storage (outer);
20602060
outer_bit_count = hb_max (bit_count, outer_bit_count);
2061-
2061+
20622062
unsigned inner = (*var_idx) & 0xFFFF;
20632063
bit_count = (inner == 0) ? 1 : hb_bit_storage (inner);
20642064
inner_bit_count = hb_max (bit_count, inner_bit_count);
@@ -2080,7 +2080,7 @@ struct COLR
20802080
bool has_v0_data () const { return numBaseGlyphs; }
20812081
bool has_v1_data () const
20822082
{
2083-
if (version != 1)
2083+
if (version < 1)
20842084
return false;
20852085
hb_barrier ();
20862086

@@ -2180,7 +2180,7 @@ struct COLR
21802180
hb_set_t *variation_indices,
21812181
hb_set_t *delta_set_indices) const
21822182
{
2183-
if (version != 1) return;
2183+
if (version < 1) return;
21842184
hb_barrier ();
21852185

21862186
hb_set_t visited_glyphs;
@@ -2222,16 +2222,22 @@ struct COLR
22222222
{ return (this+baseGlyphList); }
22232223

22242224
bool has_var_store () const
2225-
{ return version >= 1 && varStore != 0; }
2225+
{ return version >= 1 && hb_barrier () && varStore != 0; }
22262226

22272227
bool has_delta_set_index_map () const
2228-
{ return version >= 1 && varIdxMap != 0; }
2228+
{ return version >= 1 && hb_barrier () && varIdxMap != 0; }
2229+
2230+
bool has_clip_list () const
2231+
{ return version >= 1 && hb_barrier () && clipList != 0; }
22292232

22302233
const DeltaSetIndexMap &get_delta_set_index_map () const
2231-
{ return (version == 0 || varIdxMap == 0) ? Null (DeltaSetIndexMap) : this+varIdxMap; }
2234+
{ return has_delta_set_index_map () && hb_barrier () ? this+varIdxMap : Null (DeltaSetIndexMap); }
22322235

22332236
const ItemVariationStore &get_var_store () const
2234-
{ return (version == 0 || varStore == 0) ? Null (ItemVariationStore) : this+varStore; }
2237+
{ return has_var_store () && hb_barrier () ? this+varStore : Null (ItemVariationStore); }
2238+
2239+
const ClipList &get_clip_list () const
2240+
{ return has_clip_list () && hb_barrier () ? this+clipList : Null (ClipList); }
22352241

22362242
bool sanitize (hb_sanitize_context_t *c) const
22372243
{
@@ -2242,7 +2248,6 @@ struct COLR
22422248
(this+layersZ).sanitize (c, numLayers) &&
22432249
(version == 0 ||
22442250
(hb_barrier () &&
2245-
version == 1 &&
22462251
baseGlyphList.sanitize (c, this) &&
22472252
layerList.sanitize (c, this) &&
22482253
clipList.sanitize (c, this) &&
@@ -2465,7 +2470,9 @@ struct COLR
24652470
if (unlikely (!c->serializer->extend_min (colr_prime))) return_trace (false);
24662471

24672472
if (version == 0 || downgrade_to_V0 (glyphset))
2468-
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
2473+
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
2474+
2475+
hb_barrier ();
24692476

24702477
//start version 1
24712478
if (!c->serializer->allocate_size<void> (5 * HBUINT32::static_size)) return_trace (false);
@@ -2475,8 +2482,8 @@ struct COLR
24752482
* after instancing */
24762483
if (!subset_varstore (c, colr_prime)) return_trace (false);
24772484

2478-
ItemVarStoreInstancer instancer (varStore ? &(this+varStore) : nullptr,
2479-
varIdxMap ? &(this+varIdxMap) : nullptr,
2485+
ItemVarStoreInstancer instancer (&(get_var_store ()),
2486+
&(get_delta_set_index_map ()),
24802487
c->plan->normalized_coords.as_array ());
24812488

24822489
if (!colr_prime->baseGlyphList.serialize_subset (c, baseGlyphList, this, instancer))
@@ -2505,12 +2512,10 @@ struct COLR
25052512
bool
25062513
get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
25072514
{
2508-
if (version != 1)
2509-
return false;
25102515

2511-
ItemVarStoreInstancer instancer (&(this+varStore),
2512-
&(this+varIdxMap),
2513-
hb_array (font->coords, font->num_coords));
2516+
ItemVarStoreInstancer instancer (&(get_var_store ()),
2517+
&(get_delta_set_index_map ()),
2518+
hb_array (font->coords, font->num_coords));
25142519

25152520
if (get_clip (glyph, extents, instancer))
25162521
{
@@ -2545,7 +2550,7 @@ struct COLR
25452550
bool
25462551
has_paint_for_glyph (hb_codepoint_t glyph) const
25472552
{
2548-
if (version == 1)
2553+
if (version >= 1)
25492554
{
25502555
hb_barrier ();
25512556

@@ -2561,7 +2566,7 @@ struct COLR
25612566
hb_glyph_extents_t *extents,
25622567
const ItemVarStoreInstancer instancer) const
25632568
{
2564-
return (this+clipList).get_extents (glyph,
2569+
return get_clip_list ().get_extents (glyph,
25652570
extents,
25662571
instancer);
25672572
}
@@ -2570,13 +2575,13 @@ struct COLR
25702575
bool
25712576
paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, unsigned int palette_index, hb_color_t foreground, bool clip = true) const
25722577
{
2573-
ItemVarStoreInstancer instancer (&(this+varStore),
2574-
&(this+varIdxMap),
2578+
ItemVarStoreInstancer instancer (&(get_var_store ()),
2579+
&(get_delta_set_index_map ()),
25752580
hb_array (font->coords, font->num_coords));
25762581
hb_paint_context_t c (this, funcs, data, font, palette_index, foreground, instancer);
25772582
c.current_glyphs.add (glyph);
25782583

2579-
if (version == 1)
2584+
if (version >= 1)
25802585
{
25812586
hb_barrier ();
25822587

0 commit comments

Comments
 (0)