Line | Count | Source |
1 | #ifndef OT_LAYOUT_GPOS_SINGLEPOS_HH | |
2 | #define OT_LAYOUT_GPOS_SINGLEPOS_HH | |
3 | ||
4 | #include "SinglePosFormat1.hh" | |
5 | #include "SinglePosFormat2.hh" | |
6 | ||
7 | namespace OT { | |
8 | namespace Layout { | |
9 | namespace GPOS_impl { | |
10 | ||
11 | struct SinglePos | |
12 | { | |
13 | protected: | |
14 | union { | |
15 | struct { HBUINT16 v; } format; /* Format identifier */ | |
16 | SinglePosFormat1_3<SmallTypes> format1; | |
17 | SinglePosFormat2_4<SmallTypes> format2; | |
18 | #ifndef HB_NO_BEYOND_64K | |
19 | SinglePosFormat1_3<MediumTypes> format3; | |
20 | SinglePosFormat2_4<MediumTypes> format4; | |
21 | #endif | |
22 | } u; | |
23 | ||
24 | public: | |
25 | template<typename Iterator, | |
26 | hb_requires (hb_is_iterator (Iterator))> | |
27 | unsigned get_format (Iterator glyph_val_iter_pairs) | |
28 | 0 | { |
29 | 0 | hb_array_t<const Value> first_val_iter = hb_second (*glyph_val_iter_pairs); |
30 | 0 | |
31 | 0 | for (const auto iter : glyph_val_iter_pairs) |
32 | 0 | for (const auto _ : hb_zip (iter.second, first_val_iter)) |
33 | 0 | if (_.first != _.second) |
34 | 0 | return 2; |
35 | 0 | |
36 | 0 | return 1; |
37 | 0 | }Unexecuted instantiation: _ZN2OT6Layout9GPOS_impl9SinglePos10get_formatI13hb_zip_iter_tI13hb_map_iter_tIN23hb_bit_set_invertible_t6iter_tERK8hb_map_tL24hb_function_sortedness_t1ELPv0EE16hb_repeat_iter_tI10hb_array_tIKNS_7NumTypeILb1EtLj2EEEEEETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSN_6item_tEEE5valueEvE4typeELSC_0EEEjSN_ Unexecuted instantiation: hb-ot-face.cc:_ZN2OT6Layout9GPOS_impl9SinglePos10get_formatI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEjSP_ Unexecuted instantiation: hb-aat-layout.cc:_ZN2OT6Layout9GPOS_impl9SinglePos10get_formatI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEjSP_ Unexecuted instantiation: hb-ot-layout.cc:_ZN2OT6Layout9GPOS_impl9SinglePos10get_formatI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEjSP_ Unexecuted instantiation: hb-ot-shape-fallback.cc:_ZN2OT6Layout9GPOS_impl9SinglePos10get_formatI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEjSP_ |
38 | ||
39 | template<typename Iterator, | |
40 | hb_requires (hb_is_iterator (Iterator))> | |
41 | void serialize (hb_serialize_context_t *c, | |
42 | const ValueBase* src, | |
43 | ValueFormat src_format, | |
44 | Iterator glyph_val_iter_pairs, | |
45 | const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map, | |
46 | unsigned newFormat) | |
47 | 0 | { |
48 | 0 | if (unlikely (!c->extend_min (u.format.v))) return; |
49 | 0 | unsigned format = 2; |
50 | 0 | ValueFormat new_format; |
51 | 0 | new_format = newFormat; |
52 | 0 | |
53 | 0 | if (glyph_val_iter_pairs) |
54 | 0 | format = get_format (glyph_val_iter_pairs); |
55 | 0 | |
56 | 0 | #ifndef HB_NO_BEYOND_64K |
57 | 0 | if (+ glyph_val_iter_pairs |
58 | 0 | | hb_map_retains_sorting (hb_first) |
59 | 0 | | hb_filter ([] (hb_codepoint_t gid) { return gid > 0xFFFFu; })) |
60 | 0 | format += 2; |
61 | 0 | #endif |
62 | 0 | |
63 | 0 | u.format.v = format; |
64 | 0 | switch (u.format.v) { |
65 | 0 | case 1: hb_barrier (); u.format1.serialize (c, |
66 | 0 | src, src_format, |
67 | 0 | glyph_val_iter_pairs, |
68 | 0 | new_format, |
69 | 0 | layout_variation_idx_delta_map); |
70 | 0 | return; |
71 | 0 | case 2: hb_barrier (); u.format2.serialize (c, |
72 | 0 | src, src_format, |
73 | 0 | glyph_val_iter_pairs, |
74 | 0 | new_format, |
75 | 0 | layout_variation_idx_delta_map); |
76 | 0 | return; |
77 | 0 | #ifndef HB_NO_BEYOND_64K |
78 | 0 | case 3: u.format3.serialize (c, |
79 | 0 | src, src_format, |
80 | 0 | glyph_val_iter_pairs, |
81 | 0 | new_format, |
82 | 0 | layout_variation_idx_delta_map); |
83 | 0 | return; |
84 | 0 | case 4: u.format4.serialize (c, |
85 | 0 | src, src_format, |
86 | 0 | glyph_val_iter_pairs, |
87 | 0 | new_format, |
88 | 0 | layout_variation_idx_delta_map); |
89 | 0 | return; |
90 | 0 | #endif |
91 | 0 | default:return; |
92 | 0 | } |
93 | 0 | }Unexecuted instantiation: _ZN2OT6Layout9GPOS_impl9SinglePos9serializeI13hb_zip_iter_tI13hb_map_iter_tIN23hb_bit_set_invertible_t6iter_tERK8hb_map_tL24hb_function_sortedness_t1ELPv0EE16hb_repeat_iter_tI10hb_array_tIKNS_7NumTypeILb1EtLj2EEEEEETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSN_6item_tEEE5valueEvE4typeELSC_0EEEvP22hb_serialize_context_tPKNS1_9ValueBaseENS1_11ValueFormatESN_PK12hb_hashmap_tIj9hb_pair_tIjiELb0EEj Unexecuted instantiation: hb-ot-face.cc:_ZN2OT6Layout9GPOS_impl9SinglePos9serializeI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEvP22hb_serialize_context_tPKNS1_9ValueBaseENS1_11ValueFormatESP_PK12hb_hashmap_tIj9hb_pair_tIjiELb0EEj Unexecuted instantiation: hb-aat-layout.cc:_ZN2OT6Layout9GPOS_impl9SinglePos9serializeI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEvP22hb_serialize_context_tPKNS1_9ValueBaseENS1_11ValueFormatESP_PK12hb_hashmap_tIj9hb_pair_tIjiELb0EEj Unexecuted instantiation: hb-ot-layout.cc:_ZN2OT6Layout9GPOS_impl9SinglePos9serializeI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEvP22hb_serialize_context_tPKNS1_9ValueBaseENS1_11ValueFormatESP_PK12hb_hashmap_tIj9hb_pair_tIjiELb0EEj Unexecuted instantiation: hb-ot-shape-fallback.cc:_ZN2OT6Layout9GPOS_impl9SinglePos9serializeI13hb_map_iter_tI16hb_filter_iter_tI13hb_zip_iter_tINS0_6Common8Coverage6iter_tE15hb_range_iter_tIjjEERK8hb_set_tRK3$_7LPv0EENS1_25single_pos_value_mapper_tEL24hb_function_sortedness_t1ELSJ_0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSP_6item_tEEE5valueEvE4typeELSJ_0EEEvP22hb_serialize_context_tPKNS1_9ValueBaseENS1_11ValueFormatESP_PK12hb_hashmap_tIj9hb_pair_tIjiELb0EEj |
94 | ||
95 | template <typename context_t, typename ...Ts> | |
96 | typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const | |
97 | 0 | { |
98 | 0 | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); |
99 | 0 | TRACE_DISPATCH (this, u.format.v); |
100 | 0 | switch (u.format.v) { |
101 | 0 | case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); |
102 | 0 | case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); |
103 | #ifndef HB_NO_BEYOND_64K | |
104 | case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...)); | |
105 | case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...)); | |
106 | #endif | |
107 | 0 | default:return_trace (c->default_return_value ()); |
108 | 0 | } |
109 | 0 | }Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: hb_subset_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<hb_subset_context_t>(hb_subset_context_t*) const Unexecuted instantiation: hb_sanitize_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Layout::GPOS_impl::SinglePos::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const |
110 | }; | |
111 | ||
112 | ||
113 | template<typename Iterator> | |
114 | static void | |
115 | SinglePos_serialize (hb_serialize_context_t *c, | |
116 | const ValueBase *src, | |
117 | ValueFormat src_format, | |
118 | Iterator it, | |
119 | const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map, | |
120 | unsigned new_format) | |
121 | 0 | { c->start_embed<SinglePos> ()->serialize (c, src, src_format, it, layout_variation_idx_delta_map, new_format); }Unexecuted instantiation: hb-ot-face.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > > >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > >, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-ot-face.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0> >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0>, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-aat-layout.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > > >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > >, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-aat-layout.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0> >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0>, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-ot-layout.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > > >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > >, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-ot-layout.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0> >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0>, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > > >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_zip_iter_t<hb_map_iter_t<hb_bit_set_invertible_t::iter_t, hb_map_t const&, (hb_function_sortedness_t)1, (void*)0>, hb_repeat_iter_t<hb_array_t<OT::NumType<true, unsigned short, 2u> const> > >, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::Layout::GPOS_impl::SinglePos_serialize<hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0> >(hb_serialize_context_t*, OT::Layout::GPOS_impl::ValueBase const*, OT::Layout::GPOS_impl::ValueFormat, hb_map_iter_t<hb_filter_iter_t<hb_zip_iter_t<OT::Layout::Common::Coverage::iter_t, hb_range_iter_t<unsigned int, unsigned int> >, hb_set_t const&, $_7 const&, (void*)0>, OT::Layout::GPOS_impl::single_pos_value_mapper_t, (hb_function_sortedness_t)1, (void*)0>, hb_hashmap_t<unsigned int, hb_pair_t<unsigned int, int>, false> const*, unsigned int) |
122 | ||
123 | ||
124 | } | |
125 | } | |
126 | } | |
127 | ||
128 | #endif /* OT_LAYOUT_GPOS_SINGLEPOS_HH */ |