mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-07 06:25:03 +00:00
[COLR,glyf] Use map instead of set for tracking current glyphs / layers
This commit is contained in:
parent
b530e485cd
commit
06ff3bcb8d
4 changed files with 11 additions and 6 deletions
|
@ -69,8 +69,8 @@ public:
|
|||
unsigned int palette_index;
|
||||
hb_color_t foreground;
|
||||
VarStoreInstancer &instancer;
|
||||
hb_set_t current_glyphs;
|
||||
hb_set_t current_layers;
|
||||
hb_map_t current_glyphs;
|
||||
hb_map_t current_layers;
|
||||
int depth_left = HB_MAX_NESTING_LEVEL;
|
||||
int edge_count = HB_COLRV1_MAX_EDGE_COUNT;
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ struct Glyph
|
|||
bool use_my_metrics = true,
|
||||
bool phantom_only = false,
|
||||
hb_array_t<int> coords = hb_array_t<int> (),
|
||||
hb_set_t *current_glyphs = nullptr,
|
||||
hb_map_t *current_glyphs = nullptr,
|
||||
unsigned int depth = 0,
|
||||
unsigned *edge_count = nullptr) const
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ struct Glyph
|
|||
if (unlikely (*edge_count > HB_GLYF_MAX_EDGE_COUNT)) return false;
|
||||
(*edge_count)++;
|
||||
|
||||
hb_set_t current_glyphs_stack;
|
||||
hb_map_t current_glyphs_stack;
|
||||
if (current_glyphs == nullptr)
|
||||
current_glyphs = ¤t_glyphs_stack;
|
||||
|
||||
|
|
|
@ -105,8 +105,8 @@ struct hb_ft_paint_context_t
|
|||
FT_Color *palette;
|
||||
unsigned palette_index;
|
||||
hb_color_t foreground;
|
||||
hb_set_t current_glyphs;
|
||||
hb_set_t current_layers;
|
||||
hb_map_t current_glyphs;
|
||||
hb_map_t current_layers;
|
||||
int depth_left = HB_MAX_NESTING_LEVEL;
|
||||
int edge_count = HB_COLRV1_MAX_EDGE_COUNT;
|
||||
};
|
||||
|
|
|
@ -276,6 +276,11 @@ struct hb_hashmap_t
|
|||
uint32_t hash = hb_hash (key);
|
||||
return set_with_hash (std::move (key), hash, std::forward<VV> (value), overwrite);
|
||||
}
|
||||
bool add (const K &key)
|
||||
{
|
||||
uint32_t hash = hb_hash (key);
|
||||
return set_with_hash (key, hash, item_t::default_value ());
|
||||
}
|
||||
|
||||
const V& get_with_hash (const K &key, uint32_t hash) const
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue