summaryrefslogtreecommitdiff
path: root/src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-05-03 14:49:00 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-05-04 10:26:09 +0000
commit2fdc4db757ab81aa36ffd2f2458980917da8181e (patch)
treedd24bafa72757710096ccd290ac1f45b5bc787de /src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh
parent50d4e338cf11e83e9d8bb1e0254da60cc528a666 (diff)
downloadqtbase-2fdc4db757ab81aa36ffd2f2458980917da8181e.tar.gz
Update harfbuzz to version 7.2.0
Fixes: QTBUG-113352 Change-Id: I134f5b49c2ae5bef31edfc5cd87f0ff62d6c18b1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 151287fb5182b45736da6b2e2e516bb54e44219a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh b/src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh
index 4914a0ed57..c07716c1c9 100644
--- a/src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh
+++ b/src/3rdparty/harfbuzz-ng/src/OT/Color/CPAL/CPAL.hh
@@ -73,6 +73,30 @@ struct CPALV1Tail
}
public:
+ void collect_name_ids (const void *base,
+ unsigned palette_count,
+ unsigned color_count,
+ const hb_map_t *color_index_map,
+ hb_set_t *nameids_to_retain /* OUT */) const
+ {
+ if (paletteLabelsZ)
+ {
+ + (base+paletteLabelsZ).as_array (palette_count)
+ | hb_sink (nameids_to_retain)
+ ;
+ }
+
+ if (colorLabelsZ)
+ {
+ const hb_array_t<const NameID> colorLabels = (base+colorLabelsZ).as_array (color_count);
+ for (unsigned i = 0; i < color_count; i++)
+ {
+ if (!color_index_map->has (i)) continue;
+ nameids_to_retain->add (colorLabels[i]);
+ }
+ }
+ }
+
bool serialize (hb_serialize_context_t *c,
unsigned palette_count,
unsigned color_count,
@@ -95,13 +119,10 @@ struct CPALV1Tail
if (colorLabelsZ)
{
c->push ();
- for (const auto _ : colorLabels)
+ for (unsigned i = 0; i < color_count; i++)
{
- const hb_codepoint_t *v;
- if (!color_index_map->has (_, &v)) continue;
- NameID new_color_idx;
- new_color_idx = *v;
- if (!c->copy<NameID> (new_color_idx))
+ if (!color_index_map->has (i)) continue;
+ if (!c->copy<NameID> (colorLabels[i]))
{
c->pop_discard ();
return_trace (false);
@@ -189,6 +210,13 @@ struct CPAL
return numColors;
}
+ void collect_name_ids (const hb_map_t *color_index_map,
+ hb_set_t *nameids_to_retain /* OUT */) const
+ {
+ if (version == 1)
+ v1 ().collect_name_ids (this, numPalettes, numColors, color_index_map, nameids_to_retain);
+ }
+
private:
const CPALV1Tail& v1 () const
{