Coverage Report

Created: 2026-01-09 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/harfbuzz/src/hb-ot-layout-gsubgpos.hh
Line
Count
Source
1
/*
2
 * Copyright © 2007,2008,2009,2010  Red Hat, Inc.
3
 * Copyright © 2010,2012  Google, Inc.
4
 *
5
 *  This is part of HarfBuzz, a text shaping library.
6
 *
7
 * Permission is hereby granted, without written agreement and without
8
 * license or royalty fees, to use, copy, modify, and distribute this
9
 * software and its documentation for any purpose, provided that the
10
 * above copyright notice and the following two paragraphs appear in
11
 * all copies of this software.
12
 *
13
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17
 * DAMAGE.
18
 *
19
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
22
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24
 *
25
 * Red Hat Author(s): Behdad Esfahbod
26
 * Google Author(s): Behdad Esfahbod
27
 */
28
29
#ifndef HB_OT_LAYOUT_GSUBGPOS_HH
30
#define HB_OT_LAYOUT_GSUBGPOS_HH
31
32
#include "hb.hh"
33
#include "hb-buffer.hh"
34
#include "hb-map.hh"
35
#include "hb-set.hh"
36
#include "hb-ot-map.hh"
37
#include "hb-ot-layout-common.hh"
38
#include "hb-ot-layout-gdef-table.hh"
39
40
41
namespace OT {
42
43
44
struct hb_intersects_context_t :
45
       hb_dispatch_context_t<hb_intersects_context_t, bool>
46
{
47
  template <typename T>
48
74.9k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Line
Count
Source
48
1.27k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Line
Count
Source
48
5.46k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
3.62k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
1.64k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
39
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
38
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Line
Count
Source
48
6.40k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
3.31k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
73
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
266
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
6
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
543
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
6
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
342
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
163
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
48
664
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
4
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
1.58k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
371
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
48
8.17k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
4.69k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
5.73k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
14
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
4.36k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
2.67k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
472
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
6.98k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
3.35k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
3.83k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
147
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
48
8.63k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
49
10.5M
  static return_t default_return_value () { return false; }
50
8.31M
  bool stop_sublookup_iteration (return_t r) const { return r; }
51
52
  const hb_set_t *glyphs;
53
54
  hb_intersects_context_t (const hb_set_t *glyphs_) :
55
2.36M
                            glyphs (glyphs_) {}
56
};
57
58
struct hb_have_non_1to1_context_t :
59
       hb_dispatch_context_t<hb_have_non_1to1_context_t, bool>
60
{
61
  template <typename T>
62
1.23k
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
297
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
107
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
62
249
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
170
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
233
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
72
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
16
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
62
2
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
62
93
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
63
320k
  static return_t default_return_value () { return false; }
64
159k
  bool stop_sublookup_iteration (return_t r) const { return r; }
65
};
66
67
struct hb_closure_context_t :
68
       hb_dispatch_context_t<hb_closure_context_t>
69
{
70
  typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indicies, unsigned seq_index, unsigned end_index);
71
  template <typename T>
72
109k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
12.3k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
32.9k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
103
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
17.0k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
4.81k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
1.29k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
12.9k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
14.1k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
2.72k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
129
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
476
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
128
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
72
850
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
14
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
296
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
230
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
72
4.86k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
72
4.58k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
73
14.1M
  static return_t default_return_value () { return hb_empty_t (); }
74
  void recurse (unsigned lookup_index, hb_set_t *covered_seq_indicies, unsigned seq_index, unsigned end_index)
75
3.36M
  {
76
3.36M
    if (unlikely (nesting_level_left == 0 || !recurse_func))
77
0
      return;
78
79
3.36M
    nesting_level_left--;
80
3.36M
    recurse_func (this, lookup_index, covered_seq_indicies, seq_index, end_index);
81
3.36M
    nesting_level_left++;
82
3.36M
  }
83
84
  void reset_lookup_visit_count ()
85
30.6k
  { lookup_count = 0; }
86
87
  bool lookup_limit_exceeded ()
88
24.8k
  { return lookup_count > HB_MAX_LOOKUP_VISIT_COUNT; }
89
90
  bool should_visit_lookup (unsigned int lookup_index)
91
6.66M
  {
92
6.66M
    if (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT)
93
871k
      return false;
94
95
5.79M
    if (is_lookup_done (lookup_index))
96
3.17M
      return false;
97
98
2.62M
    return true;
99
5.79M
  }
100
101
  bool is_lookup_done (unsigned int lookup_index)
102
5.79M
  {
103
5.79M
    if (unlikely (done_lookups_glyph_count->in_error () ||
104
5.79M
      done_lookups_glyph_set->in_error ()))
105
3.88k
      return true;
106
107
    /* Have we visited this lookup with the current set of glyphs? */
108
5.79M
    if (done_lookups_glyph_count->get (lookup_index) != glyphs->get_population ())
109
2.60M
    {
110
2.60M
      done_lookups_glyph_count->set (lookup_index, glyphs->get_population ());
111
112
2.60M
      if (!done_lookups_glyph_set->has (lookup_index))
113
1.06M
      {
114
1.06M
  if (unlikely (!done_lookups_glyph_set->set (lookup_index, hb::unique_ptr<hb_set_t> {hb_set_create ()})))
115
60
    return true;
116
1.06M
      }
117
118
2.60M
      done_lookups_glyph_set->get (lookup_index)->clear ();
119
2.60M
    }
120
121
5.79M
    hb_set_t *covered_glyph_set = done_lookups_glyph_set->get (lookup_index);
122
5.79M
    if (unlikely (covered_glyph_set->in_error ()))
123
1.25k
      return true;
124
5.78M
    if (parent_active_glyphs ().is_subset (*covered_glyph_set))
125
3.16M
      return true;
126
127
2.62M
    covered_glyph_set->union_ (parent_active_glyphs ());
128
2.62M
    return false;
129
5.78M
  }
130
131
6.33k
  const hb_set_t& previous_parent_active_glyphs () {
132
6.33k
    if (active_glyphs_stack.length <= 1)
133
5.79k
      return *glyphs;
134
135
541
    return active_glyphs_stack[active_glyphs_stack.length - 2];
136
6.33k
  }
137
138
  const hb_set_t& parent_active_glyphs ()
139
8.51M
  {
140
8.51M
    if (!active_glyphs_stack)
141
5.84M
      return *glyphs;
142
143
2.66M
    return active_glyphs_stack.tail ();
144
8.51M
  }
145
146
  hb_set_t* push_cur_active_glyphs ()
147
3.36M
  {
148
3.36M
    hb_set_t *s = active_glyphs_stack.push ();
149
3.36M
    if (unlikely (active_glyphs_stack.in_error ()))
150
1
      return nullptr;
151
3.36M
    return s;
152
3.36M
  }
153
154
  bool pop_cur_done_glyphs ()
155
3.36M
  {
156
3.36M
    if (!active_glyphs_stack)
157
0
      return false;
158
159
3.36M
    active_glyphs_stack.pop ();
160
3.36M
    return true;
161
3.36M
  }
162
163
  hb_face_t *face;
164
  hb_set_t *glyphs;
165
  hb_set_t output[1];
166
  hb_vector_t<hb_set_t> active_glyphs_stack;
167
  recurse_func_t recurse_func = nullptr;
168
  unsigned int nesting_level_left;
169
170
  hb_closure_context_t (hb_face_t *face_,
171
      hb_set_t *glyphs_,
172
      hb_map_t *done_lookups_glyph_count_,
173
      hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set_,
174
      unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
175
20.5k
        face (face_),
176
20.5k
        glyphs (glyphs_),
177
20.5k
        nesting_level_left (nesting_level_left_),
178
20.5k
        done_lookups_glyph_count (done_lookups_glyph_count_),
179
20.5k
        done_lookups_glyph_set (done_lookups_glyph_set_)
180
20.5k
  {}
181
182
20.5k
  ~hb_closure_context_t () { flush (); }
183
184
2.45M
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
185
186
  void flush ()
187
2.47M
  {
188
2.47M
    output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID);  /* Remove invalid glyphs. */
189
2.47M
    glyphs->union_ (*output);
190
2.47M
    output->clear ();
191
2.47M
    active_glyphs_stack.pop ();
192
2.47M
    active_glyphs_stack.reset ();
193
2.47M
  }
194
195
  private:
196
  hb_map_t *done_lookups_glyph_count;
197
  hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set;
198
  unsigned int lookup_count = 0;
199
};
200
201
202
203
struct hb_closure_lookups_context_t :
204
       hb_dispatch_context_t<hb_closure_lookups_context_t>
205
{
206
  typedef return_t (*recurse_func_t) (hb_closure_lookups_context_t *c, unsigned lookup_index);
207
  template <typename T>
208
27.0k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Line
Count
Source
208
582
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Line
Count
Source
208
3.28k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
1.13k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
656
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
13
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
12
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Line
Count
Source
208
3.42k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
960
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
36
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
69
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
27
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
6
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
187
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
12
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
208
236
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
59
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
26
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
208
304
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
1.92k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
3.61k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
13
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
2.51k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
1.88k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
407
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
2.78k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
2.02k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
761
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
36
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
208
55
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
209
2.23M
  static return_t default_return_value () { return hb_empty_t (); }
210
  void recurse (unsigned lookup_index)
211
21.5M
  {
212
21.5M
    if (unlikely (nesting_level_left == 0 || !recurse_func))
213
0
      return;
214
215
    /* Return if new lookup was recursed to before. */
216
21.5M
    if (lookup_limit_exceeded ()
217
21.5M
        || visited_lookups->in_error ()
218
21.5M
        || visited_lookups->has (lookup_index))
219
      // Don't increment lookup count here, that will be done in the call to closure_lookups()
220
      // made by recurse_func.
221
21.1M
      return;
222
223
420k
    nesting_level_left--;
224
420k
    recurse_func (this, lookup_index);
225
420k
    nesting_level_left++;
226
420k
  }
227
228
  void set_lookup_visited (unsigned lookup_index)
229
1.89M
  { visited_lookups->add (lookup_index); }
230
231
  void set_lookup_inactive (unsigned lookup_index)
232
1.88M
  { inactive_lookups->add (lookup_index); }
233
234
  bool lookup_limit_exceeded ()
235
21.5M
  {
236
21.5M
    bool ret = lookup_count > HB_MAX_LOOKUP_VISIT_COUNT;
237
21.5M
    if (ret)
238
0
      DEBUG_MSG (SUBSET, nullptr, "lookup visit count limit exceeded in lookup closure!");
239
21.5M
    return ret; }
240
241
  bool is_lookup_visited (unsigned lookup_index)
242
1.92M
  {
243
1.92M
    if (unlikely (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT))
244
0
    {
245
0
      DEBUG_MSG (SUBSET, nullptr, "total visited lookup count %u exceeds max limit, lookup %u is dropped.",
246
0
                 lookup_count, lookup_index);
247
0
      return true;
248
0
    }
249
250
1.92M
    if (unlikely (visited_lookups->in_error ()))
251
13.7k
      return true;
252
253
1.90M
    return visited_lookups->has (lookup_index);
254
1.92M
  }
255
256
  hb_face_t *face;
257
  const hb_set_t *glyphs;
258
  recurse_func_t recurse_func;
259
  unsigned int nesting_level_left;
260
261
  hb_closure_lookups_context_t (hb_face_t *face_,
262
        const hb_set_t *glyphs_,
263
        hb_set_t *visited_lookups_,
264
        hb_set_t *inactive_lookups_,
265
        unsigned nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
266
49.1k
        face (face_),
267
49.1k
        glyphs (glyphs_),
268
49.1k
        recurse_func (nullptr),
269
49.1k
        nesting_level_left (nesting_level_left_),
270
49.1k
        visited_lookups (visited_lookups_),
271
49.1k
        inactive_lookups (inactive_lookups_),
272
49.1k
        lookup_count (0) {}
273
274
49.1k
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
275
276
  private:
277
  hb_set_t *visited_lookups;
278
  hb_set_t *inactive_lookups;
279
  unsigned int lookup_count;
280
};
281
282
struct hb_would_apply_context_t :
283
       hb_dispatch_context_t<hb_would_apply_context_t, bool>
284
{
285
  template <typename T>
286
0
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
287
0
  static return_t default_return_value () { return false; }
288
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
289
290
  hb_face_t *face;
291
  const hb_codepoint_t *glyphs;
292
  unsigned int len;
293
  bool zero_context;
294
295
  hb_would_apply_context_t (hb_face_t *face_,
296
          const hb_codepoint_t *glyphs_,
297
          unsigned int len_,
298
          bool zero_context_) :
299
0
            face (face_),
300
0
            glyphs (glyphs_),
301
0
            len (len_),
302
0
            zero_context (zero_context_) {}
303
};
304
305
struct hb_collect_glyphs_context_t :
306
       hb_dispatch_context_t<hb_collect_glyphs_context_t>
307
{
308
  typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index);
309
  template <typename T>
310
0
  return_t dispatch (const T &obj) { obj.collect_glyphs (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
311
0
  static return_t default_return_value () { return hb_empty_t (); }
312
  void recurse (unsigned int lookup_index)
313
0
  {
314
0
    if (unlikely (nesting_level_left == 0 || !recurse_func))
315
0
      return;
316
317
    /* Note that GPOS sets recurse_func to nullptr already, so it doesn't get
318
     * past the previous check.  For GSUB, we only want to collect the output
319
     * glyphs in the recursion.  If output is not requested, we can go home now.
320
     *
321
     * Note further, that the above is not exactly correct.  A recursed lookup
322
     * is allowed to match input that is not matched in the context, but that's
323
     * not how most fonts are built.  It's possible to relax that and recurse
324
     * with all sets here if it proves to be an issue.
325
     */
326
327
0
    if (output == hb_set_get_empty ())
328
0
      return;
329
330
    /* Return if new lookup was recursed to before. */
331
0
    if (recursed_lookups->has (lookup_index))
332
0
      return;
333
334
0
    hb_set_t *old_before = before;
335
0
    hb_set_t *old_input  = input;
336
0
    hb_set_t *old_after  = after;
337
0
    before = input = after = hb_set_get_empty ();
338
339
0
    nesting_level_left--;
340
0
    recurse_func (this, lookup_index);
341
0
    nesting_level_left++;
342
343
0
    before = old_before;
344
0
    input  = old_input;
345
0
    after  = old_after;
346
347
0
    recursed_lookups->add (lookup_index);
348
0
  }
349
350
  hb_face_t *face;
351
  hb_set_t *before;
352
  hb_set_t *input;
353
  hb_set_t *after;
354
  hb_set_t *output;
355
  recurse_func_t recurse_func;
356
  hb_set_t *recursed_lookups;
357
  unsigned int nesting_level_left;
358
359
  hb_collect_glyphs_context_t (hb_face_t *face_,
360
             hb_set_t  *glyphs_before, /* OUT.  May be NULL */
361
             hb_set_t  *glyphs_input,  /* OUT.  May be NULL */
362
             hb_set_t  *glyphs_after,  /* OUT.  May be NULL */
363
             hb_set_t  *glyphs_output, /* OUT.  May be NULL */
364
             unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
365
0
            face (face_),
366
0
            before (glyphs_before ? glyphs_before : hb_set_get_empty ()),
367
0
            input  (glyphs_input  ? glyphs_input  : hb_set_get_empty ()),
368
0
            after  (glyphs_after  ? glyphs_after  : hb_set_get_empty ()),
369
0
            output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
370
0
            recurse_func (nullptr),
371
0
            recursed_lookups (hb_set_create ()),
372
0
            nesting_level_left (nesting_level_left_) {}
373
0
  ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); }
374
375
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
376
};
377
378
379
380
template <typename set_t>
381
struct hb_collect_coverage_context_t :
382
       hb_dispatch_context_t<hb_collect_coverage_context_t<set_t>, const Coverage &>
383
{
384
  typedef const Coverage &return_t; // Stoopid that we have to dupe this here.
385
  template <typename T>
386
  return_t dispatch (const T &obj) { return obj.get_coverage (); }
387
  static return_t default_return_value () { return Null (Coverage); }
388
  bool stop_sublookup_iteration (return_t r) const
389
  {
390
    r.collect_coverage (set);
391
    return false;
392
  }
393
394
  hb_collect_coverage_context_t (set_t *set_) :
395
           set (set_) {}
396
397
  set_t *set;
398
};
399
400
struct matcher_t
401
{
402
  typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data);
403
404
  template <typename context_t>
405
  void init (const context_t *c, bool context_match = false)
406
0
  {
407
0
    set_match_func (nullptr, nullptr);
408
0
    lookup_props = c->lookup_props;
409
    /* Ignore ZWNJ if we are matching GPOS, or matching GSUB context and asked to. */
410
0
    ignore_zwnj = c->table_index == 1 || (context_match && c->auto_zwnj);
411
    /* Ignore ZWJ if we are matching context, or asked to. */
412
0
    ignore_zwj = context_match || c->auto_zwj;
413
    /* Ignore hidden glyphs (like CGJ) during GPOS. */
414
0
    ignore_hidden = c->table_index == 1;
415
0
    mask = context_match ? -1 : c->lookup_mask;
416
    /* Per syllable matching is only for GSUB. */
417
0
    per_syllable = c->table_index == 0 && c->per_syllable;
418
0
    syllable = 0;
419
0
  }
420
421
  void set_match_func (match_func_t match_func_,
422
           const void *match_data_)
423
0
  { match_func = match_func_; match_data = match_data_; }
424
425
  enum may_match_t {
426
    MATCH_NO,
427
    MATCH_YES,
428
    MATCH_MAYBE
429
  };
430
431
#ifndef HB_OPTIMIZE_SIZE
432
  HB_ALWAYS_INLINE
433
#endif
434
  may_match_t may_match (hb_glyph_info_t &info,
435
       hb_codepoint_t glyph_data) const
436
0
  {
437
0
    if (!(info.mask & mask) ||
438
0
  (per_syllable && syllable && syllable != info.syllable ()))
439
0
      return MATCH_NO;
440
441
0
    if (match_func)
442
0
      return match_func (info, glyph_data, match_data) ? MATCH_YES : MATCH_NO;
443
444
0
    return MATCH_MAYBE;
445
0
  }
446
447
  enum may_skip_t {
448
    SKIP_NO,
449
    SKIP_YES,
450
    SKIP_MAYBE
451
  };
452
453
  template <typename context_t>
454
#ifndef HB_OPTIMIZE_SIZE
455
  HB_ALWAYS_INLINE
456
#endif
457
  may_skip_t may_skip (const context_t *c,
458
           const hb_glyph_info_t &info) const
459
0
  {
460
0
    if (!c->check_glyph_property (&info, lookup_props))
461
0
      return SKIP_YES;
462
463
0
    if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
464
0
      (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
465
0
      (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
466
0
      (ignore_hidden || !_hb_glyph_info_is_hidden (&info))))
467
0
      return SKIP_MAYBE;
468
469
0
    return SKIP_NO;
470
0
  }
471
472
  public:
473
  unsigned int lookup_props = 0;
474
  hb_mask_t mask = -1;
475
  bool ignore_zwnj = false;
476
  bool ignore_zwj = false;
477
  bool ignore_hidden = false;
478
  bool per_syllable = false;
479
  uint8_t syllable = 0;
480
  match_func_t match_func = nullptr;
481
  const void *match_data = nullptr;
482
};
483
484
template <typename context_t>
485
struct skipping_iterator_t
486
{
487
  void init (context_t *c_, bool context_match = false)
488
0
  {
489
0
    c = c_;
490
0
    end = c->buffer->len;
491
0
    match_glyph_data16 = nullptr;
492
0
#ifndef HB_NO_BEYOND_64K
493
0
    match_glyph_data24 = nullptr;
494
0
#endif
495
0
    matcher.init (c, context_match);
496
0
  }
497
  void set_lookup_props (unsigned int lookup_props)
498
0
  {
499
0
    matcher.lookup_props = lookup_props;
500
0
  }
501
  void set_match_func (matcher_t::match_func_t match_func_,
502
           const void *match_data_)
503
0
  {
504
0
    matcher.set_match_func (match_func_, match_data_);
505
0
  }
506
  void set_glyph_data (const HBUINT16 glyph_data[])
507
0
  {
508
0
    match_glyph_data16 = glyph_data;
509
0
#ifndef HB_NO_BEYOND_64K
510
0
    match_glyph_data24 = nullptr;
511
0
#endif
512
0
  }
513
#ifndef HB_NO_BEYOND_64K
514
  void set_glyph_data (const HBUINT24 glyph_data[])
515
0
  {
516
0
    match_glyph_data16 = nullptr;
517
0
    match_glyph_data24 = glyph_data;
518
0
  }
519
#endif
520
521
#ifndef HB_OPTIMIZE_SIZE
522
  HB_ALWAYS_INLINE
523
#endif
524
  void reset (unsigned int start_index_)
525
0
  {
526
    // For GSUB forward iterator
527
0
    idx = start_index_;
528
0
    end = c->buffer->len;
529
0
    matcher.syllable = c->buffer->cur().syllable();
530
0
  }
531
  void reset_back (unsigned int start_index_, bool from_out_buffer = false)
532
0
  {
533
    // For GSUB backward iterator
534
0
    idx = start_index_;
535
0
    matcher.syllable = c->buffer->cur().syllable();
536
0
  }
537
538
#ifndef HB_OPTIMIZE_SIZE
539
  HB_ALWAYS_INLINE
540
#endif
541
  void reset_fast (unsigned int start_index_)
542
0
  {
543
    // Doesn't set end or syllable. Used by GPOS which doesn't care / change.
544
0
    idx = start_index_;
545
0
  }
546
547
#ifndef HB_OPTIMIZE_SIZE
548
  HB_ALWAYS_INLINE
549
#endif
550
  matcher_t::may_skip_t may_skip (const hb_glyph_info_t &info) const
551
0
  { return matcher.may_skip (c, info); }
552
553
  enum match_t {
554
    MATCH,
555
    NOT_MATCH,
556
    SKIP
557
  };
558
559
#ifndef HB_OPTIMIZE_SIZE
560
  HB_ALWAYS_INLINE
561
#endif
562
  match_t match (hb_glyph_info_t &info)
563
0
  {
564
0
    matcher_t::may_skip_t skip = matcher.may_skip (c, info);
565
0
    if (unlikely (skip == matcher_t::SKIP_YES))
566
0
      return SKIP;
567
568
0
    matcher_t::may_match_t match = matcher.may_match (info, get_glyph_data ());
569
0
    if (match == matcher_t::MATCH_YES ||
570
0
  (match == matcher_t::MATCH_MAYBE &&
571
0
   skip == matcher_t::SKIP_NO))
572
0
      return MATCH;
573
574
0
    if (skip == matcher_t::SKIP_NO)
575
0
      return NOT_MATCH;
576
577
0
    return SKIP;
578
0
  }
579
580
#ifndef HB_OPTIMIZE_SIZE
581
  HB_ALWAYS_INLINE
582
#endif
583
  bool next (unsigned *unsafe_to = nullptr)
584
0
  {
585
0
    auto *info = c->buffer->info;
586
0
    const signed stop = (signed) end - 1;
587
0
    while ((signed) idx < stop)
588
0
    {
589
0
      idx++;
590
0
      switch (match (info[idx]))
591
0
      {
592
0
  case MATCH:
593
0
  {
594
0
    advance_glyph_data ();
595
0
    return true;
596
0
  }
597
0
  case NOT_MATCH:
598
0
  {
599
0
    if (unsafe_to)
600
0
      *unsafe_to = idx + 1;
601
0
    return false;
602
0
  }
603
0
  case SKIP:
604
0
    continue;
605
0
      }
606
0
    }
607
0
    if (unsafe_to)
608
0
      *unsafe_to = end;
609
0
    return false;
610
0
  }
611
#ifndef HB_OPTIMIZE_SIZE
612
  HB_ALWAYS_INLINE
613
#endif
614
  bool prev (unsigned *unsafe_from = nullptr)
615
0
  {
616
0
    auto *out_info = c->buffer->out_info;
617
0
    const unsigned stop = 0;
618
0
    while (idx > stop)
619
0
    {
620
0
      idx--;
621
0
      switch (match (out_info[idx]))
622
0
      {
623
0
  case MATCH:
624
0
  {
625
0
    advance_glyph_data ();
626
0
    return true;
627
0
  }
628
0
  case NOT_MATCH:
629
0
  {
630
0
    if (unsafe_from)
631
0
      *unsafe_from = hb_max (1u, idx) - 1u;
632
0
    return false;
633
0
  }
634
0
  case SKIP:
635
0
    continue;
636
0
      }
637
0
    }
638
0
    if (unsafe_from)
639
0
      *unsafe_from = 0;
640
0
    return false;
641
0
  }
642
643
  HB_ALWAYS_INLINE
644
  hb_codepoint_t
645
  get_glyph_data ()
646
0
  {
647
0
    if (match_glyph_data16) return *match_glyph_data16;
648
0
#ifndef HB_NO_BEYOND_64K
649
0
    else
650
0
    if (match_glyph_data24) return *match_glyph_data24;
651
0
#endif
652
0
    return 0;
653
0
  }
654
  HB_ALWAYS_INLINE
655
  void
656
  advance_glyph_data ()
657
0
  {
658
0
    if (match_glyph_data16) match_glyph_data16++;
659
0
#ifndef HB_NO_BEYOND_64K
660
0
    else
661
0
    if (match_glyph_data24) match_glyph_data24++;
662
0
#endif
663
0
  }
664
665
  unsigned int idx;
666
  protected:
667
  context_t *c;
668
  matcher_t matcher;
669
  const HBUINT16 *match_glyph_data16;
670
#ifndef HB_NO_BEYOND_64K
671
  const HBUINT24 *match_glyph_data24;
672
#endif
673
674
  unsigned int end;
675
};
676
677
struct hb_ot_apply_context_t :
678
       hb_dispatch_context_t<hb_ot_apply_context_t, bool, HB_DEBUG_APPLY>
679
{
680
0
  const char *get_name () { return "APPLY"; }
681
  typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index);
682
683
  template <typename T>
684
  static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (return_t, obj.apply (c, nullptr) )
685
  template <typename T>
686
  static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (return_t, obj.apply (c) )
687
  template <typename T>
688
0
  return_t dispatch (const T &obj) { return apply_(obj, this, hb_prioritize); }
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
689
690
0
  static return_t default_return_value () { return false; }
691
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
692
  return_t recurse (unsigned int sub_lookup_index)
693
0
  {
694
0
    assert (recurse_func);
695
0
    if (unlikely (nesting_level_left == 0))
696
0
    {
697
0
      buffer->successful = false;
698
0
      return default_return_value ();
699
0
    }
700
701
0
    buffer->max_ops--;
702
0
    if (unlikely (buffer->max_ops < 0))
703
0
    {
704
0
      buffer->successful = false;
705
0
      return default_return_value ();
706
0
    }
707
708
0
    nesting_level_left--;
709
0
    bool ret = recurse_func (this, sub_lookup_index);
710
0
    nesting_level_left++;
711
0
    return ret;
712
0
  }
713
714
  skipping_iterator_t<hb_ot_apply_context_t> iter_input, iter_context;
715
716
  unsigned int table_index; /* GSUB/GPOS */
717
  hb_font_t *font;
718
  hb_face_t *face;
719
  hb_buffer_t *buffer;
720
  hb_sanitize_context_t sanitizer;
721
  recurse_func_t recurse_func = nullptr;
722
  const GDEF &gdef;
723
  const GDEF::accelerator_t &gdef_accel;
724
  const hb_ot_layout_lookup_accelerator_t *lookup_accel = nullptr;
725
  const ItemVariationStore &var_store;
726
  hb_scalar_cache_t *var_store_cache;
727
728
  hb_direction_t direction;
729
  hb_mask_t lookup_mask = 1;
730
  unsigned int lookup_index = (unsigned) -1;
731
  unsigned int lookup_props = 0;
732
  unsigned int nesting_level_left = HB_MAX_NESTING_LEVEL;
733
734
  bool has_glyph_classes;
735
  bool auto_zwnj = true;
736
  bool auto_zwj = true;
737
  bool per_syllable = false;
738
  bool random = false;
739
  unsigned new_syllables = (unsigned) -1;
740
741
  signed last_base = -1; // GPOS uses
742
  unsigned last_base_until = 0; // GPOS uses
743
744
  hb_vector_t<uint32_t> match_positions;
745
  uint32_t stack_match_positions[8];
746
747
  hb_ot_apply_context_t (unsigned int table_index_,
748
       hb_font_t *font_,
749
       hb_buffer_t *buffer_,
750
       hb_blob_t *table_blob_,
751
       hb_scalar_cache_t *var_store_cache_ = nullptr) :
752
0
      table_index (table_index_),
753
0
      font (font_), face (font->face), buffer (buffer_),
754
0
      sanitizer (table_blob_),
755
      gdef (
756
#ifndef HB_NO_OT_LAYOUT
757
0
            *face->table.GDEF->table
758
#else
759
            Null (GDEF)
760
#endif
761
           ),
762
      gdef_accel (
763
#ifndef HB_NO_OT_LAYOUT
764
0
            *face->table.GDEF
765
#else
766
            Null (GDEF::accelerator_t)
767
#endif
768
           ),
769
0
      var_store (gdef.get_var_store ()),
770
0
      var_store_cache (var_store_cache_),
771
0
      direction (buffer_->props.direction),
772
0
      has_glyph_classes (gdef.has_glyph_classes ())
773
0
  {
774
0
    init_iters ();
775
0
    match_positions.set_storage (stack_match_positions);
776
0
  }
777
778
  void init_iters ()
779
0
  {
780
0
    iter_input.init (this, false);
781
0
    iter_context.init (this, true);
782
0
  }
783
784
0
  void set_lookup_mask (hb_mask_t mask, bool init = true) { lookup_mask = mask; last_base = -1; last_base_until = 0; if (init) init_iters (); }
785
0
  void set_auto_zwj (bool auto_zwj_, bool init = true) { auto_zwj = auto_zwj_; if (init) init_iters (); }
786
0
  void set_auto_zwnj (bool auto_zwnj_, bool init = true) { auto_zwnj = auto_zwnj_; if (init) init_iters (); }
787
0
  void set_per_syllable (bool per_syllable_, bool init = true) { per_syllable = per_syllable_; if (init) init_iters (); }
788
0
  void set_random (bool random_) { random = random_; }
789
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
790
0
  void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
791
  void set_lookup_props (unsigned int lookup_props_)
792
0
  {
793
0
    lookup_props = gdef_accel.sanitize_lookup_props (lookup_props_);
794
0
    init_iters ();
795
0
  }
796
797
  uint32_t random_number ()
798
0
  {
799
    /* http://www.cplusplus.com/reference/random/minstd_rand/ */
800
0
    buffer->random_state = buffer->random_state * 48271 % 2147483647;
801
0
    return buffer->random_state;
802
0
  }
803
804
  HB_ALWAYS_INLINE
805
  HB_HOT
806
  bool match_properties_mark (const hb_glyph_info_t *info,
807
            unsigned int    glyph_props,
808
            unsigned int    match_props) const
809
0
  {
810
    /* If using mark filtering sets, the high short of
811
     * match_props has the set index.
812
     */
813
0
    if (match_props & LookupFlag::UseMarkFilteringSet)
814
0
      return gdef_accel.mark_set_covers (match_props >> 16, info->codepoint);
815
816
    /* The second byte of match_props has the meaning
817
     * "ignore marks of attachment type different than
818
     * the attachment type specified."
819
     */
820
0
    if (match_props & LookupFlag::MarkAttachmentType)
821
0
      return (match_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType);
822
823
0
    return true;
824
0
  }
825
826
#ifndef HB_OPTIMIZE_SIZE
827
  HB_ALWAYS_INLINE
828
#endif
829
  bool check_glyph_property (const hb_glyph_info_t *info,
830
           unsigned match_props) const
831
0
  {
832
0
    unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info);
833
834
    /* Not covered, if, for example, glyph class is ligature and
835
     * match_props includes LookupFlags::IgnoreLigatures
836
     */
837
0
    if (glyph_props & match_props & LookupFlag::IgnoreFlags)
838
0
      return false;
839
840
0
    if (glyph_props & HB_OT_LAYOUT_GLYPH_PROPS_MARK)
841
0
      return match_properties_mark (info, glyph_props, match_props);
842
843
0
    return true;
844
0
  }
845
846
  void _set_glyph_class (hb_codepoint_t glyph_index,
847
        unsigned int class_guess = 0,
848
        bool ligature = false,
849
        bool component = false)
850
0
  {
851
0
    buffer->digest.add (glyph_index);
852
853
0
    if (new_syllables != (unsigned) -1)
854
0
      buffer->cur().syllable() = new_syllables;
855
856
0
    unsigned int props = _hb_glyph_info_get_glyph_props (&buffer->cur());
857
0
    props |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED;
858
0
    if (ligature)
859
0
    {
860
0
      props |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED;
861
      /* In the only place that the MULTIPLIED bit is used, Uniscribe
862
       * seems to only care about the "last" transformation between
863
       * Ligature and Multiple substitutions.  Ie. if you ligate, expand,
864
       * and ligate again, it forgives the multiplication and acts as
865
       * if only ligation happened.  As such, clear MULTIPLIED bit.
866
       */
867
0
      props &= ~HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
868
0
    }
869
0
    if (component)
870
0
      props |= HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
871
0
    if (likely (has_glyph_classes))
872
0
    {
873
0
      props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
874
0
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props | gdef_accel.get_glyph_props (glyph_index));
875
0
    }
876
0
    else if (class_guess)
877
0
    {
878
0
      props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
879
0
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props | class_guess);
880
0
    }
881
0
    else
882
0
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props);
883
0
  }
884
885
  void replace_glyph (hb_codepoint_t glyph_index)
886
0
  {
887
0
    _set_glyph_class (glyph_index);
888
0
    (void) buffer->replace_glyph (glyph_index);
889
0
  }
890
  void replace_glyph_inplace (hb_codepoint_t glyph_index)
891
0
  {
892
0
    _set_glyph_class (glyph_index);
893
0
    buffer->cur().codepoint = glyph_index;
894
0
  }
895
  void replace_glyph_with_ligature (hb_codepoint_t glyph_index,
896
            unsigned int class_guess)
897
0
  {
898
0
    _set_glyph_class (glyph_index, class_guess, true);
899
0
    (void) buffer->replace_glyph (glyph_index);
900
0
  }
901
  void output_glyph_for_component (hb_codepoint_t glyph_index,
902
           unsigned int class_guess)
903
0
  {
904
0
    _set_glyph_class (glyph_index, class_guess, false, true);
905
0
    (void) buffer->output_glyph (glyph_index);
906
0
  }
907
};
908
909
enum class hb_ot_subtable_cache_op_t
910
{
911
  ENTER,
912
  LEAVE,
913
};
914
915
struct hb_accelerate_subtables_context_t :
916
       hb_dispatch_context_t<hb_accelerate_subtables_context_t>
917
{
918
  template <typename T>
919
  static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) )
920
  template <typename T>
921
  static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) )
922
  template <typename T>
923
  static inline bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
924
0
  {
925
0
    const T *typed_obj = (const T *) obj;
926
0
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
927
0
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat2>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::CursivePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
928
929
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
930
  template <typename T>
931
  static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<2>) HB_RETURN (bool, obj->apply_cached (c, external_cache) )
932
  template <typename T>
933
  static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) )
934
  template <typename T>
935
  static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) )
936
  template <typename T>
937
  static inline bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
938
0
  {
939
0
    const T *typed_obj = (const T *) obj;
940
0
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
941
0
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::SinglePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::SinglePosFormat2>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::CursivePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
942
943
  template <typename T>
944
  static inline auto cache_func_ (hb_ot_apply_context_t *c,
945
          hb_ot_subtable_cache_op_t op,
946
          hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) )
947
  template <typename T=void>
948
  static inline bool cache_func_ (hb_ot_apply_context_t *c,
949
          hb_ot_subtable_cache_op_t op HB_UNUSED,
950
0
          hb_priority<0>) { return false; }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
951
  template <typename Type>
952
  static inline bool cache_func_to (hb_ot_apply_context_t *c,
953
            hb_ot_subtable_cache_op_t op)
954
0
  {
955
0
    return cache_func_<Type> (c, op, hb_prioritize);
956
0
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
957
#endif
958
959
  typedef bool (*hb_apply_func_t) (const void *obj, hb_ot_apply_context_t *c, void *external_cache);
960
  typedef bool (*hb_cache_func_t) (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op);
961
962
  struct hb_applicable_t
963
  {
964
    friend struct hb_accelerate_subtables_context_t;
965
    friend struct hb_ot_layout_lookup_accelerator_t;
966
967
    template <typename T>
968
    void init (const T &obj_,
969
         hb_apply_func_t apply_func_
970
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
971
         , hb_apply_func_t apply_cached_func_
972
         , hb_cache_func_t cache_func_
973
         , void *external_cache_
974
#endif
975
    )
976
0
    {
977
0
      obj = &obj_;
978
0
      apply_func = apply_func_;
979
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
980
0
      apply_cached_func = apply_cached_func_;
981
0
      cache_func = cache_func_;
982
0
      external_cache = external_cache_;
983
0
#endif
984
0
      digest.init ();
985
0
      obj_.get_coverage ().collect_coverage (&digest);
986
0
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat3>(OT::ContextFormat3 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
987
988
#ifdef HB_NO_OT_LAYOUT_LOOKUP_CACHE
989
    bool apply (hb_ot_apply_context_t *c) const
990
    {
991
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, nullptr);
992
    }
993
#else
994
    bool apply (hb_ot_apply_context_t *c) const
995
0
    {
996
0
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, external_cache);
997
0
    }
998
    bool apply_cached (hb_ot_apply_context_t *c) const
999
0
    {
1000
0
      return digest.may_have (c->buffer->cur().codepoint) &&  apply_cached_func (obj, c, external_cache);
1001
0
    }
1002
1003
    bool cache_enter (hb_ot_apply_context_t *c) const
1004
0
    {
1005
0
      return cache_func (c, hb_ot_subtable_cache_op_t::ENTER);
1006
0
    }
1007
    void cache_leave (hb_ot_apply_context_t *c) const
1008
0
    {
1009
0
      cache_func (c, hb_ot_subtable_cache_op_t::LEAVE);
1010
0
    }
1011
#endif
1012
1013
    private:
1014
    const void *obj;
1015
    hb_apply_func_t apply_func;
1016
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1017
    hb_apply_func_t apply_cached_func;
1018
    hb_cache_func_t cache_func;
1019
    void *external_cache;
1020
#endif
1021
    hb_set_digest_t digest;
1022
  };
1023
1024
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1025
  template <typename T>
1026
  auto cache_cost (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.cache_cost () )
1027
  template <typename T>
1028
  auto cache_cost (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( 0u )
1029
1030
  template <typename T>
1031
  auto external_cache_create (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.external_cache_create () )
1032
  template <typename T>
1033
  auto external_cache_create (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( nullptr )
1034
#endif
1035
1036
  /* Dispatch interface. */
1037
  template <typename T>
1038
  return_t dispatch (const T &obj)
1039
0
  {
1040
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1041
0
    void *external_cache = nullptr;
1042
0
    if (i < 8)
1043
0
      external_cache = external_cache_create (obj, hb_prioritize);
1044
0
#endif
1045
1046
0
    hb_applicable_t *entry = &array[i++];
1047
1048
0
    entry->init (obj,
1049
0
     apply_to<T>
1050
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1051
0
     , apply_cached_to<T>
1052
0
     , cache_func_to<T>
1053
0
     , external_cache
1054
0
#endif
1055
0
     );
1056
1057
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1058
    /* Cache handling
1059
     *
1060
     * We allow one subtable from each lookup to use a cache. The assumption
1061
     * being that multiple subtables of the same lookup cannot use a cache
1062
     * because the resources they would use will collide.  As such, we ask
1063
     * each subtable to tell us how much it costs (which a cache would avoid),
1064
     * and we allocate the cache opportunity to the costliest subtable.
1065
     */
1066
0
    unsigned cost = cache_cost (obj, hb_prioritize);
1067
0
    if (cost > subtable_cache_user_cost)
1068
0
    {
1069
0
      subtable_cache_user_idx = i - 1;
1070
0
      subtable_cache_user_cost = cost;
1071
0
    }
1072
0
#endif
1073
1074
0
    return hb_empty_t ();
1075
0
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
1076
0
  static return_t default_return_value () { return hb_empty_t (); }
1077
1078
  hb_accelerate_subtables_context_t (hb_applicable_t *array_) :
1079
0
             array (array_) {}
1080
1081
  hb_applicable_t *array;
1082
  unsigned i = 0;
1083
1084
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1085
  unsigned subtable_cache_user_idx = (unsigned) -1;
1086
  unsigned subtable_cache_user_cost = 0;
1087
#endif
1088
};
1089
1090
1091
typedef bool (*intersects_func_t) (const hb_set_t *glyphs, unsigned value, const void *data, void *cache);
1092
typedef void (*intersected_glyphs_func_t) (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache);
1093
typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, unsigned value, const void *data);
1094
typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data);
1095
1096
struct ContextClosureFuncs
1097
{
1098
  intersects_func_t intersects;
1099
  intersected_glyphs_func_t intersected_glyphs;
1100
};
1101
struct ContextCollectGlyphsFuncs
1102
{
1103
  collect_glyphs_func_t collect;
1104
};
1105
struct ContextApplyFuncs
1106
{
1107
  match_func_t match;
1108
};
1109
struct ChainContextApplyFuncs
1110
{
1111
  match_func_t match[3];
1112
};
1113
1114
1115
static inline bool intersects_glyph (const hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED, void *cache HB_UNUSED)
1116
133M
{
1117
133M
  return glyphs->has (value);
1118
133M
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
hb-ot-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1116
37.7M
{
1117
37.7M
  return glyphs->has (value);
1118
37.7M
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
hb-subset-plan-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1116
96.2M
{
1117
96.2M
  return glyphs->has (value);
1118
96.2M
}
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
1119
static inline bool intersects_class (const hb_set_t *glyphs, unsigned value, const void *data, void *cache)
1120
161
{
1121
161
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1122
161
  hb_map_t *map = (hb_map_t *) cache;
1123
1124
161
  hb_codepoint_t *cached_v;
1125
161
  if (map->has (value, &cached_v))
1126
38
    return *cached_v;
1127
1128
123
  bool v = class_def.intersects_class (glyphs, value);
1129
123
  map->set (value, v);
1130
1131
123
  return v;
1132
161
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
hb-ot-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1120
48
{
1121
48
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1122
48
  hb_map_t *map = (hb_map_t *) cache;
1123
1124
48
  hb_codepoint_t *cached_v;
1125
48
  if (map->has (value, &cached_v))
1126
10
    return *cached_v;
1127
1128
38
  bool v = class_def.intersects_class (glyphs, value);
1129
38
  map->set (value, v);
1130
1131
38
  return v;
1132
48
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
hb-subset-plan-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1120
113
{
1121
113
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1122
113
  hb_map_t *map = (hb_map_t *) cache;
1123
1124
113
  hb_codepoint_t *cached_v;
1125
113
  if (map->has (value, &cached_v))
1126
28
    return *cached_v;
1127
1128
85
  bool v = class_def.intersects_class (glyphs, value);
1129
85
  map->set (value, v);
1130
1131
85
  return v;
1132
113
}
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
1133
static inline bool intersects_coverage (const hb_set_t *glyphs, unsigned value, const void *data, void *cache HB_UNUSED)
1134
1.36k
{
1135
1.36k
  Offset16To<Coverage> coverage;
1136
1.36k
  coverage = value;
1137
1.36k
  return (data+coverage).intersects (glyphs);
1138
1.36k
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
hb-ot-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1134
586
{
1135
586
  Offset16To<Coverage> coverage;
1136
586
  coverage = value;
1137
586
  return (data+coverage).intersects (glyphs);
1138
586
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
hb-subset-plan-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Line
Count
Source
1134
777
{
1135
777
  Offset16To<Coverage> coverage;
1136
777
  coverage = value;
1137
777
  return (data+coverage).intersects (glyphs);
1138
777
}
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
1139
1140
1141
static inline void intersected_glyph (const hb_set_t *glyphs HB_UNUSED, const void *data, unsigned value, hb_set_t *intersected_glyphs, HB_UNUSED void *cache)
1142
79.6k
{
1143
79.6k
  unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value];
1144
79.6k
  intersected_glyphs->add (g);
1145
79.6k
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
hb-ot-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Line
Count
Source
1142
79.6k
{
1143
79.6k
  unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value];
1144
79.6k
  intersected_glyphs->add (g);
1145
79.6k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1146
1147
using intersected_class_cache_t = hb_hashmap_t<unsigned, hb_set_t>;
1148
1149
static inline void intersected_class_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache)
1150
8
{
1151
8
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1152
1153
8
  intersected_class_cache_t *map = (intersected_class_cache_t *) cache;
1154
1155
8
  hb_set_t *cached_v;
1156
8
  if (map->has (value, &cached_v))
1157
3
  {
1158
3
    intersected_glyphs->union_ (*cached_v);
1159
3
    return;
1160
3
  }
1161
1162
5
  hb_set_t v;
1163
5
  class_def.intersected_class_glyphs (glyphs, value, &v);
1164
1165
5
  intersected_glyphs->union_ (v);
1166
1167
5
  map->set (value, std::move (v));
1168
5
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
hb-ot-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Line
Count
Source
1150
8
{
1151
8
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1152
1153
8
  intersected_class_cache_t *map = (intersected_class_cache_t *) cache;
1154
1155
8
  hb_set_t *cached_v;
1156
8
  if (map->has (value, &cached_v))
1157
3
  {
1158
3
    intersected_glyphs->union_ (*cached_v);
1159
3
    return;
1160
3
  }
1161
1162
5
  hb_set_t v;
1163
5
  class_def.intersected_class_glyphs (glyphs, value, &v);
1164
1165
5
  intersected_glyphs->union_ (v);
1166
1167
5
  map->set (value, std::move (v));
1168
5
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1169
1170
static inline void intersected_coverage_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, HB_UNUSED void *cache)
1171
60
{
1172
60
  Offset16To<Coverage> coverage;
1173
60
  coverage = value;
1174
60
  (data+coverage).intersect_set (*glyphs, *intersected_glyphs);
1175
60
}
Unexecuted instantiation: hb-ot-face.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
hb-ot-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Line
Count
Source
1171
60
{
1172
60
  Offset16To<Coverage> coverage;
1173
60
  coverage = value;
1174
60
  (data+coverage).intersect_set (*glyphs, *intersected_glyphs);
1175
60
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1176
1177
1178
template <typename HBUINT>
1179
static inline bool array_is_subset_of (const hb_set_t *glyphs,
1180
               unsigned int count,
1181
               const HBUINT values[],
1182
               intersects_func_t intersects_func,
1183
               const void *intersects_data,
1184
               void *cache)
1185
51.8k
{
1186
51.8k
  for (const auto &_ : + hb_iter (values, count))
1187
133M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1188
45.1k
  return true;
1189
51.8k
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
hb-ot-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Line
Count
Source
1185
20.4k
{
1186
20.4k
  for (const auto &_ : + hb_iter (values, count))
1187
37.7M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1188
15.8k
  return true;
1189
20.4k
}
Unexecuted instantiation: hb-ot-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
hb-subset-plan-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Line
Count
Source
1185
31.4k
{
1186
31.4k
  for (const auto &_ : + hb_iter (values, count))
1187
96.2M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1188
29.2k
  return true;
1189
31.4k
}
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
1190
1191
1192
static inline void collect_glyph (hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED)
1193
0
{
1194
0
  glyphs->add (value);
1195
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
1196
static inline void collect_class (hb_set_t *glyphs, unsigned value, const void *data)
1197
0
{
1198
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1199
0
  class_def.collect_class (glyphs, value);
1200
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
1201
static inline void collect_coverage (hb_set_t *glyphs, unsigned value, const void *data)
1202
0
{
1203
0
  Offset16To<Coverage> coverage;
1204
0
  coverage = value;
1205
0
  (data+coverage).collect_coverage (glyphs);
1206
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
1207
template <typename HBUINT>
1208
static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
1209
          hb_set_t *glyphs,
1210
          unsigned int count,
1211
          const HBUINT values[],
1212
          collect_glyphs_func_t collect_func,
1213
          const void *collect_data)
1214
0
{
1215
0
  return
1216
0
  + hb_iter (values, count)
1217
0
  | hb_apply ([&] (const HBUINT &_) { collect_func (glyphs, _, collect_data); })
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)::{lambda(OT::NumType<true, unsigned short, 2u> const&)#1}::operator()(OT::NumType<true, unsigned short, 2u> const&) const
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)::{lambda(OT::NumType<true, unsigned int, 3u> const&)#1}::operator()(OT::NumType<true, unsigned int, 3u> const&) const
1218
0
  ;
1219
0
}
Unexecuted instantiation: hb-ot-face.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-face.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: gsubgpos-context.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)
1220
1221
1222
static inline bool match_always (hb_glyph_info_t &info HB_UNUSED, unsigned value HB_UNUSED, const void *data HB_UNUSED)
1223
0
{
1224
0
  return true;
1225
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
1226
static inline bool match_glyph (hb_glyph_info_t &info, unsigned value, const void *data HB_UNUSED)
1227
0
{
1228
0
  return info.codepoint == value;
1229
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
1230
static inline bool match_class (hb_glyph_info_t &info, unsigned value, const void *data)
1231
0
{
1232
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1233
0
  return class_def.get_class (info.codepoint) == value;
1234
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
1235
static inline unsigned get_class_cached (const ClassDef &class_def, hb_glyph_info_t &info)
1236
0
{
1237
0
  unsigned klass = info.syllable();
1238
0
  if (klass < 255)
1239
0
    return klass;
1240
0
  klass = class_def.get_class (info.codepoint);
1241
0
  if (likely (klass < 255))
1242
0
    info.syllable() = klass;
1243
0
  return klass;
1244
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
1245
static inline bool match_class_cached (hb_glyph_info_t &info, unsigned value, const void *data)
1246
0
{
1247
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1248
0
  return get_class_cached (class_def, info) == value;
1249
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
1250
static inline unsigned get_class_cached1 (const ClassDef &class_def, hb_glyph_info_t &info)
1251
0
{
1252
0
  unsigned klass = info.syllable() & 0x0F;
1253
0
  if (klass < 15)
1254
0
    return klass;
1255
0
  klass = class_def.get_class (info.codepoint);
1256
0
  if (likely (klass < 15))
1257
0
    info.syllable() = (info.syllable() & 0xF0) | klass;
1258
0
  return klass;
1259
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
1260
static inline bool match_class_cached1 (hb_glyph_info_t &info, unsigned value, const void *data)
1261
0
{
1262
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1263
0
  return get_class_cached1 (class_def, info) == value;
1264
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
1265
static inline unsigned get_class_cached2 (const ClassDef &class_def, hb_glyph_info_t &info)
1266
0
{
1267
0
  unsigned klass = (info.syllable() & 0xF0) >> 4;
1268
0
  if (klass < 15)
1269
0
    return klass;
1270
0
  klass = class_def.get_class (info.codepoint);
1271
0
  if (likely (klass < 15))
1272
0
    info.syllable() = (info.syllable() & 0x0F) | (klass << 4);
1273
0
  return klass;
1274
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
1275
static inline bool match_class_cached2 (hb_glyph_info_t &info, unsigned value, const void *data)
1276
0
{
1277
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1278
0
  return get_class_cached2 (class_def, info) == value;
1279
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
1280
static inline bool match_coverage (hb_glyph_info_t &info, unsigned value, const void *data)
1281
0
{
1282
0
  Offset16To<Coverage> coverage;
1283
0
  coverage = value;
1284
0
  return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED;
1285
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
1286
1287
template <typename HBUINT>
1288
static inline bool would_match_input (hb_would_apply_context_t *c,
1289
              unsigned int count, /* Including the first glyph (not matched) */
1290
              const HBUINT input[], /* Array of input values--start with second glyph */
1291
              match_func_t match_func,
1292
              const void *match_data)
1293
0
{
1294
0
  if (count != c->len)
1295
0
    return false;
1296
1297
0
  for (unsigned int i = 1; i < count; i++)
1298
0
  {
1299
0
    hb_glyph_info_t info;
1300
0
    info.codepoint = c->glyphs[i];
1301
0
    if (likely (!match_func (info, input[i - 1], match_data)))
1302
0
      return false;
1303
0
  }
1304
1305
0
  return true;
1306
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
1307
template <typename HBUINT>
1308
#ifndef HB_OPTIMIZE_SIZE
1309
HB_ALWAYS_INLINE
1310
#endif
1311
static bool match_input (hb_ot_apply_context_t *c,
1312
       unsigned int count, /* Including the first glyph (not matched) */
1313
       const HBUINT input[], /* Array of input values--start with second glyph */
1314
       match_func_t match_func,
1315
       const void *match_data,
1316
       unsigned int *end_position,
1317
       unsigned int *p_total_component_count = nullptr)
1318
0
{
1319
0
  TRACE_APPLY (nullptr);
1320
1321
0
  hb_buffer_t *buffer = c->buffer;
1322
1323
0
  if (count == 1)
1324
0
  {
1325
0
    *end_position = buffer->idx + 1;
1326
0
    c->match_positions[0] = buffer->idx;
1327
0
    if (p_total_component_count)
1328
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1329
0
    return_trace (true);
1330
0
  }
1331
1332
0
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1333
1334
0
  auto &skippy_iter = c->iter_input;
1335
0
  skippy_iter.reset (buffer->idx);
1336
0
  skippy_iter.set_match_func (match_func, match_data);
1337
0
  skippy_iter.set_glyph_data (input);
1338
1339
  /*
1340
   * This is perhaps the trickiest part of OpenType...  Remarks:
1341
   *
1342
   * - If all components of the ligature were marks, we call this a mark ligature.
1343
   *
1344
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1345
   *   it as a ligature glyph.
1346
   *
1347
   * - Ligatures cannot be formed across glyphs attached to different components
1348
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1349
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1350
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1351
   *   There are a couple of exceptions to this:
1352
   *
1353
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1354
   *     assuming that the font designer knows what they are doing (otherwise it can
1355
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1356
   *
1357
   *   o If two marks want to ligate and they belong to different components of the
1358
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1359
   *     mark-filtering rules, then allow.
1360
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1361
   */
1362
1363
0
  unsigned int total_component_count = 0;
1364
1365
0
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1366
0
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1367
1368
0
  enum {
1369
0
    LIGBASE_NOT_CHECKED,
1370
0
    LIGBASE_MAY_NOT_SKIP,
1371
0
    LIGBASE_MAY_SKIP
1372
0
  } ligbase = LIGBASE_NOT_CHECKED;
1373
1374
0
  for (unsigned int i = 1; i < count; i++)
1375
0
  {
1376
0
    unsigned unsafe_to;
1377
0
    if (!skippy_iter.next (&unsafe_to))
1378
0
    {
1379
0
      *end_position = unsafe_to;
1380
0
      return_trace (false);
1381
0
    }
1382
1383
0
    if (unlikely (i + 1 > c->match_positions.length &&
1384
0
      !c->match_positions.resize_dirty  (i + 1)))
1385
0
      return_trace (false);
1386
0
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1387
1388
0
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1389
0
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1390
1391
0
    if (first_lig_id && first_lig_comp)
1392
0
    {
1393
      /* If first component was attached to a previous ligature component,
1394
       * all subsequent components should be attached to the same ligature
1395
       * component, otherwise we shouldn't ligate them... */
1396
0
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1397
0
      {
1398
  /* ...unless, we are attached to a base ligature and that base
1399
   * ligature is ignorable. */
1400
0
  if (ligbase == LIGBASE_NOT_CHECKED)
1401
0
  {
1402
0
    bool found = false;
1403
0
    const auto *out = buffer->out_info;
1404
0
    unsigned int j = buffer->out_len;
1405
0
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1406
0
    {
1407
0
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1408
0
      {
1409
0
        j--;
1410
0
        found = true;
1411
0
        break;
1412
0
      }
1413
0
      j--;
1414
0
    }
1415
1416
0
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1417
0
      ligbase = LIGBASE_MAY_SKIP;
1418
0
    else
1419
0
      ligbase = LIGBASE_MAY_NOT_SKIP;
1420
0
  }
1421
1422
0
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1423
0
    return_trace (false);
1424
0
      }
1425
0
    }
1426
0
    else
1427
0
    {
1428
      /* If first component was NOT attached to a previous ligature component,
1429
       * all subsequent components should also NOT be attached to any ligature
1430
       * component, unless they are attached to the first component itself! */
1431
0
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1432
0
  return_trace (false);
1433
0
    }
1434
1435
0
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1436
0
  }
1437
1438
0
  *end_position = skippy_iter.idx + 1;
1439
1440
0
  if (p_total_component_count)
1441
0
  {
1442
0
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1443
0
    *p_total_component_count = total_component_count;
1444
0
  }
1445
1446
0
  c->match_positions.arrayZ[0] = buffer->idx;
1447
1448
0
  return_trace (true);
1449
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
1450
static inline bool ligate_input (hb_ot_apply_context_t *c,
1451
         unsigned int count, /* Including the first glyph */
1452
         unsigned int match_end,
1453
         hb_codepoint_t lig_glyph,
1454
         unsigned int total_component_count)
1455
0
{
1456
0
  TRACE_APPLY (nullptr);
1457
1458
0
  hb_buffer_t *buffer = c->buffer;
1459
1460
0
  buffer->merge_clusters (buffer->idx, match_end);
1461
1462
  /* - If a base and one or more marks ligate, consider that as a base, NOT
1463
   *   ligature, such that all following marks can still attach to it.
1464
   *   https://github.com/harfbuzz/harfbuzz/issues/1109
1465
   *
1466
   * - If all components of the ligature were marks, we call this a mark ligature.
1467
   *   If it *is* a mark ligature, we don't allocate a new ligature id, and leave
1468
   *   the ligature to keep its old ligature id.  This will allow it to attach to
1469
   *   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
1470
   *   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
1471
   *   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
1472
   *   later, we don't want them to lose their ligature id/component, otherwise
1473
   *   GPOS will fail to correctly position the mark ligature on top of the
1474
   *   LAM,LAM,HEH ligature.  See:
1475
   *     https://bugzilla.gnome.org/show_bug.cgi?id=676343
1476
   *
1477
   * - If a ligature is formed of components that some of which are also ligatures
1478
   *   themselves, and those ligature components had marks attached to *their*
1479
   *   components, we have to attach the marks to the new ligature component
1480
   *   positions!  Now *that*'s tricky!  And these marks may be following the
1481
   *   last component of the whole sequence, so we should loop forward looking
1482
   *   for them and update them.
1483
   *
1484
   *   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
1485
   *   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
1486
   *   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
1487
   *   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
1488
   *   the new ligature with a component value of 2.
1489
   *
1490
   *   This in fact happened to a font...  See:
1491
   *   https://bugzilla.gnome.org/show_bug.cgi?id=437633
1492
   */
1493
1494
0
  bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]);
1495
0
  bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]);
1496
0
  for (unsigned int i = 1; i < count; i++)
1497
0
    if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]]))
1498
0
    {
1499
0
      is_base_ligature = false;
1500
0
      is_mark_ligature = false;
1501
0
      break;
1502
0
    }
1503
0
  bool is_ligature = !is_base_ligature && !is_mark_ligature;
1504
1505
0
  unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0;
1506
0
  unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0;
1507
0
  unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1508
0
  unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1509
0
  unsigned int components_so_far = last_num_components;
1510
1511
0
  if (is_ligature)
1512
0
  {
1513
0
    _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count);
1514
0
    if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
1515
0
    {
1516
0
      _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER);
1517
0
    }
1518
0
  }
1519
0
  c->replace_glyph_with_ligature (lig_glyph, klass);
1520
1521
0
  for (unsigned int i = 1; i < count; i++)
1522
0
  {
1523
0
    while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful)
1524
0
    {
1525
0
      if (is_ligature)
1526
0
      {
1527
0
  unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1528
0
  if (this_comp == 0)
1529
0
    this_comp = last_num_components;
1530
0
  assert (components_so_far >= last_num_components);
1531
0
  unsigned int new_lig_comp = components_so_far - last_num_components +
1532
0
            hb_min (this_comp, last_num_components);
1533
0
    _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp);
1534
0
      }
1535
0
      (void) buffer->next_glyph ();
1536
0
    }
1537
1538
0
    last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1539
0
    last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1540
0
    components_so_far += last_num_components;
1541
1542
    /* Skip the base glyph */
1543
0
    buffer->idx++;
1544
0
  }
1545
1546
0
  if (!is_mark_ligature && last_lig_id)
1547
0
  {
1548
    /* Re-adjust components for any marks following. */
1549
0
    for (unsigned i = buffer->idx; i < buffer->len; ++i)
1550
0
    {
1551
0
      if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break;
1552
1553
0
      unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]);
1554
0
      if (!this_comp) break;
1555
1556
0
      assert (components_so_far >= last_num_components);
1557
0
      unsigned new_lig_comp = components_so_far - last_num_components +
1558
0
            hb_min (this_comp, last_num_components);
1559
0
      _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp);
1560
0
    }
1561
0
  }
1562
0
  return_trace (true);
1563
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-aat-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-ot-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-var.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-color.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-other.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: gsubgpos-context.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
1564
1565
template <typename HBUINT>
1566
#ifndef HB_OPTIMIZE_SIZE
1567
HB_ALWAYS_INLINE
1568
#endif
1569
static bool match_backtrack (hb_ot_apply_context_t *c,
1570
           unsigned int count,
1571
           const HBUINT backtrack[],
1572
           match_func_t match_func,
1573
           const void *match_data,
1574
           unsigned int *match_start)
1575
0
{
1576
0
  TRACE_APPLY (nullptr);
1577
1578
0
  if (!count)
1579
0
  {
1580
0
    *match_start = c->buffer->backtrack_len ();
1581
0
    return_trace (true);
1582
0
  }
1583
1584
0
  auto &skippy_iter = c->iter_context;
1585
0
  skippy_iter.reset_back (c->buffer->backtrack_len ());
1586
0
  skippy_iter.set_match_func (match_func, match_data);
1587
0
  skippy_iter.set_glyph_data (backtrack);
1588
1589
0
  for (unsigned int i = 0; i < count; i++)
1590
0
  {
1591
0
    unsigned unsafe_from;
1592
0
    if (!skippy_iter.prev (&unsafe_from))
1593
0
    {
1594
0
      *match_start = unsafe_from;
1595
0
      return_trace (false);
1596
0
    }
1597
0
  }
1598
1599
0
  *match_start = skippy_iter.idx;
1600
0
  return_trace (true);
1601
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
1602
1603
template <typename HBUINT>
1604
#ifndef HB_OPTIMIZE_SIZE
1605
HB_ALWAYS_INLINE
1606
#endif
1607
static bool match_lookahead (hb_ot_apply_context_t *c,
1608
           unsigned int count,
1609
           const HBUINT lookahead[],
1610
           match_func_t match_func,
1611
           const void *match_data,
1612
           unsigned int start_index,
1613
           unsigned int *end_index)
1614
0
{
1615
0
  TRACE_APPLY (nullptr);
1616
1617
0
  if (!count)
1618
0
  {
1619
0
    *end_index = start_index;
1620
0
    return_trace (true);
1621
0
  }
1622
1623
0
  auto &skippy_iter = c->iter_context;
1624
0
  assert (start_index >= 1);
1625
0
  skippy_iter.reset (start_index - 1);
1626
0
  skippy_iter.set_match_func (match_func, match_data);
1627
0
  skippy_iter.set_glyph_data (lookahead);
1628
1629
0
  for (unsigned int i = 0; i < count; i++)
1630
0
  {
1631
0
    unsigned unsafe_to;
1632
0
    if (!skippy_iter.next (&unsafe_to))
1633
0
    {
1634
0
      *end_index = unsafe_to;
1635
0
      return_trace (false);
1636
0
    }
1637
0
  }
1638
1639
0
  *end_index = skippy_iter.idx + 1;
1640
0
  return_trace (true);
1641
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
1642
1643
1644
1645
struct LookupRecord
1646
{
1647
  bool serialize (hb_serialize_context_t *c,
1648
      const hb_map_t         *lookup_map) const
1649
9.70M
  {
1650
9.70M
    TRACE_SERIALIZE (this);
1651
9.70M
    auto *out = c->embed (*this);
1652
9.70M
    if (unlikely (!out)) return_trace (false);
1653
1654
9.70M
    return_trace (c->check_assign (out->lookupListIndex, lookup_map->get (lookupListIndex), HB_SERIALIZE_ERROR_INT_OVERFLOW));
1655
9.70M
  }
1656
1657
  bool sanitize (hb_sanitize_context_t *c) const
1658
0
  {
1659
0
    TRACE_SANITIZE (this);
1660
0
    return_trace (c->check_struct (this));
1661
0
  }
1662
1663
  HBUINT16  sequenceIndex;    /* Index into current glyph
1664
           * sequence--first glyph = 0 */
1665
  HBUINT16  lookupListIndex;  /* Lookup to apply to that
1666
           * position--zero--based */
1667
  public:
1668
  DEFINE_SIZE_STATIC (4);
1669
};
1670
1671
static unsigned serialize_lookuprecord_array (hb_serialize_context_t *c,
1672
                const hb_array_t<const LookupRecord> lookupRecords,
1673
                const hb_map_t *lookup_map)
1674
11.6k
{
1675
11.6k
  unsigned count = 0;
1676
11.6k
  for (const LookupRecord& r : lookupRecords)
1677
22.8M
  {
1678
22.8M
    if (!lookup_map->has (r.lookupListIndex))
1679
13.1M
      continue;
1680
1681
9.70M
    if (!r.serialize (c, lookup_map))
1682
26
      return 0;
1683
1684
9.70M
    count++;
1685
9.70M
  }
1686
11.6k
  return count;
1687
11.6k
}
Unexecuted instantiation: hb-ot-face.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-aat-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
hb-subset-table-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Line
Count
Source
1674
11.6k
{
1675
11.6k
  unsigned count = 0;
1676
11.6k
  for (const LookupRecord& r : lookupRecords)
1677
22.8M
  {
1678
22.8M
    if (!lookup_map->has (r.lookupListIndex))
1679
13.1M
      continue;
1680
1681
9.70M
    if (!r.serialize (c, lookup_map))
1682
26
      return 0;
1683
1684
9.70M
    count++;
1685
9.70M
  }
1686
11.6k
  return count;
1687
11.6k
}
Unexecuted instantiation: hb-subset-table-var.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
1688
1689
enum ContextFormat { SimpleContext = 1, ClassBasedContext = 2, CoverageBasedContext = 3 };
1690
1691
template <typename HBUINT>
1692
static void context_closure_recurse_lookups (hb_closure_context_t *c,
1693
               unsigned inputCount, const HBUINT input[],
1694
               unsigned lookupCount,
1695
               const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */,
1696
               unsigned value,
1697
               ContextFormat context_format,
1698
               const void *data,
1699
               intersected_glyphs_func_t intersected_glyphs_func,
1700
               void *cache)
1701
8.14k
{
1702
8.14k
  hb_set_t covered_seq_indicies;
1703
8.14k
  hb_set_t pos_glyphs;
1704
7.19M
  for (unsigned int i = 0; i < lookupCount; i++)
1705
7.18M
  {
1706
7.18M
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
1707
7.18M
    if (seqIndex >= inputCount) continue;
1708
1709
3.36M
    bool has_pos_glyphs = false;
1710
1711
3.36M
    if (!covered_seq_indicies.has (seqIndex))
1712
81.9k
    {
1713
81.9k
      has_pos_glyphs = true;
1714
81.9k
      pos_glyphs.clear ();
1715
81.9k
      if (seqIndex == 0)
1716
2.18k
      {
1717
2.18k
        switch (context_format) {
1718
1.34k
        case ContextFormat::SimpleContext:
1719
1.34k
          pos_glyphs.add (value);
1720
1.34k
          break;
1721
6
        case ContextFormat::ClassBasedContext:
1722
6
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
1723
6
          break;
1724
830
        case ContextFormat::CoverageBasedContext:
1725
830
          pos_glyphs.set (c->parent_active_glyphs ());
1726
830
          break;
1727
2.18k
        }
1728
2.18k
      }
1729
79.7k
      else
1730
79.7k
      {
1731
79.7k
        const void *input_data = input;
1732
79.7k
        unsigned input_value = seqIndex - 1;
1733
79.7k
        if (context_format != ContextFormat::SimpleContext)
1734
62
        {
1735
62
          input_data = data;
1736
62
          input_value = input[seqIndex - 1];
1737
62
        }
1738
1739
79.7k
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
1740
79.7k
      }
1741
81.9k
    }
1742
1743
3.36M
    covered_seq_indicies.add (seqIndex);
1744
3.36M
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
1745
3.36M
    if (unlikely (!cur_active_glyphs))
1746
0
      return;
1747
3.36M
    if (has_pos_glyphs) {
1748
81.9k
      *cur_active_glyphs = std::move (pos_glyphs);
1749
3.27M
    } else {
1750
3.27M
      *cur_active_glyphs = *c->glyphs;
1751
3.27M
    }
1752
1753
3.36M
    unsigned endIndex = inputCount;
1754
3.36M
    if (context_format == ContextFormat::CoverageBasedContext)
1755
6.15k
      endIndex += 1;
1756
1757
3.36M
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
1758
1759
3.36M
    c->pop_cur_done_glyphs ();
1760
3.36M
  }
1761
8.14k
}
Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
hb-ot-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Line
Count
Source
1701
8.14k
{
1702
8.14k
  hb_set_t covered_seq_indicies;
1703
8.14k
  hb_set_t pos_glyphs;
1704
7.19M
  for (unsigned int i = 0; i < lookupCount; i++)
1705
7.18M
  {
1706
7.18M
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
1707
7.18M
    if (seqIndex >= inputCount) continue;
1708
1709
3.36M
    bool has_pos_glyphs = false;
1710
1711
3.36M
    if (!covered_seq_indicies.has (seqIndex))
1712
81.9k
    {
1713
81.9k
      has_pos_glyphs = true;
1714
81.9k
      pos_glyphs.clear ();
1715
81.9k
      if (seqIndex == 0)
1716
2.18k
      {
1717
2.18k
        switch (context_format) {
1718
1.34k
        case ContextFormat::SimpleContext:
1719
1.34k
          pos_glyphs.add (value);
1720
1.34k
          break;
1721
6
        case ContextFormat::ClassBasedContext:
1722
6
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
1723
6
          break;
1724
830
        case ContextFormat::CoverageBasedContext:
1725
830
          pos_glyphs.set (c->parent_active_glyphs ());
1726
830
          break;
1727
2.18k
        }
1728
2.18k
      }
1729
79.7k
      else
1730
79.7k
      {
1731
79.7k
        const void *input_data = input;
1732
79.7k
        unsigned input_value = seqIndex - 1;
1733
79.7k
        if (context_format != ContextFormat::SimpleContext)
1734
62
        {
1735
62
          input_data = data;
1736
62
          input_value = input[seqIndex - 1];
1737
62
        }
1738
1739
79.7k
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
1740
79.7k
      }
1741
81.9k
    }
1742
1743
3.36M
    covered_seq_indicies.add (seqIndex);
1744
3.36M
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
1745
3.36M
    if (unlikely (!cur_active_glyphs))
1746
0
      return;
1747
3.36M
    if (has_pos_glyphs) {
1748
81.9k
      *cur_active_glyphs = std::move (pos_glyphs);
1749
3.27M
    } else {
1750
3.27M
      *cur_active_glyphs = *c->glyphs;
1751
3.27M
    }
1752
1753
3.36M
    unsigned endIndex = inputCount;
1754
3.36M
    if (context_format == ContextFormat::CoverageBasedContext)
1755
6.15k
      endIndex += 1;
1756
1757
3.36M
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
1758
1759
3.36M
    c->pop_cur_done_glyphs ();
1760
3.36M
  }
1761
8.14k
}
Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
Unexecuted instantiation: gsubgpos-context.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*)
1762
1763
template <typename context_t>
1764
static inline void recurse_lookups (context_t *c,
1765
                                    unsigned int lookupCount,
1766
                                    const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */)
1767
11.3k
{
1768
21.5M
  for (unsigned int i = 0; i < lookupCount; i++)
1769
21.5M
    c->recurse (lookupRecord[i].lookupListIndex);
1770
11.3k
}
Unexecuted instantiation: hb-ot-face.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-face.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-aat-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
hb-subset-plan-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Line
Count
Source
1767
11.3k
{
1768
21.5M
  for (unsigned int i = 0; i < lookupCount; i++)
1769
21.5M
    c->recurse (lookupRecord[i].lookupListIndex);
1770
11.3k
}
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: gsubgpos-context.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*)
Unexecuted instantiation: gsubgpos-context.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
1771
1772
static inline void apply_lookup (hb_ot_apply_context_t *c,
1773
         unsigned int count, /* Including the first glyph */
1774
         unsigned int lookupCount,
1775
         const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
1776
         unsigned int match_end)
1777
0
{
1778
0
  hb_buffer_t *buffer = c->buffer;
1779
0
  int end;
1780
1781
  /* All positions are distance from beginning of *output* buffer.
1782
   * Adjust. */
1783
0
  {
1784
0
    unsigned int bl = buffer->backtrack_len ();
1785
0
    end = bl + match_end - buffer->idx;
1786
1787
0
    int delta = bl - buffer->idx;
1788
    /* Convert positions to new indexing. */
1789
0
    for (unsigned int j = 0; j < count; j++)
1790
0
      c->match_positions.arrayZ[j] += delta;
1791
0
  }
1792
1793
0
  for (unsigned int i = 0; i < lookupCount && buffer->successful; i++)
1794
0
  {
1795
0
    unsigned int idx = lookupRecord[i].sequenceIndex;
1796
0
    if (idx >= count)
1797
0
      continue;
1798
1799
0
    unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len ();
1800
1801
    /* This can happen if earlier recursed lookups deleted many entries. */
1802
0
    if (unlikely (c->match_positions.arrayZ[idx] >= orig_len))
1803
0
      continue;
1804
1805
0
    if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx])))
1806
0
      break;
1807
1808
0
    if (unlikely (buffer->max_ops <= 0))
1809
0
      break;
1810
1811
0
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1812
0
    {
1813
0
      if (buffer->have_output)
1814
0
        c->buffer->sync_so_far ();
1815
0
      c->buffer->message (c->font,
1816
0
        "recursing to lookup %u at %u",
1817
0
        (unsigned) lookupRecord[i].lookupListIndex,
1818
0
        buffer->idx);
1819
0
    }
1820
1821
0
    if (!c->recurse (lookupRecord[i].lookupListIndex))
1822
0
      continue;
1823
1824
0
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1825
0
    {
1826
0
      if (buffer->have_output)
1827
0
        c->buffer->sync_so_far ();
1828
0
      c->buffer->message (c->font,
1829
0
        "recursed to lookup %u",
1830
0
        (unsigned) lookupRecord[i].lookupListIndex);
1831
0
    }
1832
1833
0
    unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len ();
1834
0
    int delta = new_len - orig_len;
1835
1836
0
    if (!delta)
1837
0
      continue;
1838
1839
    /* Recursed lookup changed buffer len.  Adjust.
1840
     *
1841
     * TODO:
1842
     *
1843
     * Right now, if buffer length increased by n, we assume n new glyphs
1844
     * were added right after the current position, and if buffer length
1845
     * was decreased by n, we assume n match positions after the current
1846
     * one where removed.  The former (buffer length increased) case is
1847
     * fine, but the decrease case can be improved in at least two ways,
1848
     * both of which are significant:
1849
     *
1850
     *   - If recursed-to lookup is MultipleSubst and buffer length
1851
     *     decreased, then it's current match position that was deleted,
1852
     *     NOT the one after it.
1853
     *
1854
     *   - If buffer length was decreased by n, it does not necessarily
1855
     *     mean that n match positions where removed, as there recursed-to
1856
     *     lookup might had a different LookupFlag.  Here's a constructed
1857
     *     case of that:
1858
     *     https://github.com/harfbuzz/harfbuzz/discussions/3538
1859
     *
1860
     * It should be possible to construct tests for both of these cases.
1861
     */
1862
1863
0
    end += delta;
1864
0
    if (end < int (c->match_positions.arrayZ[idx]))
1865
0
    {
1866
      /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed
1867
       * lookup ended up removing many items.
1868
       * Just never rewind end beyond start of current position, since that is
1869
       * not possible in the recursed lookup.  Also adjust delta as such.
1870
       *
1871
       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496
1872
       * https://github.com/harfbuzz/harfbuzz/issues/1611
1873
       */
1874
0
      delta += c->match_positions.arrayZ[idx] - end;
1875
0
      end = c->match_positions.arrayZ[idx];
1876
0
    }
1877
1878
0
    unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
1879
1880
0
    if (delta > 0)
1881
0
    {
1882
0
      if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
1883
0
  break;
1884
0
      if (unlikely (count + delta > c->match_positions.length &&
1885
0
        !c->match_positions.resize_dirty  (count + delta)))
1886
0
        return;
1887
0
    }
1888
0
    else
1889
0
    {
1890
      /* NOTE: delta is non-positive. */
1891
0
      delta = hb_max (delta, (int) next - (int) count);
1892
0
      next -= delta;
1893
0
    }
1894
1895
    /* Shift! */
1896
0
    memmove (c->match_positions + next + delta, c->match_positions + next,
1897
0
       (count - next) * sizeof (c->match_positions.arrayZ[0]));
1898
0
    next += delta;
1899
0
    count += delta;
1900
1901
    /* Fill in new entries. */
1902
0
    for (unsigned int j = idx + 1; j < next; j++)
1903
0
      c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1;
1904
1905
    /* And fixup the rest. */
1906
0
    for (; next < count; next++)
1907
0
      c->match_positions.arrayZ[next] += delta;
1908
0
  }
1909
1910
0
  assert (end >= 0);
1911
0
  (void) buffer->move_to (end);
1912
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-aat-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-ot-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-var.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-color.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-other.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: gsubgpos-context.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
1913
1914
1915
1916
/* Contextual lookups */
1917
1918
struct ContextClosureLookupContext
1919
{
1920
  ContextClosureFuncs funcs;
1921
  ContextFormat context_format;
1922
  const void *intersects_data;
1923
  void *intersects_cache;
1924
  void *intersected_glyphs_cache;
1925
};
1926
1927
struct ContextCollectGlyphsLookupContext
1928
{
1929
  ContextCollectGlyphsFuncs funcs;
1930
  const void *collect_data;
1931
};
1932
1933
struct ContextApplyLookupContext
1934
{
1935
  ContextApplyFuncs funcs;
1936
  const void *match_data;
1937
};
1938
1939
template <typename HBUINT>
1940
static inline bool context_intersects (const hb_set_t *glyphs,
1941
               unsigned int inputCount, /* Including the first glyph (not matched) */
1942
               const HBUINT input[], /* Array of input values--start with second glyph */
1943
               ContextClosureLookupContext &lookup_context)
1944
11.2k
{
1945
11.2k
  return array_is_subset_of (glyphs,
1946
11.2k
           inputCount ? inputCount - 1 : 0, input,
1947
11.2k
           lookup_context.funcs.intersects,
1948
11.2k
           lookup_context.intersects_data,
1949
11.2k
           lookup_context.intersects_cache);
1950
11.2k
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
hb-ot-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Line
Count
Source
1944
6.15k
{
1945
6.15k
  return array_is_subset_of (glyphs,
1946
6.15k
           inputCount ? inputCount - 1 : 0, input,
1947
6.15k
           lookup_context.funcs.intersects,
1948
6.15k
           lookup_context.intersects_data,
1949
6.15k
           lookup_context.intersects_cache);
1950
6.15k
}
Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
hb-subset-plan-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Line
Count
Source
1944
5.14k
{
1945
5.14k
  return array_is_subset_of (glyphs,
1946
5.14k
           inputCount ? inputCount - 1 : 0, input,
1947
5.14k
           lookup_context.funcs.intersects,
1948
5.14k
           lookup_context.intersects_data,
1949
5.14k
           lookup_context.intersects_cache);
1950
5.14k
}
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&)
1951
1952
template <typename HBUINT>
1953
static inline void context_closure_lookup (hb_closure_context_t *c,
1954
             unsigned int inputCount, /* Including the first glyph (not matched) */
1955
             const HBUINT input[], /* Array of input values--start with second glyph */
1956
             unsigned int lookupCount,
1957
             const LookupRecord lookupRecord[],
1958
             unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */
1959
             ContextClosureLookupContext &lookup_context)
1960
6.15k
{
1961
6.15k
  if (context_intersects (c->glyphs,
1962
6.15k
        inputCount, input,
1963
6.15k
        lookup_context))
1964
4.64k
    context_closure_recurse_lookups (c,
1965
4.64k
             inputCount, input,
1966
4.64k
             lookupCount, lookupRecord,
1967
4.64k
             value,
1968
4.64k
             lookup_context.context_format,
1969
4.64k
             lookup_context.intersects_data,
1970
4.64k
             lookup_context.funcs.intersected_glyphs,
1971
4.64k
             lookup_context.intersected_glyphs_cache);
1972
6.15k
}
Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
hb-ot-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Line
Count
Source
1960
6.15k
{
1961
6.15k
  if (context_intersects (c->glyphs,
1962
6.15k
        inputCount, input,
1963
6.15k
        lookup_context))
1964
4.64k
    context_closure_recurse_lookups (c,
1965
4.64k
             inputCount, input,
1966
4.64k
             lookupCount, lookupRecord,
1967
4.64k
             value,
1968
4.64k
             lookup_context.context_format,
1969
4.64k
             lookup_context.intersects_data,
1970
4.64k
             lookup_context.funcs.intersected_glyphs,
1971
4.64k
             lookup_context.intersected_glyphs_cache);
1972
6.15k
}
Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
1973
1974
template <typename HBUINT>
1975
static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
1976
              unsigned int inputCount, /* Including the first glyph (not matched) */
1977
              const HBUINT input[], /* Array of input values--start with second glyph */
1978
              unsigned int lookupCount,
1979
              const LookupRecord lookupRecord[],
1980
              ContextCollectGlyphsLookupContext &lookup_context)
1981
0
{
1982
0
  collect_array (c, c->input,
1983
0
     inputCount ? inputCount - 1 : 0, input,
1984
0
     lookup_context.funcs.collect, lookup_context.collect_data);
1985
0
  recurse_lookups (c,
1986
0
       lookupCount, lookupRecord);
1987
0
}
Unexecuted instantiation: hb-ot-face.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
1988
1989
template <typename HBUINT>
1990
static inline bool context_would_apply_lookup (hb_would_apply_context_t *c,
1991
                 unsigned int inputCount, /* Including the first glyph (not matched) */
1992
                 const HBUINT input[], /* Array of input values--start with second glyph */
1993
                 unsigned int lookupCount HB_UNUSED,
1994
                 const LookupRecord lookupRecord[] HB_UNUSED,
1995
                 const ContextApplyLookupContext &lookup_context)
1996
0
{
1997
0
  return would_match_input (c,
1998
0
          inputCount, input,
1999
0
          lookup_context.funcs.match, lookup_context.match_data);
2000
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
2001
2002
template <typename HBUINT>
2003
static inline bool context_apply_lookup (hb_ot_apply_context_t *c,
2004
           unsigned int inputCount, /* Including the first glyph (not matched) */
2005
           const HBUINT input[], /* Array of input values--start with second glyph */
2006
           unsigned int lookupCount,
2007
           const LookupRecord lookupRecord[],
2008
           const ContextApplyLookupContext &lookup_context)
2009
0
{
2010
0
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
2011
2012
0
  unsigned match_end = 0;
2013
0
  bool ret = false;
2014
0
  if (match_input (c,
2015
0
       inputCount, input,
2016
0
       lookup_context.funcs.match, lookup_context.match_data,
2017
0
       &match_end))
2018
0
  {
2019
0
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
2020
0
    apply_lookup (c,
2021
0
      inputCount,
2022
0
      lookupCount, lookupRecord,
2023
0
      match_end);
2024
0
    ret = true;
2025
0
  }
2026
0
  else
2027
0
  {
2028
0
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
2029
0
    ret = false;
2030
0
  }
2031
2032
0
  return ret;
2033
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
2034
2035
static inline bool context_cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
2036
0
{
2037
0
  switch (op)
2038
0
  {
2039
0
    case hb_ot_subtable_cache_op_t::ENTER:
2040
0
    {
2041
0
      if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable))
2042
0
  return false;
2043
0
      auto &info = c->buffer->info;
2044
0
      unsigned count = c->buffer->len;
2045
0
      for (unsigned i = 0; i < count; i++)
2046
0
  info[i].syllable() = 255;
2047
0
      c->new_syllables = 255;
2048
0
      return true;
2049
0
    }
2050
0
    case hb_ot_subtable_cache_op_t::LEAVE:
2051
0
    {
2052
0
      c->new_syllables = (unsigned) -1;
2053
0
      HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable);
2054
0
      break;
2055
0
    }
2056
0
  }
2057
0
  return false;
2058
0
}
Unexecuted instantiation: hb-ot-face.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-aat-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
2059
2060
template <typename Types>
2061
struct Rule
2062
{
2063
  template <typename T>
2064
  friend struct RuleSet;
2065
2066
  bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const
2067
4.52k
  {
2068
4.52k
    return context_intersects (glyphs,
2069
4.52k
             inputCount, inputZ.arrayZ,
2070
4.52k
             lookup_context);
2071
4.52k
  }
OT::Rule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2067
4.52k
  {
2068
4.52k
    return context_intersects (glyphs,
2069
4.52k
             inputCount, inputZ.arrayZ,
2070
4.52k
             lookup_context);
2071
4.52k
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
2072
2073
  void closure (hb_closure_context_t *c, unsigned value, ContextClosureLookupContext &lookup_context) const
2074
6.65k
  {
2075
6.65k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2076
2077
5.59k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2078
5.59k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2079
5.59k
    context_closure_lookup (c,
2080
5.59k
          inputCount, inputZ.arrayZ,
2081
5.59k
          lookupCount, lookupRecord.arrayZ,
2082
5.59k
          value, lookup_context);
2083
5.59k
  }
OT::Rule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2074
6.65k
  {
2075
6.65k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2076
2077
5.59k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2078
5.59k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2079
5.59k
    context_closure_lookup (c,
2080
5.59k
          inputCount, inputZ.arrayZ,
2081
5.59k
          lookupCount, lookupRecord.arrayZ,
2082
5.59k
          value, lookup_context);
2083
5.59k
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
2084
2085
  void closure_lookups (hb_closure_lookups_context_t *c,
2086
                        ContextClosureLookupContext &lookup_context) const
2087
4.24k
  {
2088
4.24k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2089
4.24k
    if (!intersects (c->glyphs, lookup_context)) return;
2090
2091
3.69k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2092
3.69k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2093
3.69k
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
2094
3.69k
  }
OT::Rule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2087
4.24k
  {
2088
4.24k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2089
4.24k
    if (!intersects (c->glyphs, lookup_context)) return;
2090
2091
3.69k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2092
3.69k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2093
3.69k
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
2094
3.69k
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
2095
2096
  void collect_glyphs (hb_collect_glyphs_context_t *c,
2097
           ContextCollectGlyphsLookupContext &lookup_context) const
2098
0
  {
2099
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2100
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2101
0
    context_collect_glyphs_lookup (c,
2102
0
           inputCount, inputZ.arrayZ,
2103
0
           lookupCount, lookupRecord.arrayZ,
2104
0
           lookup_context);
2105
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
2106
2107
  bool would_apply (hb_would_apply_context_t *c,
2108
        const ContextApplyLookupContext &lookup_context) const
2109
0
  {
2110
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2111
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2112
0
    return context_would_apply_lookup (c,
2113
0
               inputCount, inputZ.arrayZ,
2114
0
               lookupCount, lookupRecord.arrayZ,
2115
0
               lookup_context);
2116
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
2117
2118
  bool apply (hb_ot_apply_context_t *c,
2119
        const ContextApplyLookupContext &lookup_context) const
2120
0
  {
2121
0
    TRACE_APPLY (this);
2122
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2123
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2124
0
    return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
2125
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
2126
2127
  bool serialize (hb_serialize_context_t *c,
2128
      const hb_map_t *input_mapping, /* old->new glyphid or class mapping */
2129
      const hb_map_t *lookup_map) const
2130
1.04k
  {
2131
1.04k
    TRACE_SERIALIZE (this);
2132
1.04k
    auto *out = c->start_embed (this);
2133
1.04k
    if (unlikely (!c->extend_min (out))) return_trace (false);
2134
2135
1.04k
    out->inputCount = inputCount;
2136
1.04k
    const auto input = inputZ.as_array (inputCount - 1);
2137
1.04k
    for (const auto org : input)
2138
9.09M
    {
2139
9.09M
      HBUINT16 d;
2140
9.09M
      d = input_mapping->get (org);
2141
9.09M
      c->copy (d);
2142
9.09M
    }
2143
2144
1.04k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2145
1.04k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2146
2147
1.04k
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
2148
1.04k
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2149
1.04k
  }
OT::Rule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2130
1.04k
  {
2131
1.04k
    TRACE_SERIALIZE (this);
2132
1.04k
    auto *out = c->start_embed (this);
2133
1.04k
    if (unlikely (!c->extend_min (out))) return_trace (false);
2134
2135
1.04k
    out->inputCount = inputCount;
2136
1.04k
    const auto input = inputZ.as_array (inputCount - 1);
2137
1.04k
    for (const auto org : input)
2138
9.09M
    {
2139
9.09M
      HBUINT16 d;
2140
9.09M
      d = input_mapping->get (org);
2141
9.09M
      c->copy (d);
2142
9.09M
    }
2143
2144
1.04k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2145
1.04k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2146
2147
1.04k
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
2148
1.04k
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2149
1.04k
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
2150
2151
  bool subset (hb_subset_context_t *c,
2152
         const hb_map_t *lookup_map,
2153
         const hb_map_t *klass_map = nullptr) const
2154
1.40k
  {
2155
1.40k
    TRACE_SUBSET (this);
2156
1.40k
    if (unlikely (!inputCount)) return_trace (false);
2157
1.17k
    const auto input = inputZ.as_array (inputCount - 1);
2158
2159
1.17k
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
2160
1.17k
    if (!hb_all (input, mapping)) return_trace (false);
2161
1.17k
    return_trace (serialize (c->serializer, mapping, lookup_map));
2162
1.17k
  }
OT::Rule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2154
1.40k
  {
2155
1.40k
    TRACE_SUBSET (this);
2156
1.40k
    if (unlikely (!inputCount)) return_trace (false);
2157
1.17k
    const auto input = inputZ.as_array (inputCount - 1);
2158
2159
1.17k
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
2160
1.17k
    if (!hb_all (input, mapping)) return_trace (false);
2161
1.04k
    return_trace (serialize (c->serializer, mapping, lookup_map));
2162
1.17k
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
2163
2164
  public:
2165
  bool sanitize (hb_sanitize_context_t *c) const
2166
242k
  {
2167
242k
    TRACE_SANITIZE (this);
2168
242k
    return_trace (c->check_struct (this) &&
2169
242k
      hb_barrier () &&
2170
242k
      c->check_range (inputZ.arrayZ,
2171
242k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2172
242k
          LookupRecord::static_size * lookupCount));
2173
242k
  }
OT::Rule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2166
241k
  {
2167
241k
    TRACE_SANITIZE (this);
2168
241k
    return_trace (c->check_struct (this) &&
2169
241k
      hb_barrier () &&
2170
241k
      c->check_range (inputZ.arrayZ,
2171
241k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2172
241k
          LookupRecord::static_size * lookupCount));
2173
241k
  }
OT::Rule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2166
466
  {
2167
466
    TRACE_SANITIZE (this);
2168
466
    return_trace (c->check_struct (this) &&
2169
466
      hb_barrier () &&
2170
466
      c->check_range (inputZ.arrayZ,
2171
466
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2172
466
          LookupRecord::static_size * lookupCount));
2173
466
  }
2174
2175
  protected:
2176
  HBUINT16  inputCount;   /* Total number of glyphs in input
2177
           * glyph sequence--includes the first
2178
           * glyph */
2179
  HBUINT16  lookupCount;    /* Number of LookupRecords */
2180
  UnsizedArrayOf<typename Types::HBUINT>
2181
    inputZ;     /* Array of match inputs--start with
2182
           * second glyph */
2183
/*UnsizedArrayOf<LookupRecord>
2184
    lookupRecordX;*/  /* Array of LookupRecords--in
2185
           * design order */
2186
  public:
2187
  DEFINE_SIZE_ARRAY (4, inputZ);
2188
};
2189
2190
template <typename Types>
2191
struct RuleSet
2192
{
2193
  using Rule = OT::Rule<Types>;
2194
2195
  bool intersects (const hb_set_t *glyphs,
2196
       ContextClosureLookupContext &lookup_context) const
2197
373
  {
2198
373
    return
2199
373
    + hb_iter (rule)
2200
373
    | hb_map (hb_add (this))
2201
373
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
OT::RuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2201
282
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
2202
373
    | hb_any
2203
373
    ;
2204
373
  }
OT::RuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2197
373
  {
2198
373
    return
2199
373
    + hb_iter (rule)
2200
373
    | hb_map (hb_add (this))
2201
373
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
2202
373
    | hb_any
2203
373
    ;
2204
373
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
2205
2206
  void closure (hb_closure_context_t *c, unsigned value,
2207
    ContextClosureLookupContext &lookup_context) const
2208
1.33k
  {
2209
1.33k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2210
2211
1.16k
    return
2212
1.16k
    + hb_iter (rule)
2213
1.16k
    | hb_map (hb_add (this))
2214
6.65k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
OT::RuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2214
6.65k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
2215
1.33k
    ;
2216
1.33k
  }
OT::RuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2208
1.33k
  {
2209
1.33k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2210
2211
1.16k
    return
2212
1.16k
    + hb_iter (rule)
2213
1.16k
    | hb_map (hb_add (this))
2214
1.16k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
2215
1.33k
    ;
2216
1.33k
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
2217
2218
  void closure_lookups (hb_closure_lookups_context_t *c,
2219
                        ContextClosureLookupContext &lookup_context) const
2220
700
  {
2221
700
    if (unlikely (c->lookup_limit_exceeded ())) return;
2222
700
    + hb_iter (rule)
2223
700
    | hb_map (hb_add (this))
2224
4.24k
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
OT::RuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2224
4.24k
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
2225
700
    ;
2226
700
  }
OT::RuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2220
700
  {
2221
700
    if (unlikely (c->lookup_limit_exceeded ())) return;
2222
700
    + hb_iter (rule)
2223
700
    | hb_map (hb_add (this))
2224
700
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
2225
700
    ;
2226
700
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
2227
2228
  void collect_glyphs (hb_collect_glyphs_context_t *c,
2229
           ContextCollectGlyphsLookupContext &lookup_context) const
2230
0
  {
2231
0
    return
2232
0
    + hb_iter (rule)
2233
0
    | hb_map (hb_add (this))
2234
0
    | hb_apply ([&] (const Rule &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
2235
0
    ;
2236
0
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
2237
2238
  bool would_apply (hb_would_apply_context_t *c,
2239
        const ContextApplyLookupContext &lookup_context) const
2240
0
  {
2241
0
    return
2242
0
    + hb_iter (rule)
2243
0
    | hb_map (hb_add (this))
2244
0
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
2245
0
    | hb_any
2246
0
    ;
2247
0
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
2248
2249
  bool apply (hb_ot_apply_context_t *c,
2250
        const ContextApplyLookupContext &lookup_context) const
2251
0
  {
2252
0
    TRACE_APPLY (this);
2253
2254
0
    unsigned num_rules = rule.len;
2255
2256
0
#ifndef HB_NO_OT_RULESETS_FAST_PATH
2257
0
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
2258
0
#endif
2259
0
    {
2260
0
    slow:
2261
0
      return_trace (
2262
0
      + hb_iter (rule)
2263
0
      | hb_map (hb_add (this))
2264
0
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2265
0
      | hb_any
2266
0
      )
2267
0
      ;
2268
0
    }
2269
2270
    /* This version is optimized for speed by matching the first & second
2271
     * components of the rule here, instead of calling into the matching code.
2272
     *
2273
     * Replicated from LigatureSet::apply(). */
2274
2275
    /* We use the iter_context instead of iter_input, to avoid skipping
2276
     * default-ignorables and such.
2277
     *
2278
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
2279
     */
2280
0
    auto &skippy_iter = c->iter_context;
2281
0
    skippy_iter.reset (c->buffer->idx);
2282
0
    skippy_iter.set_match_func (match_always, nullptr);
2283
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
2284
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
2285
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
2286
0
    bool matched = skippy_iter.next ();
2287
0
    if (likely (matched))
2288
0
    {
2289
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2290
0
      {
2291
  /* Can't use the fast path if eg. the next char is a default-ignorable
2292
   * or other skippable. */
2293
0
        goto slow;
2294
0
      }
2295
2296
0
      first = &c->buffer->info[skippy_iter.idx];
2297
0
      unsafe_to1 = skippy_iter.idx + 1;
2298
0
    }
2299
0
    else
2300
0
    {
2301
      /* Failed to match a next glyph. Only try applying rules that have
2302
       * no further input. */
2303
0
      return_trace (
2304
0
      + hb_iter (rule)
2305
0
      | hb_map (hb_add (this))
2306
0
      | hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; })
2307
0
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2308
0
      | hb_any
2309
0
      )
2310
0
      ;
2311
0
    }
2312
0
    matched = skippy_iter.next ();
2313
0
    if (likely (matched))
2314
0
    {
2315
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2316
0
      {
2317
  /* Can't use the fast path if eg. the next char is a default-ignorable
2318
   * or other skippable. */
2319
0
        goto slow;
2320
0
      }
2321
2322
0
      second = &c->buffer->info[skippy_iter.idx];
2323
0
      unsafe_to2 = skippy_iter.idx + 1;
2324
0
    }
2325
2326
0
    auto match_input = lookup_context.funcs.match;
2327
0
    auto *input_data = lookup_context.match_data;
2328
0
    for (unsigned int i = 0; i < num_rules; i++)
2329
0
    {
2330
0
      const auto &r = this+rule.arrayZ[i];
2331
2332
0
      const auto &input = r.inputZ;
2333
2334
0
      if (r.inputCount <= 1 ||
2335
0
    (!match_input ||
2336
0
     match_input (*first, input.arrayZ[0], input_data)))
2337
0
      {
2338
0
        if (!second ||
2339
0
      (r.inputCount <= 2 ||
2340
0
       (!match_input ||
2341
0
        match_input (*second, input.arrayZ[1], input_data)))
2342
0
     )
2343
0
  {
2344
0
    if (r.apply (c, lookup_context))
2345
0
    {
2346
0
      if (unsafe_to != (unsigned) -1)
2347
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2348
0
      return_trace (true);
2349
0
    }
2350
0
  }
2351
0
  else
2352
0
    unsafe_to = unsafe_to2;
2353
0
      }
2354
0
      else
2355
0
      {
2356
0
  if (unsafe_to == (unsigned) -1)
2357
0
    unsafe_to = unsafe_to1;
2358
2359
  // Skip ahead to next possible first glyph match.
2360
0
  for (; i + 1 < num_rules; i++)
2361
0
  {
2362
0
    const auto &r2 = this+rule.arrayZ[i + 1];
2363
0
    const auto &input2 = r2.inputZ;
2364
0
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
2365
0
      break;
2366
0
  }
2367
0
      }
2368
0
    }
2369
0
    if (likely (unsafe_to != (unsigned) -1))
2370
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2371
2372
0
    return_trace (false);
2373
0
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
2374
2375
  bool subset (hb_subset_context_t *c,
2376
         const hb_map_t *lookup_map,
2377
         const hb_map_t *klass_map = nullptr) const
2378
224
  {
2379
224
    TRACE_SUBSET (this);
2380
2381
224
    auto snap = c->serializer->snapshot ();
2382
224
    auto *out = c->serializer->start_embed (*this);
2383
224
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2384
2385
224
    for (const Offset16To<Rule>& _ : rule)
2386
2.27k
    {
2387
2.27k
      if (!_) continue;
2388
1.80k
      auto o_snap = c->serializer->snapshot ();
2389
1.80k
      auto *o = out->rule.serialize_append (c->serializer);
2390
1.80k
      if (unlikely (!o)) continue;
2391
2392
1.40k
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
2393
362
      {
2394
362
  out->rule.pop ();
2395
362
  c->serializer->revert (o_snap);
2396
362
      }
2397
1.40k
    }
2398
2399
224
    bool ret = bool (out->rule);
2400
224
    if (!ret) c->serializer->revert (snap);
2401
2402
224
    return_trace (ret);
2403
224
  }
OT::RuleSet<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2378
224
  {
2379
224
    TRACE_SUBSET (this);
2380
2381
224
    auto snap = c->serializer->snapshot ();
2382
224
    auto *out = c->serializer->start_embed (*this);
2383
224
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2384
2385
224
    for (const Offset16To<Rule>& _ : rule)
2386
2.27k
    {
2387
2.27k
      if (!_) continue;
2388
1.80k
      auto o_snap = c->serializer->snapshot ();
2389
1.80k
      auto *o = out->rule.serialize_append (c->serializer);
2390
1.80k
      if (unlikely (!o)) continue;
2391
2392
1.40k
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
2393
362
      {
2394
362
  out->rule.pop ();
2395
362
  c->serializer->revert (o_snap);
2396
362
      }
2397
1.40k
    }
2398
2399
224
    bool ret = bool (out->rule);
2400
224
    if (!ret) c->serializer->revert (snap);
2401
2402
224
    return_trace (ret);
2403
224
  }
Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
2404
2405
  bool sanitize (hb_sanitize_context_t *c) const
2406
9.31k
  {
2407
9.31k
    TRACE_SANITIZE (this);
2408
9.31k
    return_trace (rule.sanitize (c, this));
2409
9.31k
  }
OT::RuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2406
9.23k
  {
2407
9.23k
    TRACE_SANITIZE (this);
2408
9.23k
    return_trace (rule.sanitize (c, this));
2409
9.23k
  }
OT::RuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2406
75
  {
2407
75
    TRACE_SANITIZE (this);
2408
75
    return_trace (rule.sanitize (c, this));
2409
75
  }
2410
2411
  protected:
2412
  Array16OfOffset16To<Rule>
2413
    rule;     /* Array of Rule tables
2414
           * ordered by preference */
2415
  public:
2416
  DEFINE_SIZE_ARRAY (2, rule);
2417
};
2418
2419
2420
template <typename Types>
2421
struct ContextFormat1_4
2422
{
2423
  using RuleSet = OT::RuleSet<Types>;
2424
2425
  bool intersects (const hb_set_t *glyphs) const
2426
342
  {
2427
342
    struct ContextClosureLookupContext lookup_context = {
2428
342
      {intersects_glyph, intersected_glyph},
2429
342
      ContextFormat::SimpleContext,
2430
342
      nullptr
2431
342
    };
2432
2433
342
    return
2434
342
    + hb_zip (this+coverage, ruleSet)
2435
342
    | hb_filter (*glyphs, hb_first)
2436
342
    | hb_map (hb_second)
2437
342
    | hb_map (hb_add (this))
2438
359
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
OT::ContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2438
359
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
2439
342
    | hb_any
2440
342
    ;
2441
342
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2426
342
  {
2427
342
    struct ContextClosureLookupContext lookup_context = {
2428
342
      {intersects_glyph, intersected_glyph},
2429
342
      ContextFormat::SimpleContext,
2430
342
      nullptr
2431
342
    };
2432
2433
342
    return
2434
342
    + hb_zip (this+coverage, ruleSet)
2435
342
    | hb_filter (*glyphs, hb_first)
2436
342
    | hb_map (hb_second)
2437
342
    | hb_map (hb_add (this))
2438
342
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
2439
342
    | hb_any
2440
342
    ;
2441
342
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
2442
2443
  bool may_have_non_1to1 () const
2444
72
  { return true; }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
2444
72
  { return true; }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
2445
2446
  void closure (hb_closure_context_t *c) const
2447
476
  {
2448
476
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2449
476
    if (unlikely (!cur_active_glyphs)) return;
2450
476
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
2451
2452
476
    struct ContextClosureLookupContext lookup_context = {
2453
476
      {intersects_glyph, intersected_glyph},
2454
476
      ContextFormat::SimpleContext,
2455
476
      nullptr
2456
476
    };
2457
2458
476
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
2459
3.27k
    | hb_filter ([&] (hb_codepoint_t _) {
2460
3.27k
      return c->previous_parent_active_glyphs ().has (_);
2461
3.27k
    }, hb_first)
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
2459
3.27k
    | hb_filter ([&] (hb_codepoint_t _) {
2460
3.27k
      return c->previous_parent_active_glyphs ().has (_);
2461
3.27k
    }, hb_first)
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
2462
1.32k
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
Line
Count
Source
2462
1.32k
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
2463
1.32k
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&> const&) const
Line
Count
Source
2463
1.32k
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&) const
2464
476
    ;
2465
2466
476
    c->pop_cur_done_glyphs ();
2467
476
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2447
476
  {
2448
476
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2449
476
    if (unlikely (!cur_active_glyphs)) return;
2450
476
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
2451
2452
476
    struct ContextClosureLookupContext lookup_context = {
2453
476
      {intersects_glyph, intersected_glyph},
2454
476
      ContextFormat::SimpleContext,
2455
476
      nullptr
2456
476
    };
2457
2458
476
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
2459
476
    | hb_filter ([&] (hb_codepoint_t _) {
2460
476
      return c->previous_parent_active_glyphs ().has (_);
2461
476
    }, hb_first)
2462
476
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
2463
476
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
2464
476
    ;
2465
2466
476
    c->pop_cur_done_glyphs ();
2467
476
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
2468
2469
  void closure_lookups (hb_closure_lookups_context_t *c) const
2470
187
  {
2471
187
    struct ContextClosureLookupContext lookup_context = {
2472
187
      {intersects_glyph, nullptr},
2473
187
      ContextFormat::SimpleContext,
2474
187
      nullptr
2475
187
    };
2476
2477
187
    + hb_zip (this+coverage, ruleSet)
2478
187
    | hb_filter (*c->glyphs, hb_first)
2479
187
    | hb_map (hb_second)
2480
187
    | hb_map (hb_add (this))
2481
692
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2481
692
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
2482
187
    ;
2483
187
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2470
187
  {
2471
187
    struct ContextClosureLookupContext lookup_context = {
2472
187
      {intersects_glyph, nullptr},
2473
187
      ContextFormat::SimpleContext,
2474
187
      nullptr
2475
187
    };
2476
2477
187
    + hb_zip (this+coverage, ruleSet)
2478
187
    | hb_filter (*c->glyphs, hb_first)
2479
187
    | hb_map (hb_second)
2480
187
    | hb_map (hb_add (this))
2481
187
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
2482
187
    ;
2483
187
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
2484
2485
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
2486
2487
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2488
0
  {
2489
0
    (this+coverage).collect_coverage (c->input);
2490
2491
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2492
0
      {collect_glyph},
2493
0
      nullptr
2494
0
    };
2495
2496
0
    + hb_iter (ruleSet)
2497
0
    | hb_map (hb_add (this))
2498
0
    | hb_apply ([&] (const RuleSet &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
2499
0
    ;
2500
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
2501
2502
  bool would_apply (hb_would_apply_context_t *c) const
2503
0
  {
2504
0
    const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
2505
0
    struct ContextApplyLookupContext lookup_context = {
2506
0
      {match_glyph},
2507
0
      nullptr
2508
0
    };
2509
0
    return rule_set.would_apply (c, lookup_context);
2510
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
2511
2512
476
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
2512
476
  const Coverage &get_coverage () const { return this+coverage; }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
2513
2514
  bool apply (hb_ot_apply_context_t *c) const
2515
0
  {
2516
0
    TRACE_APPLY (this);
2517
0
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2518
0
    if (likely (index == NOT_COVERED))
2519
0
      return_trace (false);
2520
2521
0
    const RuleSet &rule_set = this+ruleSet[index];
2522
0
    struct ContextApplyLookupContext lookup_context = {
2523
0
      {match_glyph},
2524
0
      nullptr
2525
0
    };
2526
0
    return_trace (rule_set.apply (c, lookup_context));
2527
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
2528
2529
  bool subset (hb_subset_context_t *c) const
2530
84
  {
2531
84
    TRACE_SUBSET (this);
2532
84
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
2533
84
    const hb_map_t &glyph_map = *c->plan->glyph_map;
2534
2535
84
    auto *out = c->serializer->start_embed (*this);
2536
84
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2537
84
    out->format = format;
2538
2539
84
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2540
84
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
2541
84
    + hb_zip (this+coverage, ruleSet)
2542
84
    | hb_filter (glyphset, hb_first)
2543
84
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
2544
84
    | hb_map (hb_first)
2545
84
    | hb_map (glyph_map)
2546
84
    | hb_sink (new_coverage)
2547
84
    ;
2548
2549
84
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
2550
84
    return_trace (bool (new_coverage));
2551
84
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2530
84
  {
2531
84
    TRACE_SUBSET (this);
2532
84
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
2533
84
    const hb_map_t &glyph_map = *c->plan->glyph_map;
2534
2535
84
    auto *out = c->serializer->start_embed (*this);
2536
84
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2537
84
    out->format = format;
2538
2539
84
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2540
84
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
2541
84
    + hb_zip (this+coverage, ruleSet)
2542
84
    | hb_filter (glyphset, hb_first)
2543
84
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
2544
84
    | hb_map (hb_first)
2545
84
    | hb_map (glyph_map)
2546
84
    | hb_sink (new_coverage)
2547
84
    ;
2548
2549
84
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
2550
84
    return_trace (bool (new_coverage));
2551
84
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
2552
2553
  bool sanitize (hb_sanitize_context_t *c) const
2554
1.38k
  {
2555
1.38k
    TRACE_SANITIZE (this);
2556
1.38k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2557
1.38k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2554
1.23k
  {
2555
1.23k
    TRACE_SANITIZE (this);
2556
1.23k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2557
1.23k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2554
146
  {
2555
146
    TRACE_SANITIZE (this);
2556
146
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2557
146
  }
2558
2559
  protected:
2560
  HBUINT16  format;     /* Format identifier--format = 1 */
2561
  typename Types::template OffsetTo<Coverage>
2562
    coverage;   /* Offset to Coverage table--from
2563
           * beginning of table */
2564
  Array16Of<typename Types::template OffsetTo<RuleSet>>
2565
    ruleSet;    /* Array of RuleSet tables
2566
           * ordered by Coverage Index */
2567
  public:
2568
  DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet);
2569
};
2570
2571
2572
template <typename Types>
2573
struct ContextFormat2_5
2574
{
2575
  using RuleSet = OT::RuleSet<SmallTypes>;
2576
2577
  bool intersects (const hb_set_t *glyphs) const
2578
167
  {
2579
167
    if (!(this+coverage).intersects (glyphs))
2580
147
      return false;
2581
2582
20
    const ClassDef &class_def = this+classDef;
2583
2584
20
    hb_map_t cache;
2585
20
    struct ContextClosureLookupContext lookup_context = {
2586
20
      {intersects_class, nullptr},
2587
20
      ContextFormat::ClassBasedContext,
2588
20
      &class_def,
2589
20
      &cache
2590
20
    };
2591
2592
20
    hb_set_t retained_coverage_glyphs;
2593
20
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2594
2595
20
    hb_set_t coverage_glyph_classes;
2596
20
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2597
2598
2599
20
    return
2600
20
    + hb_iter (ruleSet)
2601
20
    | hb_map (hb_add (this))
2602
20
    | hb_enumerate
2603
20
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2604
203
        { return class_def.intersects_class (glyphs, p.first) &&
2605
23
           coverage_glyph_classes.has (p.first) &&
2606
14
           p.second.intersects (glyphs, lookup_context); })
OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>) const
Line
Count
Source
2604
203
        { return class_def.intersects_class (glyphs, p.first) &&
2605
23
           coverage_glyph_classes.has (p.first) &&
2606
14
           p.second.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>) const
2607
20
    | hb_any
2608
167
    ;
2609
167
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2578
163
  {
2579
163
    if (!(this+coverage).intersects (glyphs))
2580
143
      return false;
2581
2582
20
    const ClassDef &class_def = this+classDef;
2583
2584
20
    hb_map_t cache;
2585
20
    struct ContextClosureLookupContext lookup_context = {
2586
20
      {intersects_class, nullptr},
2587
20
      ContextFormat::ClassBasedContext,
2588
20
      &class_def,
2589
20
      &cache
2590
20
    };
2591
2592
20
    hb_set_t retained_coverage_glyphs;
2593
20
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2594
2595
20
    hb_set_t coverage_glyph_classes;
2596
20
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2597
2598
2599
20
    return
2600
20
    + hb_iter (ruleSet)
2601
20
    | hb_map (hb_add (this))
2602
20
    | hb_enumerate
2603
20
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2604
20
        { return class_def.intersects_class (glyphs, p.first) &&
2605
20
           coverage_glyph_classes.has (p.first) &&
2606
20
           p.second.intersects (glyphs, lookup_context); })
2607
20
    | hb_any
2608
163
    ;
2609
163
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2578
4
  {
2579
4
    if (!(this+coverage).intersects (glyphs))
2580
4
      return false;
2581
2582
0
    const ClassDef &class_def = this+classDef;
2583
2584
0
    hb_map_t cache;
2585
0
    struct ContextClosureLookupContext lookup_context = {
2586
0
      {intersects_class, nullptr},
2587
0
      ContextFormat::ClassBasedContext,
2588
0
      &class_def,
2589
0
      &cache
2590
0
    };
2591
2592
0
    hb_set_t retained_coverage_glyphs;
2593
0
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2594
2595
0
    hb_set_t coverage_glyph_classes;
2596
0
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2597
2598
2599
0
    return
2600
0
    + hb_iter (ruleSet)
2601
0
    | hb_map (hb_add (this))
2602
0
    | hb_enumerate
2603
0
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2604
0
        { return class_def.intersects_class (glyphs, p.first) &&
2605
0
           coverage_glyph_classes.has (p.first) &&
2606
0
           p.second.intersects (glyphs, lookup_context); })
2607
0
    | hb_any
2608
4
    ;
2609
4
  }
2610
2611
  bool may_have_non_1to1 () const
2612
0
  { return true; }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
2613
2614
  void closure (hb_closure_context_t *c) const
2615
142
  {
2616
142
    if (!(this+coverage).intersects (c->glyphs))
2617
130
      return;
2618
2619
12
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2620
12
    if (unlikely (!cur_active_glyphs)) return;
2621
12
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2622
12
           *cur_active_glyphs);
2623
2624
12
    const ClassDef &class_def = this+classDef;
2625
2626
12
    hb_map_t cache;
2627
12
    intersected_class_cache_t intersected_cache;
2628
12
    struct ContextClosureLookupContext lookup_context = {
2629
12
      {intersects_class, intersected_class_glyphs},
2630
12
      ContextFormat::ClassBasedContext,
2631
12
      &class_def,
2632
12
      &cache,
2633
12
      &intersected_cache
2634
12
    };
2635
2636
12
    + hb_enumerate (ruleSet)
2637
12
    | hb_filter ([&] (unsigned _)
2638
138
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
2638
138
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
2639
12
     hb_first)
2640
12
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2641
12
                {
2642
9
                  const RuleSet& rule_set = this+_.second;
2643
9
                  rule_set.closure (c, _.first, lookup_context);
2644
9
                })
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) const
Line
Count
Source
2641
9
                {
2642
9
                  const RuleSet& rule_set = this+_.second;
2643
9
                  rule_set.closure (c, _.first, lookup_context);
2644
9
                })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const
2645
12
    ;
2646
2647
12
    c->pop_cur_done_glyphs ();
2648
12
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2615
128
  {
2616
128
    if (!(this+coverage).intersects (c->glyphs))
2617
116
      return;
2618
2619
12
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2620
12
    if (unlikely (!cur_active_glyphs)) return;
2621
12
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2622
12
           *cur_active_glyphs);
2623
2624
12
    const ClassDef &class_def = this+classDef;
2625
2626
12
    hb_map_t cache;
2627
12
    intersected_class_cache_t intersected_cache;
2628
12
    struct ContextClosureLookupContext lookup_context = {
2629
12
      {intersects_class, intersected_class_glyphs},
2630
12
      ContextFormat::ClassBasedContext,
2631
12
      &class_def,
2632
12
      &cache,
2633
12
      &intersected_cache
2634
12
    };
2635
2636
12
    + hb_enumerate (ruleSet)
2637
12
    | hb_filter ([&] (unsigned _)
2638
12
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
2639
12
     hb_first)
2640
12
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2641
12
                {
2642
12
                  const RuleSet& rule_set = this+_.second;
2643
12
                  rule_set.closure (c, _.first, lookup_context);
2644
12
                })
2645
12
    ;
2646
2647
12
    c->pop_cur_done_glyphs ();
2648
12
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2615
14
  {
2616
14
    if (!(this+coverage).intersects (c->glyphs))
2617
14
      return;
2618
2619
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2620
0
    if (unlikely (!cur_active_glyphs)) return;
2621
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2622
0
           *cur_active_glyphs);
2623
2624
0
    const ClassDef &class_def = this+classDef;
2625
2626
0
    hb_map_t cache;
2627
0
    intersected_class_cache_t intersected_cache;
2628
0
    struct ContextClosureLookupContext lookup_context = {
2629
0
      {intersects_class, intersected_class_glyphs},
2630
0
      ContextFormat::ClassBasedContext,
2631
0
      &class_def,
2632
0
      &cache,
2633
0
      &intersected_cache
2634
0
    };
2635
2636
0
    + hb_enumerate (ruleSet)
2637
0
    | hb_filter ([&] (unsigned _)
2638
0
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
2639
0
     hb_first)
2640
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2641
0
                {
2642
0
                  const RuleSet& rule_set = this+_.second;
2643
0
                  rule_set.closure (c, _.first, lookup_context);
2644
0
                })
2645
0
    ;
2646
2647
0
    c->pop_cur_done_glyphs ();
2648
0
  }
2649
2650
  void closure_lookups (hb_closure_lookups_context_t *c) const
2651
12
  {
2652
12
    if (!(this+coverage).intersects (c->glyphs))
2653
8
      return;
2654
2655
4
    const ClassDef &class_def = this+classDef;
2656
2657
4
    hb_map_t cache;
2658
4
    struct ContextClosureLookupContext lookup_context = {
2659
4
      {intersects_class, nullptr},
2660
4
      ContextFormat::ClassBasedContext,
2661
4
      &class_def,
2662
4
      &cache
2663
4
    };
2664
2665
4
    + hb_iter (ruleSet)
2666
4
    | hb_map (hb_add (this))
2667
4
    | hb_enumerate
2668
4
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2669
8
    { return class_def.intersects_class (c->glyphs, p.first); })
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>) const
Line
Count
Source
2669
8
    { return class_def.intersects_class (c->glyphs, p.first); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&>) const
2670
4
    | hb_map (hb_second)
2671
4
    | hb_apply ([&] (const RuleSet & _)
2672
8
    { _.closure_lookups (c, lookup_context); });
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
2672
8
    { _.closure_lookups (c, lookup_context); });
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
2673
4
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2651
12
  {
2652
12
    if (!(this+coverage).intersects (c->glyphs))
2653
8
      return;
2654
2655
4
    const ClassDef &class_def = this+classDef;
2656
2657
4
    hb_map_t cache;
2658
4
    struct ContextClosureLookupContext lookup_context = {
2659
4
      {intersects_class, nullptr},
2660
4
      ContextFormat::ClassBasedContext,
2661
4
      &class_def,
2662
4
      &cache
2663
4
    };
2664
2665
4
    + hb_iter (ruleSet)
2666
4
    | hb_map (hb_add (this))
2667
4
    | hb_enumerate
2668
4
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2669
4
    { return class_def.intersects_class (c->glyphs, p.first); })
2670
4
    | hb_map (hb_second)
2671
4
    | hb_apply ([&] (const RuleSet & _)
2672
4
    { _.closure_lookups (c, lookup_context); });
2673
4
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
2674
2675
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
2676
2677
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2678
0
  {
2679
0
    (this+coverage).collect_coverage (c->input);
2680
2681
0
    const ClassDef &class_def = this+classDef;
2682
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2683
0
      {collect_class},
2684
0
      &class_def
2685
0
    };
2686
2687
0
    + hb_iter (ruleSet)
2688
0
    | hb_map (hb_add (this))
2689
0
    | hb_apply ([&] (const RuleSet &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
2690
0
    ;
2691
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
2692
2693
  bool would_apply (hb_would_apply_context_t *c) const
2694
0
  {
2695
0
    const ClassDef &class_def = this+classDef;
2696
0
    unsigned int index = class_def.get_class (c->glyphs[0]);
2697
0
    const RuleSet &rule_set = this+ruleSet[index];
2698
0
    struct ContextApplyLookupContext lookup_context = {
2699
0
      {match_class},
2700
0
      &class_def
2701
0
    };
2702
0
    return rule_set.would_apply (c, lookup_context);
2703
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
2704
2705
12
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
2705
12
  const Coverage &get_coverage () const { return this+coverage; }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
2706
2707
  unsigned cache_cost () const
2708
0
  {
2709
0
    return (this+classDef).cost ();
2710
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
2711
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
2712
0
  {
2713
0
    return context_cache_func (c, op);
2714
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
2715
2716
  struct external_cache_t
2717
  {
2718
    hb_ot_layout_binary_cache_t coverage;
2719
  };
2720
  void *external_cache_create () const
2721
0
  {
2722
0
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
2723
0
    if (likely (cache))
2724
0
    {
2725
0
      cache->coverage.clear ();
2726
0
    }
2727
0
    return cache;
2728
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
2729
0
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
2730
0
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
2731
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
2732
0
  {
2733
0
    TRACE_APPLY (this);
2734
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
2735
0
    external_cache_t *cache = (external_cache_t *) external_cache;
2736
0
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
2737
#else
2738
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2739
#endif
2740
0
    if (index == NOT_COVERED) return_trace (false);
2741
2742
0
    const ClassDef &class_def = this+classDef;
2743
2744
0
    struct ContextApplyLookupContext lookup_context = {
2745
0
      {cached ? match_class_cached : match_class},
2746
0
      &class_def
2747
0
    };
2748
2749
0
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
2750
0
    const RuleSet &rule_set = this+ruleSet[index];
2751
0
    return_trace (rule_set.apply (c, lookup_context));
2752
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
2753
2754
  bool subset (hb_subset_context_t *c) const
2755
2
  {
2756
2
    TRACE_SUBSET (this);
2757
2
    auto *out = c->serializer->start_embed (*this);
2758
2
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2759
2
    out->format = format;
2760
2
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
2761
0
      return_trace (false);
2762
2763
2
    hb_map_t klass_map;
2764
2
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
2765
2766
2
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
2767
2
    hb_set_t retained_coverage_glyphs;
2768
2
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
2769
2770
2
    hb_set_t coverage_glyph_classes;
2771
2
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2772
2773
2
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2774
2
    bool ret = true;
2775
2
    int non_zero_index = -1, index = 0;
2776
2
    auto snapshot = c->serializer->snapshot();
2777
2
    for (const auto& _ : + hb_enumerate (ruleSet)
2778
2
       | hb_filter (klass_map, hb_first))
2779
4
    {
2780
4
      auto *o = out->ruleSet.serialize_append (c->serializer);
2781
4
      if (unlikely (!o))
2782
0
      {
2783
0
  ret = false;
2784
0
  break;
2785
0
      }
2786
2787
4
      if (coverage_glyph_classes.has (_.first) &&
2788
2
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
2789
2
  non_zero_index = index;
2790
2
        snapshot = c->serializer->snapshot();
2791
2
      }
2792
2793
4
      index++;
2794
4
    }
2795
2796
2
    if (!ret || non_zero_index == -1) return_trace (false);
2797
2798
    //prune empty trailing ruleSets
2799
2
    --index;
2800
2
    while (index > non_zero_index)
2801
0
    {
2802
0
      out->ruleSet.pop ();
2803
0
      index--;
2804
0
    }
2805
2
    c->serializer->revert (snapshot);
2806
2807
2
    return_trace (bool (out->ruleSet));
2808
2
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2755
2
  {
2756
2
    TRACE_SUBSET (this);
2757
2
    auto *out = c->serializer->start_embed (*this);
2758
2
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2759
2
    out->format = format;
2760
2
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
2761
0
      return_trace (false);
2762
2763
2
    hb_map_t klass_map;
2764
2
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
2765
2766
2
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
2767
2
    hb_set_t retained_coverage_glyphs;
2768
2
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
2769
2770
2
    hb_set_t coverage_glyph_classes;
2771
2
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2772
2773
2
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2774
2
    bool ret = true;
2775
2
    int non_zero_index = -1, index = 0;
2776
2
    auto snapshot = c->serializer->snapshot();
2777
2
    for (const auto& _ : + hb_enumerate (ruleSet)
2778
2
       | hb_filter (klass_map, hb_first))
2779
4
    {
2780
4
      auto *o = out->ruleSet.serialize_append (c->serializer);
2781
4
      if (unlikely (!o))
2782
0
      {
2783
0
  ret = false;
2784
0
  break;
2785
0
      }
2786
2787
4
      if (coverage_glyph_classes.has (_.first) &&
2788
2
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
2789
2
  non_zero_index = index;
2790
2
        snapshot = c->serializer->snapshot();
2791
2
      }
2792
2793
4
      index++;
2794
4
    }
2795
2796
2
    if (!ret || non_zero_index == -1) return_trace (false);
2797
2798
    //prune empty trailing ruleSets
2799
2
    --index;
2800
2
    while (index > non_zero_index)
2801
0
    {
2802
0
      out->ruleSet.pop ();
2803
0
      index--;
2804
0
    }
2805
2
    c->serializer->revert (snapshot);
2806
2807
2
    return_trace (bool (out->ruleSet));
2808
2
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
2809
2810
  bool sanitize (hb_sanitize_context_t *c) const
2811
1.48k
  {
2812
1.48k
    TRACE_SANITIZE (this);
2813
1.48k
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2814
1.48k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2811
1.32k
  {
2812
1.32k
    TRACE_SANITIZE (this);
2813
1.32k
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2814
1.32k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2811
157
  {
2812
157
    TRACE_SANITIZE (this);
2813
157
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2814
157
  }
2815
2816
  protected:
2817
  HBUINT16  format;     /* Format identifier--format = 2 */
2818
  typename Types::template OffsetTo<Coverage>
2819
    coverage;   /* Offset to Coverage table--from
2820
           * beginning of table */
2821
  typename Types::template OffsetTo<ClassDef>
2822
    classDef;   /* Offset to glyph ClassDef table--from
2823
           * beginning of table */
2824
  Array16Of<typename Types::template OffsetTo<RuleSet>>
2825
    ruleSet;    /* Array of RuleSet tables
2826
           * ordered by class */
2827
  public:
2828
  DEFINE_SIZE_ARRAY (4 + 2 * Types::size, ruleSet);
2829
};
2830
2831
2832
struct ContextFormat3
2833
{
2834
  using RuleSet = OT::RuleSet<SmallTypes>;
2835
2836
  bool intersects (const hb_set_t *glyphs) const
2837
900
  {
2838
900
    if (!(this+coverageZ[0]).intersects (glyphs))
2839
285
      return false;
2840
2841
615
    struct ContextClosureLookupContext lookup_context = {
2842
615
      {intersects_coverage, nullptr},
2843
615
      ContextFormat::CoverageBasedContext,
2844
615
      this
2845
615
    };
2846
615
    return context_intersects (glyphs,
2847
615
             glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2848
615
             lookup_context);
2849
900
  }
2850
2851
  bool may_have_non_1to1 () const
2852
0
  { return true; }
2853
2854
  void closure (hb_closure_context_t *c) const
2855
850
  {
2856
850
    if (!(this+coverageZ[0]).intersects (c->glyphs))
2857
285
      return;
2858
2859
565
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2860
565
    if (unlikely (!cur_active_glyphs)) return;
2861
564
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2862
564
           *cur_active_glyphs);
2863
2864
564
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2865
564
    struct ContextClosureLookupContext lookup_context = {
2866
564
      {intersects_coverage, intersected_coverage_glyphs},
2867
564
      ContextFormat::CoverageBasedContext,
2868
564
      this
2869
564
    };
2870
564
    context_closure_lookup (c,
2871
564
          glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2872
564
          lookupCount, lookupRecord,
2873
564
          0, lookup_context);
2874
2875
564
    c->pop_cur_done_glyphs ();
2876
564
  }
2877
2878
  void closure_lookups (hb_closure_lookups_context_t *c) const
2879
236
  {
2880
236
    if (!intersects (c->glyphs))
2881
28
      return;
2882
208
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2883
208
    recurse_lookups (c, lookupCount, lookupRecord);
2884
208
  }
2885
2886
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
2887
2888
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2889
0
  {
2890
0
    (this+coverageZ[0]).collect_coverage (c->input);
2891
2892
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2893
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2894
0
      {collect_coverage},
2895
0
      this
2896
0
    };
2897
2898
0
    context_collect_glyphs_lookup (c,
2899
0
           glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2900
0
           lookupCount, lookupRecord,
2901
0
           lookup_context);
2902
0
  }
2903
2904
  bool would_apply (hb_would_apply_context_t *c) const
2905
0
  {
2906
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2907
0
    struct ContextApplyLookupContext lookup_context = {
2908
0
      {match_coverage},
2909
0
      this
2910
0
    };
2911
0
    return context_would_apply_lookup (c,
2912
0
               glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2913
0
               lookupCount, lookupRecord,
2914
0
               lookup_context);
2915
0
  }
2916
2917
564
  const Coverage &get_coverage () const { return this+coverageZ[0]; }
2918
2919
  bool apply (hb_ot_apply_context_t *c) const
2920
0
  {
2921
0
    TRACE_APPLY (this);
2922
0
    unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
2923
0
    if (index == NOT_COVERED) return_trace (false);
2924
2925
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2926
0
    struct ContextApplyLookupContext lookup_context = {
2927
0
      {match_coverage},
2928
0
      this
2929
0
    };
2930
0
    return_trace (context_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context));
2931
0
  }
2932
2933
  bool subset (hb_subset_context_t *c) const
2934
194
  {
2935
194
    TRACE_SUBSET (this);
2936
194
    auto *out = c->serializer->start_embed (this);
2937
194
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2938
2939
194
    out->format = format;
2940
194
    out->glyphCount = glyphCount;
2941
2942
194
    auto coverages = coverageZ.as_array (glyphCount);
2943
2944
194
    for (const Offset16To<Coverage>& offset : coverages)
2945
202
    {
2946
      /* TODO(subset) This looks like should not be necessary to write this way. */
2947
202
      auto *o = c->serializer->allocate_size<Offset16To<Coverage>> (Offset16To<Coverage>::static_size);
2948
202
      if (unlikely (!o)) return_trace (false);
2949
202
      if (!o->serialize_subset (c, offset, this)) return_trace (false);
2950
202
    }
2951
2952
128
    const auto& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount));
2953
128
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2954
2955
2956
128
    unsigned count = serialize_lookuprecord_array (c->serializer, lookupRecord.as_array (lookupCount), lookup_map);
2957
128
    return_trace (c->serializer->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2958
194
  }
2959
2960
  bool sanitize (hb_sanitize_context_t *c) const
2961
1.27k
  {
2962
1.27k
    TRACE_SANITIZE (this);
2963
1.27k
    if (unlikely (!c->check_struct (this))) return_trace (false);
2964
1.26k
    hb_barrier ();
2965
1.26k
    unsigned int count = glyphCount;
2966
1.26k
    if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */
2967
1.26k
    if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false);
2968
7.37k
    for (unsigned int i = 0; i < count; i++)
2969
6.14k
      if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false);
2970
1.23k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2971
1.23k
    return_trace (likely (c->check_array (lookupRecord, lookupCount)));
2972
1.25k
  }
2973
2974
  protected:
2975
  HBUINT16  format;     /* Format identifier--format = 3 */
2976
  HBUINT16  glyphCount;   /* Number of glyphs in the input glyph
2977
           * sequence */
2978
  HBUINT16  lookupCount;    /* Number of LookupRecords */
2979
  UnsizedArrayOf<Offset16To<Coverage>>
2980
    coverageZ;    /* Array of offsets to Coverage
2981
           * table in glyph sequence order */
2982
/*UnsizedArrayOf<LookupRecord>
2983
    lookupRecordX;*/  /* Array of LookupRecords--in
2984
           * design order */
2985
  public:
2986
  DEFINE_SIZE_ARRAY (6, coverageZ);
2987
};
2988
2989
struct Context
2990
{
2991
  template <typename context_t, typename ...Ts>
2992
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
2993
22.2k
  {
2994
22.2k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
22.1k
    TRACE_DISPATCH (this, u.format.v);
2996
22.1k
    switch (u.format.v) {
2997
2.39k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
1.62k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
3.21k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
146
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
175
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
14.5k
    default:return_trace (c->default_return_value ());
3005
22.1k
    }
3006
22.1k
  }
OT::hb_intersects_context_t::return_t OT::Context::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
2993
2.65k
  {
2994
2.65k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
2.65k
    TRACE_DISPATCH (this, u.format.v);
2996
2.65k
    switch (u.format.v) {
2997
342
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
163
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
664
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
4
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
1.47k
    default:return_trace (c->default_return_value ());
3005
2.65k
    }
3006
2.65k
  }
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Context::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::Context::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
OT::hb_closure_lookups_context_t::return_t OT::Context::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2993
1.15k
  {
2994
1.15k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
1.15k
    TRACE_DISPATCH (this, u.format.v);
2996
1.15k
    switch (u.format.v) {
2997
187
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
12
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
236
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
716
    default:return_trace (c->default_return_value ());
3005
1.15k
    }
3006
1.15k
  }
hb_subset_context_t::return_t OT::Context::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
Line
Count
Source
2993
280
  {
2994
280
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
280
    TRACE_DISPATCH (this, u.format.v);
2996
280
    switch (u.format.v) {
2997
84
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
2
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
194
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
0
    default:return_trace (c->default_return_value ());
3005
280
    }
3006
280
  }
hb_sanitize_context_t::return_t OT::Context::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
2993
12.1k
  {
2994
12.1k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
12.0k
    TRACE_DISPATCH (this, u.format.v);
2996
12.0k
    switch (u.format.v) {
2997
1.23k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
1.32k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
1.27k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
146
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
157
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
7.86k
    default:return_trace (c->default_return_value ());
3005
12.0k
    }
3006
12.0k
  }
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::Context::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::Context::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
OT::hb_have_non_1to1_context_t::return_t OT::Context::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Line
Count
Source
2993
98
  {
2994
98
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
98
    TRACE_DISPATCH (this, u.format.v);
2996
98
    switch (u.format.v) {
2997
72
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
0
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
0
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
26
    default:return_trace (c->default_return_value ());
3005
98
    }
3006
98
  }
OT::hb_closure_context_t::return_t OT::Context::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
2993
5.93k
  {
2994
5.93k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
2995
5.93k
    TRACE_DISPATCH (this, u.format.v);
2996
5.93k
    switch (u.format.v) {
2997
476
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
2998
128
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
2999
850
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3000
0
#ifndef HB_NO_BEYOND_64K
3001
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3002
14
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3003
0
#endif
3004
4.46k
    default:return_trace (c->default_return_value ());
3005
5.93k
    }
3006
5.93k
  }
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Context::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Context::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
3007
3008
  protected:
3009
  union {
3010
  struct { HBUINT16 v; }  format;   /* Format identifier */
3011
  ContextFormat1_4<SmallTypes>  format1;
3012
  ContextFormat2_5<SmallTypes>  format2;
3013
  ContextFormat3    format3;
3014
#ifndef HB_NO_BEYOND_64K
3015
  ContextFormat1_4<MediumTypes> format4;
3016
  ContextFormat2_5<MediumTypes> format5;
3017
#endif
3018
  } u;
3019
};
3020
3021
3022
/* Chaining Contextual lookups */
3023
3024
struct ChainContextClosureLookupContext
3025
{
3026
  ContextClosureFuncs funcs;
3027
  ContextFormat context_format;
3028
  const void *intersects_data[3];
3029
  void *intersects_cache[3];
3030
  void *intersected_glyphs_cache;
3031
};
3032
3033
struct ChainContextCollectGlyphsLookupContext
3034
{
3035
  ContextCollectGlyphsFuncs funcs;
3036
  const void *collect_data[3];
3037
};
3038
3039
struct ChainContextApplyLookupContext
3040
{
3041
  ChainContextApplyFuncs funcs;
3042
  const void *match_data[3];
3043
};
3044
3045
template <typename HBUINT>
3046
static inline bool chain_context_intersects (const hb_set_t *glyphs,
3047
               unsigned int backtrackCount,
3048
               const HBUINT backtrack[],
3049
               unsigned int inputCount, /* Including the first glyph (not matched) */
3050
               const HBUINT input[], /* Array of input values--start with second glyph */
3051
               unsigned int lookaheadCount,
3052
               const HBUINT lookahead[],
3053
               ChainContextClosureLookupContext &lookup_context)
3054
16.1k
{
3055
16.1k
  return array_is_subset_of (glyphs,
3056
16.1k
           backtrackCount, backtrack,
3057
16.1k
           lookup_context.funcs.intersects,
3058
16.1k
           lookup_context.intersects_data[0],
3059
16.1k
           lookup_context.intersects_cache[0])
3060
12.5k
      && array_is_subset_of (glyphs,
3061
12.5k
           inputCount ? inputCount - 1 : 0, input,
3062
12.5k
           lookup_context.funcs.intersects,
3063
12.5k
           lookup_context.intersects_data[1],
3064
12.5k
           lookup_context.intersects_cache[1])
3065
11.9k
      && array_is_subset_of (glyphs,
3066
11.9k
           lookaheadCount, lookahead,
3067
11.9k
           lookup_context.funcs.intersects,
3068
11.9k
           lookup_context.intersects_data[2],
3069
11.9k
           lookup_context.intersects_cache[2]);
3070
16.1k
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
hb-ot-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Line
Count
Source
3054
6.55k
{
3055
6.55k
  return array_is_subset_of (glyphs,
3056
6.55k
           backtrackCount, backtrack,
3057
6.55k
           lookup_context.funcs.intersects,
3058
6.55k
           lookup_context.intersects_data[0],
3059
6.55k
           lookup_context.intersects_cache[0])
3060
4.00k
      && array_is_subset_of (glyphs,
3061
4.00k
           inputCount ? inputCount - 1 : 0, input,
3062
4.00k
           lookup_context.funcs.intersects,
3063
4.00k
           lookup_context.intersects_data[1],
3064
4.00k
           lookup_context.intersects_cache[1])
3065
3.70k
      && array_is_subset_of (glyphs,
3066
3.70k
           lookaheadCount, lookahead,
3067
3.70k
           lookup_context.funcs.intersects,
3068
3.70k
           lookup_context.intersects_data[2],
3069
3.70k
           lookup_context.intersects_cache[2]);
3070
6.55k
}
Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
hb-subset-plan-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Line
Count
Source
3054
9.55k
{
3055
9.55k
  return array_is_subset_of (glyphs,
3056
9.55k
           backtrackCount, backtrack,
3057
9.55k
           lookup_context.funcs.intersects,
3058
9.55k
           lookup_context.intersects_data[0],
3059
9.55k
           lookup_context.intersects_cache[0])
3060
8.52k
      && array_is_subset_of (glyphs,
3061
8.52k
           inputCount ? inputCount - 1 : 0, input,
3062
8.52k
           lookup_context.funcs.intersects,
3063
8.52k
           lookup_context.intersects_data[1],
3064
8.52k
           lookup_context.intersects_cache[1])
3065
8.20k
      && array_is_subset_of (glyphs,
3066
8.20k
           lookaheadCount, lookahead,
3067
8.20k
           lookup_context.funcs.intersects,
3068
8.20k
           lookup_context.intersects_data[2],
3069
8.20k
           lookup_context.intersects_cache[2]);
3070
9.55k
}
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&)
3071
3072
template <typename HBUINT>
3073
static inline void chain_context_closure_lookup (hb_closure_context_t *c,
3074
             unsigned int backtrackCount,
3075
             const HBUINT backtrack[],
3076
             unsigned int inputCount, /* Including the first glyph (not matched) */
3077
             const HBUINT input[], /* Array of input values--start with second glyph */
3078
             unsigned int lookaheadCount,
3079
             const HBUINT lookahead[],
3080
             unsigned int lookupCount,
3081
             const LookupRecord lookupRecord[],
3082
             unsigned value,
3083
             ChainContextClosureLookupContext &lookup_context)
3084
6.55k
{
3085
6.55k
  if (chain_context_intersects (c->glyphs,
3086
6.55k
        backtrackCount, backtrack,
3087
6.55k
        inputCount, input,
3088
6.55k
        lookaheadCount, lookahead,
3089
6.55k
        lookup_context))
3090
3.49k
    context_closure_recurse_lookups (c,
3091
3.49k
         inputCount, input,
3092
3.49k
         lookupCount, lookupRecord,
3093
3.49k
         value,
3094
3.49k
         lookup_context.context_format,
3095
3.49k
         lookup_context.intersects_data[1],
3096
3.49k
         lookup_context.funcs.intersected_glyphs,
3097
3.49k
         lookup_context.intersected_glyphs_cache);
3098
6.55k
}
Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
hb-ot-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Line
Count
Source
3084
6.55k
{
3085
6.55k
  if (chain_context_intersects (c->glyphs,
3086
6.55k
        backtrackCount, backtrack,
3087
6.55k
        inputCount, input,
3088
6.55k
        lookaheadCount, lookahead,
3089
6.55k
        lookup_context))
3090
3.49k
    context_closure_recurse_lookups (c,
3091
3.49k
         inputCount, input,
3092
3.49k
         lookupCount, lookupRecord,
3093
3.49k
         value,
3094
3.49k
         lookup_context.context_format,
3095
3.49k
         lookup_context.intersects_data[1],
3096
3.49k
         lookup_context.funcs.intersected_glyphs,
3097
3.49k
         lookup_context.intersected_glyphs_cache);
3098
6.55k
}
Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
3099
3100
template <typename HBUINT>
3101
static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
3102
              unsigned int backtrackCount,
3103
              const HBUINT backtrack[],
3104
              unsigned int inputCount, /* Including the first glyph (not matched) */
3105
              const HBUINT input[], /* Array of input values--start with second glyph */
3106
              unsigned int lookaheadCount,
3107
              const HBUINT lookahead[],
3108
              unsigned int lookupCount,
3109
              const LookupRecord lookupRecord[],
3110
              ChainContextCollectGlyphsLookupContext &lookup_context)
3111
0
{
3112
0
  collect_array (c, c->before,
3113
0
     backtrackCount, backtrack,
3114
0
     lookup_context.funcs.collect, lookup_context.collect_data[0]);
3115
0
  collect_array (c, c->input,
3116
0
     inputCount ? inputCount - 1 : 0, input,
3117
0
     lookup_context.funcs.collect, lookup_context.collect_data[1]);
3118
0
  collect_array (c, c->after,
3119
0
     lookaheadCount, lookahead,
3120
0
     lookup_context.funcs.collect, lookup_context.collect_data[2]);
3121
0
  recurse_lookups (c,
3122
0
       lookupCount, lookupRecord);
3123
0
}
Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
3124
3125
template <typename HBUINT>
3126
static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c,
3127
                 unsigned int backtrackCount,
3128
                 const HBUINT backtrack[] HB_UNUSED,
3129
                 unsigned int inputCount, /* Including the first glyph (not matched) */
3130
                 const HBUINT input[], /* Array of input values--start with second glyph */
3131
                 unsigned int lookaheadCount,
3132
                 const HBUINT lookahead[] HB_UNUSED,
3133
                 unsigned int lookupCount HB_UNUSED,
3134
                 const LookupRecord lookupRecord[] HB_UNUSED,
3135
                 const ChainContextApplyLookupContext &lookup_context)
3136
0
{
3137
0
  return (c->zero_context ? !backtrackCount && !lookaheadCount : true)
3138
0
      && would_match_input (c,
3139
0
          inputCount, input,
3140
0
          lookup_context.funcs.match[1], lookup_context.match_data[1]);
3141
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
3142
3143
template <typename HBUINT>
3144
static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
3145
                 unsigned int backtrackCount,
3146
                 const HBUINT backtrack[],
3147
                 unsigned int inputCount, /* Including the first glyph (not matched) */
3148
                 const HBUINT input[], /* Array of input values--start with second glyph */
3149
                 unsigned int lookaheadCount,
3150
                 const HBUINT lookahead[],
3151
                 unsigned int lookupCount,
3152
                 const LookupRecord lookupRecord[],
3153
                 const ChainContextApplyLookupContext &lookup_context)
3154
0
{
3155
0
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3156
3157
0
  unsigned start_index = c->buffer->out_len;
3158
0
  unsigned end_index = c->buffer->idx;
3159
0
  unsigned match_end = 0;
3160
0
  bool ret = true;
3161
0
  if (!(match_input (c,
3162
0
         inputCount, input,
3163
0
         lookup_context.funcs.match[1], lookup_context.match_data[1],
3164
0
         &match_end) && (end_index = match_end)
3165
0
       && match_lookahead (c,
3166
0
         lookaheadCount, lookahead,
3167
0
         lookup_context.funcs.match[2], lookup_context.match_data[2],
3168
0
         match_end, &end_index)))
3169
0
  {
3170
0
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
3171
0
    return false;
3172
0
  }
3173
3174
0
  if (!match_backtrack (c,
3175
0
      backtrackCount, backtrack,
3176
0
      lookup_context.funcs.match[0], lookup_context.match_data[0],
3177
0
      &start_index))
3178
0
  {
3179
0
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
3180
0
    return false;
3181
0
  }
3182
3183
0
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
3184
0
  apply_lookup (c,
3185
0
    inputCount,
3186
0
    lookupCount, lookupRecord,
3187
0
    match_end);
3188
3189
0
  return ret;
3190
0
}
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
3191
3192
template <typename Types>
3193
struct ChainRule
3194
{
3195
  template <typename T>
3196
  friend struct ChainRuleSet;
3197
3198
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
3199
8.68k
  {
3200
8.68k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3201
8.68k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3202
8.68k
    return chain_context_intersects (glyphs,
3203
8.68k
             backtrack.len, backtrack.arrayZ,
3204
8.68k
             input.lenP1, input.arrayZ,
3205
8.68k
             lookahead.len, lookahead.arrayZ,
3206
8.68k
             lookup_context);
3207
8.68k
  }
OT::ChainRule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3199
8.68k
  {
3200
8.68k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3201
8.68k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3202
8.68k
    return chain_context_intersects (glyphs,
3203
8.68k
             backtrack.len, backtrack.arrayZ,
3204
8.68k
             input.lenP1, input.arrayZ,
3205
8.68k
             lookahead.len, lookahead.arrayZ,
3206
8.68k
             lookup_context);
3207
8.68k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
3208
3209
  void closure (hb_closure_context_t *c, unsigned value,
3210
    ChainContextClosureLookupContext &lookup_context) const
3211
16.7k
  {
3212
16.7k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3213
3214
5.92k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3215
5.92k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3216
5.92k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3217
5.92k
    chain_context_closure_lookup (c,
3218
5.92k
          backtrack.len, backtrack.arrayZ,
3219
5.92k
          input.lenP1, input.arrayZ,
3220
5.92k
          lookahead.len, lookahead.arrayZ,
3221
5.92k
          lookup.len, lookup.arrayZ,
3222
5.92k
          value,
3223
5.92k
          lookup_context);
3224
5.92k
  }
OT::ChainRule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3211
16.7k
  {
3212
16.7k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3213
3214
5.92k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3215
5.92k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3216
5.92k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3217
5.92k
    chain_context_closure_lookup (c,
3218
5.92k
          backtrack.len, backtrack.arrayZ,
3219
5.92k
          input.lenP1, input.arrayZ,
3220
5.92k
          lookahead.len, lookahead.arrayZ,
3221
5.92k
          lookup.len, lookup.arrayZ,
3222
5.92k
          value,
3223
5.92k
          lookup_context);
3224
5.92k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
3225
3226
  void closure_lookups (hb_closure_lookups_context_t *c,
3227
                        ChainContextClosureLookupContext &lookup_context) const
3228
8.48k
  {
3229
8.48k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3230
8.48k
    if (!intersects (c->glyphs, lookup_context)) return;
3231
3232
7.31k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3233
7.31k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3234
7.31k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3235
7.31k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
3236
7.31k
  }
OT::ChainRule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3228
8.48k
  {
3229
8.48k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3230
8.48k
    if (!intersects (c->glyphs, lookup_context)) return;
3231
3232
7.31k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3233
7.31k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3234
7.31k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3235
7.31k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
3236
7.31k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
3237
3238
  void collect_glyphs (hb_collect_glyphs_context_t *c,
3239
           ChainContextCollectGlyphsLookupContext &lookup_context) const
3240
0
  {
3241
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3242
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3243
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3244
0
    chain_context_collect_glyphs_lookup (c,
3245
0
           backtrack.len, backtrack.arrayZ,
3246
0
           input.lenP1, input.arrayZ,
3247
0
           lookahead.len, lookahead.arrayZ,
3248
0
           lookup.len, lookup.arrayZ,
3249
0
           lookup_context);
3250
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
3251
3252
  bool would_apply (hb_would_apply_context_t *c,
3253
        const ChainContextApplyLookupContext &lookup_context) const
3254
0
  {
3255
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3256
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3257
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3258
0
    return chain_context_would_apply_lookup (c,
3259
0
               backtrack.len, backtrack.arrayZ,
3260
0
               input.lenP1, input.arrayZ,
3261
0
               lookahead.len, lookahead.arrayZ, lookup.len,
3262
0
               lookup.arrayZ, lookup_context);
3263
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
3264
3265
  bool apply (hb_ot_apply_context_t *c,
3266
        const ChainContextApplyLookupContext &lookup_context) const
3267
0
  {
3268
0
    TRACE_APPLY (this);
3269
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3270
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3271
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3272
0
    return_trace (chain_context_apply_lookup (c,
3273
0
                backtrack.len, backtrack.arrayZ,
3274
0
                input.lenP1, input.arrayZ,
3275
0
                lookahead.len, lookahead.arrayZ, lookup.len,
3276
0
                lookup.arrayZ, lookup_context));
3277
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
3278
3279
  template<typename Iterator,
3280
     hb_requires (hb_is_iterator (Iterator))>
3281
  void serialize_array (hb_serialize_context_t *c,
3282
      HBUINT16 len,
3283
      Iterator it) const
3284
30.9k
  {
3285
30.9k
    c->copy (len);
3286
30.9k
    for (const auto g : it)
3287
109M
      c->copy ((HBUINT16) g);
3288
30.9k
  }
_ZNK2OT9ChainRuleINS_6Layout10SmallTypesEE15serialize_arrayI13hb_map_iter_tI10hb_array_tIKNS_7NumTypeILb1EtLj2EEEERPK8hb_map_tL24hb_function_sortedness_t0ELPv0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSJ_6item_tEEE5valueEvE4typeELSG_0EEEvP22hb_serialize_context_tS8_SJ_
Line
Count
Source
3284
30.9k
  {
3285
30.9k
    c->copy (len);
3286
30.9k
    for (const auto g : it)
3287
109M
      c->copy ((HBUINT16) g);
3288
30.9k
  }
Unexecuted instantiation: _ZNK2OT9ChainRuleINS_6Layout11MediumTypesEE15serialize_arrayI13hb_map_iter_tI10hb_array_tIKNS_7NumTypeILb1EjLj3EEEERPK8hb_map_tL24hb_function_sortedness_t0ELPv0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSJ_6item_tEEE5valueEvE4typeELSG_0EEEvP22hb_serialize_context_tNS7_ILb1EtLj2EEESJ_
3289
3290
  bool serialize (hb_serialize_context_t *c,
3291
      const hb_map_t *lookup_map,
3292
      const hb_map_t *backtrack_map,
3293
      const hb_map_t *input_map = nullptr,
3294
      const hb_map_t *lookahead_map = nullptr) const
3295
10.3k
  {
3296
10.3k
    TRACE_SERIALIZE (this);
3297
3298
10.3k
    const hb_map_t *mapping = backtrack_map;
3299
10.3k
    serialize_array (c, backtrack.len, + backtrack.iter ()
3300
10.3k
               | hb_map (mapping));
3301
3302
10.3k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3303
10.3k
    if (input_map) mapping = input_map;
3304
10.3k
    serialize_array (c, input.lenP1, + input.iter ()
3305
10.3k
             | hb_map (mapping));
3306
3307
10.3k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3308
10.3k
    if (lookahead_map) mapping = lookahead_map;
3309
10.3k
    serialize_array (c, lookahead.len, + lookahead.iter ()
3310
10.3k
               | hb_map (mapping));
3311
3312
10.3k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3313
3314
10.3k
    HBUINT16* lookupCount = c->embed (&(lookup.len));
3315
10.3k
    if (!lookupCount) return_trace (false);
3316
3317
10.3k
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
3318
10.3k
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3319
10.3k
  }
OT::ChainRule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
3295
10.3k
  {
3296
10.3k
    TRACE_SERIALIZE (this);
3297
3298
10.3k
    const hb_map_t *mapping = backtrack_map;
3299
10.3k
    serialize_array (c, backtrack.len, + backtrack.iter ()
3300
10.3k
               | hb_map (mapping));
3301
3302
10.3k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3303
10.3k
    if (input_map) mapping = input_map;
3304
10.3k
    serialize_array (c, input.lenP1, + input.iter ()
3305
10.3k
             | hb_map (mapping));
3306
3307
10.3k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3308
10.3k
    if (lookahead_map) mapping = lookahead_map;
3309
10.3k
    serialize_array (c, lookahead.len, + lookahead.iter ()
3310
10.3k
               | hb_map (mapping));
3311
3312
10.3k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3313
3314
10.3k
    HBUINT16* lookupCount = c->embed (&(lookup.len));
3315
10.3k
    if (!lookupCount) return_trace (false);
3316
3317
10.3k
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
3318
10.3k
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3319
10.3k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
3320
3321
  bool subset (hb_subset_context_t *c,
3322
         const hb_map_t *lookup_map,
3323
         const hb_map_t *backtrack_map = nullptr,
3324
         const hb_map_t *input_map = nullptr,
3325
         const hb_map_t *lookahead_map = nullptr) const
3326
12.1k
  {
3327
12.1k
    TRACE_SUBSET (this);
3328
3329
12.1k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3330
12.1k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3331
3332
12.1k
    if (!backtrack_map)
3333
12.1k
    {
3334
12.1k
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3335
12.1k
      if (!hb_all (backtrack, glyphset) ||
3336
11.0k
    !hb_all (input, glyphset) ||
3337
10.5k
    !hb_all (lookahead, glyphset))
3338
1.81k
  return_trace (false);
3339
3340
10.3k
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
3341
10.3k
    }
3342
4
    else
3343
4
    {
3344
4
      if (!hb_all (backtrack, backtrack_map) ||
3345
2
    !hb_all (input, input_map) ||
3346
2
    !hb_all (lookahead, lookahead_map))
3347
2
  return_trace (false);
3348
3349
2
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
3350
2
    }
3351
3352
12.1k
    return_trace (true);
3353
12.1k
  }
OT::ChainRule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
3326
12.1k
  {
3327
12.1k
    TRACE_SUBSET (this);
3328
3329
12.1k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3330
12.1k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3331
3332
12.1k
    if (!backtrack_map)
3333
12.1k
    {
3334
12.1k
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3335
12.1k
      if (!hb_all (backtrack, glyphset) ||
3336
11.0k
    !hb_all (input, glyphset) ||
3337
10.5k
    !hb_all (lookahead, glyphset))
3338
1.81k
  return_trace (false);
3339
3340
10.3k
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
3341
10.3k
    }
3342
4
    else
3343
4
    {
3344
4
      if (!hb_all (backtrack, backtrack_map) ||
3345
2
    !hb_all (input, input_map) ||
3346
2
    !hb_all (lookahead, lookahead_map))
3347
2
  return_trace (false);
3348
3349
2
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
3350
2
    }
3351
3352
10.3k
    return_trace (true);
3353
12.1k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
3354
3355
  bool sanitize (hb_sanitize_context_t *c) const
3356
149k
  {
3357
149k
    TRACE_SANITIZE (this);
3358
    /* Hyper-optimized sanitized because this is really hot. */
3359
149k
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3360
149k
    hb_barrier ();
3361
149k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3362
149k
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3363
149k
    hb_barrier ();
3364
149k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3365
149k
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3366
149k
    hb_barrier ();
3367
149k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3368
149k
    return_trace (likely (lookup.sanitize (c)));
3369
149k
  }
OT::ChainRule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3356
149k
  {
3357
149k
    TRACE_SANITIZE (this);
3358
    /* Hyper-optimized sanitized because this is really hot. */
3359
149k
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3360
149k
    hb_barrier ();
3361
149k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3362
149k
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3363
149k
    hb_barrier ();
3364
149k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3365
149k
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3366
149k
    hb_barrier ();
3367
149k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3368
149k
    return_trace (likely (lookup.sanitize (c)));
3369
149k
  }
OT::ChainRule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3356
427
  {
3357
427
    TRACE_SANITIZE (this);
3358
    /* Hyper-optimized sanitized because this is really hot. */
3359
427
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3360
403
    hb_barrier ();
3361
403
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3362
403
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3363
385
    hb_barrier ();
3364
385
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3365
385
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3366
356
    hb_barrier ();
3367
356
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3368
356
    return_trace (likely (lookup.sanitize (c)));
3369
385
  }
3370
3371
  protected:
3372
  Array16Of<typename Types::HBUINT>
3373
    backtrack;    /* Array of backtracking values
3374
           * (to be matched before the input
3375
           * sequence) */
3376
  HeadlessArray16Of<typename Types::HBUINT>
3377
    inputX;     /* Array of input values (start with
3378
           * second glyph) */
3379
  Array16Of<typename Types::HBUINT>
3380
    lookaheadX;   /* Array of lookahead values's (to be
3381
           * matched after the input sequence) */
3382
  Array16Of<LookupRecord>
3383
    lookupX;    /* Array of LookupRecords--in
3384
           * design order) */
3385
  public:
3386
  DEFINE_SIZE_MIN (8);
3387
};
3388
3389
template <typename Types>
3390
struct ChainRuleSet
3391
{
3392
  using ChainRule = OT::ChainRule<Types>;
3393
3394
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
3395
176
  {
3396
176
    return
3397
176
    + hb_iter (rule)
3398
176
    | hb_map (hb_add (this))
3399
202
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
OT::ChainRuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3399
202
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
3400
176
    | hb_any
3401
176
    ;
3402
176
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3395
176
  {
3396
176
    return
3397
176
    + hb_iter (rule)
3398
176
    | hb_map (hb_add (this))
3399
176
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
3400
176
    | hb_any
3401
176
    ;
3402
176
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
3403
  void closure (hb_closure_context_t *c, unsigned value, ChainContextClosureLookupContext &lookup_context) const
3404
136
  {
3405
136
    if (unlikely (c->lookup_limit_exceeded ())) return;
3406
3407
128
    return
3408
128
    + hb_iter (rule)
3409
128
    | hb_map (hb_add (this))
3410
16.7k
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3410
16.7k
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
3411
136
    ;
3412
136
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3404
136
  {
3405
136
    if (unlikely (c->lookup_limit_exceeded ())) return;
3406
3407
128
    return
3408
128
    + hb_iter (rule)
3409
128
    | hb_map (hb_add (this))
3410
128
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
3411
136
    ;
3412
136
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
3413
3414
  void closure_lookups (hb_closure_lookups_context_t *c,
3415
                        ChainContextClosureLookupContext &lookup_context) const
3416
93
  {
3417
93
    if (unlikely (c->lookup_limit_exceeded ())) return;
3418
3419
93
    + hb_iter (rule)
3420
93
    | hb_map (hb_add (this))
3421
8.48k
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3421
8.48k
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
3422
93
    ;
3423
93
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3416
93
  {
3417
93
    if (unlikely (c->lookup_limit_exceeded ())) return;
3418
3419
93
    + hb_iter (rule)
3420
93
    | hb_map (hb_add (this))
3421
93
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
3422
93
    ;
3423
93
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
3424
3425
  void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const
3426
0
  {
3427
0
    return
3428
0
    + hb_iter (rule)
3429
0
    | hb_map (hb_add (this))
3430
0
    | hb_apply ([&] (const ChainRule &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
3431
0
    ;
3432
0
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
3433
3434
  bool would_apply (hb_would_apply_context_t *c,
3435
        const ChainContextApplyLookupContext &lookup_context) const
3436
0
  {
3437
0
    return
3438
0
    + hb_iter (rule)
3439
0
    | hb_map (hb_add (this))
3440
0
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
3441
0
    | hb_any
3442
0
    ;
3443
0
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
3444
3445
  bool apply (hb_ot_apply_context_t *c,
3446
        const ChainContextApplyLookupContext &lookup_context) const
3447
0
  {
3448
0
    TRACE_APPLY (this);
3449
3450
0
    unsigned num_rules = rule.len;
3451
3452
0
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3453
0
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3454
0
#endif
3455
0
    {
3456
0
    slow:
3457
0
      return_trace (
3458
0
      + hb_iter (rule)
3459
0
      | hb_map (hb_add (this))
3460
0
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3461
0
      | hb_any
3462
0
      )
3463
0
      ;
3464
0
    }
3465
3466
    /* This version is optimized for speed by matching the first & second
3467
     * components of the rule here, instead of calling into the matching code.
3468
     *
3469
     * Replicated from LigatureSet::apply(). */
3470
3471
    /* We use the iter_context instead of iter_input, to avoid skipping
3472
     * default-ignorables and such.
3473
     *
3474
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3475
     */
3476
0
    auto &skippy_iter = c->iter_context;
3477
0
    skippy_iter.reset (c->buffer->idx);
3478
0
    skippy_iter.set_match_func (match_always, nullptr);
3479
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3480
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3481
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3482
0
    bool matched = skippy_iter.next ();
3483
0
    if (likely (matched))
3484
0
    {
3485
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3486
0
      {
3487
  /* Can't use the fast path if eg. the next char is a default-ignorable
3488
   * or other skippable. */
3489
0
        goto slow;
3490
0
      }
3491
3492
0
      first = &c->buffer->info[skippy_iter.idx];
3493
0
      unsafe_to1 = skippy_iter.idx + 1;
3494
0
    }
3495
0
    else
3496
0
    {
3497
      /* Failed to match a next glyph. Only try applying rules that have
3498
       * no further input and lookahead. */
3499
0
      return_trace (
3500
0
      + hb_iter (rule)
3501
0
      | hb_map (hb_add (this))
3502
0
      | hb_filter ([&] (const ChainRule &_)
3503
0
       {
3504
0
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
3505
0
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
3506
0
         return input.lenP1 <= 1 && lookahead.len == 0;
3507
0
       })
3508
0
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3509
0
      | hb_any
3510
0
      )
3511
0
      ;
3512
0
    }
3513
0
    matched = skippy_iter.next ();
3514
0
    if (likely (matched))
3515
0
    {
3516
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3517
0
      {
3518
  /* Can't use the fast path if eg. the next char is a default-ignorable
3519
   * or other skippable. */
3520
0
        goto slow;
3521
0
      }
3522
3523
0
      second = &c->buffer->info[skippy_iter.idx];
3524
0
      unsafe_to2 = skippy_iter.idx + 1;
3525
0
    }
3526
3527
0
    auto match_input = lookup_context.funcs.match[1];
3528
0
    auto match_lookahead = lookup_context.funcs.match[2];
3529
0
    auto *input_data = lookup_context.match_data[1];
3530
0
    auto *lookahead_data = lookup_context.match_data[2];
3531
0
    for (unsigned int i = 0; i < num_rules; i++)
3532
0
    {
3533
0
      const auto &r = this+rule.arrayZ[i];
3534
3535
0
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
3536
0
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
3537
3538
0
      unsigned lenP1 = input.lenP1;
3539
0
      if (lenP1 > 1 ?
3540
0
     (!match_input ||
3541
0
      match_input (*first, input.arrayZ[0], input_data))
3542
0
    :
3543
0
     (!lookahead.len || !match_lookahead ||
3544
0
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
3545
0
      {
3546
0
  lenP1 = hb_max (lenP1, 1u);
3547
0
        if (!second ||
3548
0
      (lenP1 > 2 ?
3549
0
       (!match_input ||
3550
0
        match_input (*second, input.arrayZ[1], input_data))
3551
0
       :
3552
0
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
3553
0
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
3554
0
  {
3555
0
    if (r.apply (c, lookup_context))
3556
0
    {
3557
0
      if (unsafe_to != (unsigned) -1)
3558
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3559
0
      return_trace (true);
3560
0
    }
3561
0
  }
3562
0
  else
3563
0
    unsafe_to = unsafe_to2;
3564
0
      }
3565
0
      else
3566
0
      {
3567
0
  if (unsafe_to == (unsigned) -1)
3568
0
    unsafe_to = unsafe_to1;
3569
3570
0
  if (lenP1 > 1)
3571
0
  {
3572
    // Skip ahead to next possible first glyph match.
3573
0
    for (; i + 1 < num_rules; i++)
3574
0
    {
3575
0
      const auto &r2 = this+rule.arrayZ[i + 1];
3576
0
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
3577
0
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3578
0
        break;
3579
0
    }
3580
0
  }
3581
0
      }
3582
0
    }
3583
0
    if (likely (unsafe_to != (unsigned) -1))
3584
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3585
3586
0
    return_trace (false);
3587
0
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
3588
3589
  bool subset (hb_subset_context_t *c,
3590
         const hb_map_t *lookup_map,
3591
         const hb_map_t *backtrack_klass_map = nullptr,
3592
         const hb_map_t *input_klass_map = nullptr,
3593
         const hb_map_t *lookahead_klass_map = nullptr) const
3594
136
  {
3595
136
    TRACE_SUBSET (this);
3596
3597
136
    auto snap = c->serializer->snapshot ();
3598
136
    auto *out = c->serializer->start_embed (*this);
3599
136
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3600
3601
136
    for (const Offset16To<ChainRule>& _ : rule)
3602
20.9k
    {
3603
20.9k
      if (!_) continue;
3604
18.3k
      auto o_snap = c->serializer->snapshot ();
3605
18.3k
      auto *o = out->rule.serialize_append (c->serializer);
3606
18.3k
      if (unlikely (!o)) continue;
3607
3608
12.1k
      if (!o->serialize_subset (c, _, this,
3609
12.1k
        lookup_map,
3610
12.1k
        backtrack_klass_map,
3611
12.1k
        input_klass_map,
3612
12.1k
        lookahead_klass_map))
3613
1.81k
      {
3614
1.81k
  out->rule.pop ();
3615
1.81k
  c->serializer->revert (o_snap);
3616
1.81k
      }
3617
12.1k
    }
3618
3619
136
    bool ret = bool (out->rule);
3620
136
    if (!ret) c->serializer->revert (snap);
3621
3622
136
    return_trace (ret);
3623
136
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
3594
136
  {
3595
136
    TRACE_SUBSET (this);
3596
3597
136
    auto snap = c->serializer->snapshot ();
3598
136
    auto *out = c->serializer->start_embed (*this);
3599
136
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3600
3601
136
    for (const Offset16To<ChainRule>& _ : rule)
3602
20.9k
    {
3603
20.9k
      if (!_) continue;
3604
18.3k
      auto o_snap = c->serializer->snapshot ();
3605
18.3k
      auto *o = out->rule.serialize_append (c->serializer);
3606
18.3k
      if (unlikely (!o)) continue;
3607
3608
12.1k
      if (!o->serialize_subset (c, _, this,
3609
12.1k
        lookup_map,
3610
12.1k
        backtrack_klass_map,
3611
12.1k
        input_klass_map,
3612
12.1k
        lookahead_klass_map))
3613
1.81k
      {
3614
1.81k
  out->rule.pop ();
3615
1.81k
  c->serializer->revert (o_snap);
3616
1.81k
      }
3617
12.1k
    }
3618
3619
136
    bool ret = bool (out->rule);
3620
136
    if (!ret) c->serializer->revert (snap);
3621
3622
136
    return_trace (ret);
3623
136
  }
Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
3624
3625
  bool sanitize (hb_sanitize_context_t *c) const
3626
8.06k
  {
3627
8.06k
    TRACE_SANITIZE (this);
3628
8.06k
    return_trace (rule.sanitize (c, this));
3629
8.06k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3626
7.86k
  {
3627
7.86k
    TRACE_SANITIZE (this);
3628
7.86k
    return_trace (rule.sanitize (c, this));
3629
7.86k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3626
203
  {
3627
203
    TRACE_SANITIZE (this);
3628
203
    return_trace (rule.sanitize (c, this));
3629
203
  }
3630
3631
  protected:
3632
  Array16OfOffset16To<ChainRule>
3633
    rule;     /* Array of ChainRule tables
3634
           * ordered by preference */
3635
  public:
3636
  DEFINE_SIZE_ARRAY (2, rule);
3637
};
3638
3639
template <typename Types>
3640
struct ChainContextFormat1_4
3641
{
3642
  using ChainRuleSet = OT::ChainRuleSet<Types>;
3643
3644
  bool intersects (const hb_set_t *glyphs) const
3645
1.58k
  {
3646
1.58k
    struct ChainContextClosureLookupContext lookup_context = {
3647
1.58k
      {intersects_glyph, intersected_glyph},
3648
1.58k
      ContextFormat::SimpleContext,
3649
1.58k
      {nullptr, nullptr, nullptr}
3650
1.58k
    };
3651
3652
1.58k
    return
3653
1.58k
    + hb_zip (this+coverage, ruleSet)
3654
1.58k
    | hb_filter (*glyphs, hb_first)
3655
1.58k
    | hb_map (hb_second)
3656
1.58k
    | hb_map (hb_add (this))
3657
1.58k
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3657
145
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
3658
1.58k
    | hb_any
3659
1.58k
    ;
3660
1.58k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3645
1.58k
  {
3646
1.58k
    struct ChainContextClosureLookupContext lookup_context = {
3647
1.58k
      {intersects_glyph, intersected_glyph},
3648
1.58k
      ContextFormat::SimpleContext,
3649
1.58k
      {nullptr, nullptr, nullptr}
3650
1.58k
    };
3651
3652
1.58k
    return
3653
1.58k
    + hb_zip (this+coverage, ruleSet)
3654
1.58k
    | hb_filter (*glyphs, hb_first)
3655
1.58k
    | hb_map (hb_second)
3656
1.58k
    | hb_map (hb_add (this))
3657
1.58k
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
3658
1.58k
    | hb_any
3659
1.58k
    ;
3660
1.58k
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
3661
3662
  bool may_have_non_1to1 () const
3663
16
  { return true; }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
3663
16
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
3664
3665
  void closure (hb_closure_context_t *c) const
3666
296
  {
3667
296
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3668
296
    if (unlikely (!cur_active_glyphs)) return;
3669
296
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3670
296
           *cur_active_glyphs);
3671
3672
296
    struct ChainContextClosureLookupContext lookup_context = {
3673
296
      {intersects_glyph, intersected_glyph},
3674
296
      ContextFormat::SimpleContext,
3675
296
      {nullptr, nullptr, nullptr}
3676
296
    };
3677
3678
296
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3679
1.03k
    | hb_filter ([&] (hb_codepoint_t _) {
3680
1.03k
      return c->previous_parent_active_glyphs ().has (_);
3681
1.03k
    }, hb_first)
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3679
1.03k
    | hb_filter ([&] (hb_codepoint_t _) {
3680
1.03k
      return c->previous_parent_active_glyphs ().has (_);
3681
1.03k
    }, hb_first)
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
3682
296
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
Line
Count
Source
3682
111
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
3683
296
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&> const&) const
Line
Count
Source
3683
111
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&) const
3684
296
    ;
3685
3686
296
    c->pop_cur_done_glyphs ();
3687
296
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3666
296
  {
3667
296
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3668
296
    if (unlikely (!cur_active_glyphs)) return;
3669
296
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3670
296
           *cur_active_glyphs);
3671
3672
296
    struct ChainContextClosureLookupContext lookup_context = {
3673
296
      {intersects_glyph, intersected_glyph},
3674
296
      ContextFormat::SimpleContext,
3675
296
      {nullptr, nullptr, nullptr}
3676
296
    };
3677
3678
296
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3679
296
    | hb_filter ([&] (hb_codepoint_t _) {
3680
296
      return c->previous_parent_active_glyphs ().has (_);
3681
296
    }, hb_first)
3682
296
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
3683
296
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
3684
296
    ;
3685
3686
296
    c->pop_cur_done_glyphs ();
3687
296
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
3688
3689
  void closure_lookups (hb_closure_lookups_context_t *c) const
3690
59
  {
3691
59
    struct ChainContextClosureLookupContext lookup_context = {
3692
59
      {intersects_glyph, nullptr},
3693
59
      ContextFormat::SimpleContext,
3694
59
      {nullptr, nullptr, nullptr}
3695
59
    };
3696
3697
59
    + hb_zip (this+coverage, ruleSet)
3698
59
    | hb_filter (*c->glyphs, hb_first)
3699
59
    | hb_map (hb_second)
3700
59
    | hb_map (hb_add (this))
3701
80
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3701
80
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
3702
59
    ;
3703
59
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3690
59
  {
3691
59
    struct ChainContextClosureLookupContext lookup_context = {
3692
59
      {intersects_glyph, nullptr},
3693
59
      ContextFormat::SimpleContext,
3694
59
      {nullptr, nullptr, nullptr}
3695
59
    };
3696
3697
59
    + hb_zip (this+coverage, ruleSet)
3698
59
    | hb_filter (*c->glyphs, hb_first)
3699
59
    | hb_map (hb_second)
3700
59
    | hb_map (hb_add (this))
3701
59
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
3702
59
    ;
3703
59
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
3704
3705
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
3706
3707
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3708
0
  {
3709
0
    (this+coverage).collect_coverage (c->input);
3710
3711
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
3712
0
      {collect_glyph},
3713
0
      {nullptr, nullptr, nullptr}
3714
0
    };
3715
3716
0
    + hb_iter (ruleSet)
3717
0
    | hb_map (hb_add (this))
3718
0
    | hb_apply ([&] (const ChainRuleSet &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
3719
0
    ;
3720
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
3721
3722
  bool would_apply (hb_would_apply_context_t *c) const
3723
0
  {
3724
0
    const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
3725
0
    struct ChainContextApplyLookupContext lookup_context = {
3726
0
      {{match_glyph, match_glyph, match_glyph}},
3727
0
      {nullptr, nullptr, nullptr}
3728
0
    };
3729
0
    return rule_set.would_apply (c, lookup_context);
3730
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
3731
3732
296
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3732
296
  const Coverage &get_coverage () const { return this+coverage; }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
3733
3734
  bool apply (hb_ot_apply_context_t *c) const
3735
0
  {
3736
0
    TRACE_APPLY (this);
3737
0
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3738
0
    if (index == NOT_COVERED) return_trace (false);
3739
3740
0
    const ChainRuleSet &rule_set = this+ruleSet[index];
3741
0
    struct ChainContextApplyLookupContext lookup_context = {
3742
0
      {{match_glyph, match_glyph, match_glyph}},
3743
0
      {nullptr, nullptr, nullptr}
3744
0
    };
3745
0
    return_trace (rule_set.apply (c, lookup_context));
3746
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
3747
3748
  bool subset (hb_subset_context_t *c) const
3749
84
  {
3750
84
    TRACE_SUBSET (this);
3751
84
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3752
84
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3753
3754
84
    auto *out = c->serializer->start_embed (*this);
3755
84
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3756
84
    out->format = format;
3757
3758
84
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3759
84
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3760
84
    + hb_zip (this+coverage, ruleSet)
3761
84
    | hb_filter (glyphset, hb_first)
3762
84
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3763
84
    | hb_map (hb_first)
3764
84
    | hb_map (glyph_map)
3765
84
    | hb_sink (new_coverage)
3766
84
    ;
3767
3768
84
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3769
84
    return_trace (bool (new_coverage));
3770
84
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
3749
84
  {
3750
84
    TRACE_SUBSET (this);
3751
84
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3752
84
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3753
3754
84
    auto *out = c->serializer->start_embed (*this);
3755
84
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3756
84
    out->format = format;
3757
3758
84
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3759
84
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3760
84
    + hb_zip (this+coverage, ruleSet)
3761
84
    | hb_filter (glyphset, hb_first)
3762
84
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3763
84
    | hb_map (hb_first)
3764
84
    | hb_map (glyph_map)
3765
84
    | hb_sink (new_coverage)
3766
84
    ;
3767
3768
84
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3769
84
    return_trace (bool (new_coverage));
3770
84
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
3771
3772
  bool sanitize (hb_sanitize_context_t *c) const
3773
4.14k
  {
3774
4.14k
    TRACE_SANITIZE (this);
3775
4.14k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3776
4.14k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3773
3.65k
  {
3774
3.65k
    TRACE_SANITIZE (this);
3775
3.65k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3776
3.65k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3773
495
  {
3774
495
    TRACE_SANITIZE (this);
3775
495
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3776
495
  }
3777
3778
  protected:
3779
  HBUINT16  format;     /* Format identifier--format = 1 */
3780
  typename Types::template OffsetTo<Coverage>
3781
    coverage;   /* Offset to Coverage table--from
3782
           * beginning of table */
3783
  Array16Of<typename Types::template OffsetTo<ChainRuleSet>>
3784
    ruleSet;    /* Array of ChainRuleSet tables
3785
           * ordered by Coverage Index */
3786
  public:
3787
  DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet);
3788
};
3789
3790
template <typename Types>
3791
struct ChainContextFormat2_5
3792
{
3793
  using ChainRuleSet = OT::ChainRuleSet<SmallTypes>;
3794
3795
  bool intersects (const hb_set_t *glyphs) const
3796
371
  {
3797
371
    if (!(this+coverage).intersects (glyphs))
3798
309
      return false;
3799
3800
62
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3801
62
    const ClassDef &input_class_def = this+inputClassDef;
3802
62
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3803
3804
62
    hb_map_t caches[3] = {};
3805
62
    struct ChainContextClosureLookupContext lookup_context = {
3806
62
      {intersects_class, nullptr},
3807
62
      ContextFormat::ClassBasedContext,
3808
62
      {&backtrack_class_def,
3809
62
       &input_class_def,
3810
62
       &lookahead_class_def},
3811
62
      {&caches[0], &caches[1], &caches[2]}
3812
62
    };
3813
3814
62
    hb_set_t retained_coverage_glyphs;
3815
62
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3816
3817
62
    hb_set_t coverage_glyph_classes;
3818
62
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3819
3820
62
    return
3821
62
    + hb_iter (ruleSet)
3822
62
    | hb_map (hb_add (this))
3823
62
    | hb_enumerate
3824
62
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
3825
62
        { return input_class_def.intersects_class (glyphs, p.first) &&
3826
36
           coverage_glyph_classes.has (p.first) &&
3827
31
           p.second.intersects (glyphs, lookup_context); })
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&>) const
Line
Count
Source
3825
60
        { return input_class_def.intersects_class (glyphs, p.first) &&
3826
36
           coverage_glyph_classes.has (p.first) &&
3827
31
           p.second.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&>) const
3828
62
    | hb_any
3829
371
    ;
3830
371
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3796
371
  {
3797
371
    if (!(this+coverage).intersects (glyphs))
3798
309
      return false;
3799
3800
62
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3801
62
    const ClassDef &input_class_def = this+inputClassDef;
3802
62
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3803
3804
62
    hb_map_t caches[3] = {};
3805
62
    struct ChainContextClosureLookupContext lookup_context = {
3806
62
      {intersects_class, nullptr},
3807
62
      ContextFormat::ClassBasedContext,
3808
62
      {&backtrack_class_def,
3809
62
       &input_class_def,
3810
62
       &lookahead_class_def},
3811
62
      {&caches[0], &caches[1], &caches[2]}
3812
62
    };
3813
3814
62
    hb_set_t retained_coverage_glyphs;
3815
62
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3816
3817
62
    hb_set_t coverage_glyph_classes;
3818
62
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3819
3820
62
    return
3821
62
    + hb_iter (ruleSet)
3822
62
    | hb_map (hb_add (this))
3823
62
    | hb_enumerate
3824
62
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
3825
62
        { return input_class_def.intersects_class (glyphs, p.first) &&
3826
62
           coverage_glyph_classes.has (p.first) &&
3827
62
           p.second.intersects (glyphs, lookup_context); })
3828
62
    | hb_any
3829
371
    ;
3830
371
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
3831
3832
  bool may_have_non_1to1 () const
3833
0
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
3834
3835
  void closure (hb_closure_context_t *c) const
3836
230
  {
3837
230
    if (!(this+coverage).intersects (c->glyphs))
3838
178
      return;
3839
3840
52
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3841
52
    if (unlikely (!cur_active_glyphs)) return;
3842
52
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3843
52
           *cur_active_glyphs);
3844
3845
52
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3846
52
    const ClassDef &input_class_def = this+inputClassDef;
3847
52
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3848
3849
52
    hb_map_t caches[3] = {};
3850
52
    intersected_class_cache_t intersected_cache;
3851
52
    struct ChainContextClosureLookupContext lookup_context = {
3852
52
      {intersects_class, intersected_class_glyphs},
3853
52
      ContextFormat::ClassBasedContext,
3854
52
      {&backtrack_class_def,
3855
52
       &input_class_def,
3856
52
       &lookahead_class_def},
3857
52
      {&caches[0], &caches[1], &caches[2]},
3858
52
      &intersected_cache
3859
52
    };
3860
3861
52
    + hb_enumerate (ruleSet)
3862
52
    | hb_filter ([&] (unsigned _)
3863
58
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3863
58
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
3864
52
     hb_first)
3865
52
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
3866
52
                {
3867
25
                  const ChainRuleSet& chainrule_set = this+_.second;
3868
25
                  chainrule_set.closure (c, _.first, lookup_context);
3869
25
                })
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) const
Line
Count
Source
3866
25
                {
3867
25
                  const ChainRuleSet& chainrule_set = this+_.second;
3868
25
                  chainrule_set.closure (c, _.first, lookup_context);
3869
25
                })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const
3870
52
    ;
3871
3872
52
    c->pop_cur_done_glyphs ();
3873
52
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3836
230
  {
3837
230
    if (!(this+coverage).intersects (c->glyphs))
3838
178
      return;
3839
3840
52
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3841
52
    if (unlikely (!cur_active_glyphs)) return;
3842
52
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3843
52
           *cur_active_glyphs);
3844
3845
52
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3846
52
    const ClassDef &input_class_def = this+inputClassDef;
3847
52
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3848
3849
52
    hb_map_t caches[3] = {};
3850
52
    intersected_class_cache_t intersected_cache;
3851
52
    struct ChainContextClosureLookupContext lookup_context = {
3852
52
      {intersects_class, intersected_class_glyphs},
3853
52
      ContextFormat::ClassBasedContext,
3854
52
      {&backtrack_class_def,
3855
52
       &input_class_def,
3856
52
       &lookahead_class_def},
3857
52
      {&caches[0], &caches[1], &caches[2]},
3858
52
      &intersected_cache
3859
52
    };
3860
3861
52
    + hb_enumerate (ruleSet)
3862
52
    | hb_filter ([&] (unsigned _)
3863
52
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
3864
52
     hb_first)
3865
52
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
3866
52
                {
3867
52
                  const ChainRuleSet& chainrule_set = this+_.second;
3868
52
                  chainrule_set.closure (c, _.first, lookup_context);
3869
52
                })
3870
52
    ;
3871
3872
52
    c->pop_cur_done_glyphs ();
3873
52
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
3874
3875
  void closure_lookups (hb_closure_lookups_context_t *c) const
3876
26
  {
3877
26
    if (!(this+coverage).intersects (c->glyphs))
3878
0
      return;
3879
3880
26
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3881
26
    const ClassDef &input_class_def = this+inputClassDef;
3882
26
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3883
3884
26
    hb_map_t caches[3] = {};
3885
26
    struct ChainContextClosureLookupContext lookup_context = {
3886
26
      {intersects_class, nullptr},
3887
26
      ContextFormat::ClassBasedContext,
3888
26
      {&backtrack_class_def,
3889
26
       &input_class_def,
3890
26
       &lookahead_class_def},
3891
26
      {&caches[0], &caches[1], &caches[2]}
3892
26
    };
3893
3894
26
    + hb_iter (ruleSet)
3895
26
    | hb_map (hb_add (this))
3896
26
    | hb_enumerate
3897
26
    | hb_filter([&] (unsigned klass)
3898
26
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3898
26
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
3899
26
    | hb_map (hb_second)
3900
26
    | hb_apply ([&] (const ChainRuleSet &_)
3901
26
    { _.closure_lookups (c, lookup_context); })
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3901
13
    { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
3902
26
    ;
3903
26
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3876
26
  {
3877
26
    if (!(this+coverage).intersects (c->glyphs))
3878
0
      return;
3879
3880
26
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3881
26
    const ClassDef &input_class_def = this+inputClassDef;
3882
26
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3883
3884
26
    hb_map_t caches[3] = {};
3885
26
    struct ChainContextClosureLookupContext lookup_context = {
3886
26
      {intersects_class, nullptr},
3887
26
      ContextFormat::ClassBasedContext,
3888
26
      {&backtrack_class_def,
3889
26
       &input_class_def,
3890
26
       &lookahead_class_def},
3891
26
      {&caches[0], &caches[1], &caches[2]}
3892
26
    };
3893
3894
26
    + hb_iter (ruleSet)
3895
26
    | hb_map (hb_add (this))
3896
26
    | hb_enumerate
3897
26
    | hb_filter([&] (unsigned klass)
3898
26
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
3899
26
    | hb_map (hb_second)
3900
26
    | hb_apply ([&] (const ChainRuleSet &_)
3901
26
    { _.closure_lookups (c, lookup_context); })
3902
26
    ;
3903
26
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
3904
3905
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
3906
3907
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3908
0
  {
3909
0
    (this+coverage).collect_coverage (c->input);
3910
3911
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3912
0
    const ClassDef &input_class_def = this+inputClassDef;
3913
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3914
3915
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
3916
0
      {collect_class},
3917
0
      {&backtrack_class_def,
3918
0
       &input_class_def,
3919
0
       &lookahead_class_def}
3920
0
    };
3921
3922
0
    + hb_iter (ruleSet)
3923
0
    | hb_map (hb_add (this))
3924
0
    | hb_apply ([&] (const ChainRuleSet &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
3925
0
    ;
3926
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
3927
3928
  bool would_apply (hb_would_apply_context_t *c) const
3929
0
  {
3930
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3931
0
    const ClassDef &input_class_def = this+inputClassDef;
3932
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3933
3934
0
    unsigned int index = input_class_def.get_class (c->glyphs[0]);
3935
0
    const ChainRuleSet &rule_set = this+ruleSet[index];
3936
0
    struct ChainContextApplyLookupContext lookup_context = {
3937
0
      {{match_class, match_class, match_class}},
3938
0
      {&backtrack_class_def,
3939
0
       &input_class_def,
3940
0
       &lookahead_class_def}
3941
0
    };
3942
0
    return rule_set.would_apply (c, lookup_context);
3943
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
3944
3945
52
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3945
52
  const Coverage &get_coverage () const { return this+coverage; }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
3946
3947
  unsigned cache_cost () const
3948
0
  {
3949
0
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
3950
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
3951
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
3952
0
  {
3953
0
    return context_cache_func (c, op);
3954
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
3955
3956
  struct external_cache_t
3957
  {
3958
    hb_ot_layout_binary_cache_t coverage;
3959
  };
3960
  void *external_cache_create () const
3961
0
  {
3962
0
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
3963
0
    if (likely (cache))
3964
0
    {
3965
0
      cache->coverage.clear ();
3966
0
    }
3967
0
    return cache;
3968
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
3969
0
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
3970
0
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
3971
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
3972
0
  {
3973
0
    TRACE_APPLY (this);
3974
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
3975
0
    external_cache_t *cache = (external_cache_t *) external_cache;
3976
0
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
3977
#else
3978
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3979
#endif
3980
0
    if (index == NOT_COVERED) return_trace (false);
3981
3982
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3983
0
    const ClassDef &input_class_def = this+inputClassDef;
3984
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3985
3986
    /* match_class_caches1 is slightly faster. Use it for lookahead,
3987
     * which is typically longer. */
3988
0
    struct ChainContextApplyLookupContext lookup_context = {
3989
0
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
3990
0
        cached ? match_class_cached2 : match_class,
3991
0
        cached ? match_class_cached1 : match_class}},
3992
0
      {&backtrack_class_def,
3993
0
       &input_class_def,
3994
0
       &lookahead_class_def}
3995
0
    };
3996
3997
0
    index = cached
3998
0
         ? get_class_cached2 (input_class_def, c->buffer->cur())
3999
0
          : input_class_def.get_class (c->buffer->cur().codepoint);
4000
0
    const ChainRuleSet &rule_set = this+ruleSet[index];
4001
0
    return_trace (rule_set.apply (c, lookup_context));
4002
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
4003
4004
  bool subset (hb_subset_context_t *c) const
4005
2
  {
4006
2
    TRACE_SUBSET (this);
4007
2
    auto *out = c->serializer->start_embed (*this);
4008
2
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4009
2
    out->format = format;
4010
2
    out->coverage.serialize_subset (c, coverage, this);
4011
4012
2
    hb_map_t backtrack_klass_map;
4013
2
    hb_map_t input_klass_map;
4014
2
    hb_map_t lookahead_klass_map;
4015
4016
2
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
4017
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
4018
2
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
4019
2
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
4020
4021
2
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
4022
2
               input_klass_map,
4023
2
               lookahead_klass_map)))
4024
0
      return_trace (false);
4025
4026
2
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
4027
2
    hb_set_t retained_coverage_glyphs;
4028
2
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
4029
4030
2
    hb_set_t coverage_glyph_classes;
4031
2
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
4032
4033
2
    int non_zero_index = -1, index = 0;
4034
2
    bool ret = true;
4035
2
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4036
2
    auto last_non_zero = c->serializer->snapshot ();
4037
2
    for (const auto& _ : + hb_enumerate (ruleSet)
4038
2
       | hb_filter (input_klass_map, hb_first))
4039
2
    {
4040
2
      auto *o = out->ruleSet.serialize_append (c->serializer);
4041
2
      if (unlikely (!o))
4042
0
      {
4043
0
  ret = false;
4044
0
  break;
4045
0
      }
4046
2
      if (coverage_glyph_classes.has (_.first) &&
4047
2
          o->serialize_subset (c, _.second, this,
4048
2
             lookup_map,
4049
2
             &backtrack_klass_map,
4050
2
             &input_klass_map,
4051
2
             &lookahead_klass_map))
4052
2
      {
4053
2
        last_non_zero = c->serializer->snapshot ();
4054
2
  non_zero_index = index;
4055
2
      }
4056
4057
2
      index++;
4058
2
    }
4059
4060
2
    if (!ret || non_zero_index == -1) return_trace (false);
4061
4062
    // prune empty trailing ruleSets
4063
2
    if (index > non_zero_index) {
4064
2
      c->serializer->revert (last_non_zero);
4065
2
      out->ruleSet.len = non_zero_index + 1;
4066
2
    }
4067
4068
2
    return_trace (bool (out->ruleSet));
4069
2
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
4005
2
  {
4006
2
    TRACE_SUBSET (this);
4007
2
    auto *out = c->serializer->start_embed (*this);
4008
2
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4009
2
    out->format = format;
4010
2
    out->coverage.serialize_subset (c, coverage, this);
4011
4012
2
    hb_map_t backtrack_klass_map;
4013
2
    hb_map_t input_klass_map;
4014
2
    hb_map_t lookahead_klass_map;
4015
4016
2
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
4017
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
4018
2
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
4019
2
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
4020
4021
2
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
4022
2
               input_klass_map,
4023
2
               lookahead_klass_map)))
4024
0
      return_trace (false);
4025
4026
2
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
4027
2
    hb_set_t retained_coverage_glyphs;
4028
2
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
4029
4030
2
    hb_set_t coverage_glyph_classes;
4031
2
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
4032
4033
2
    int non_zero_index = -1, index = 0;
4034
2
    bool ret = true;
4035
2
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4036
2
    auto last_non_zero = c->serializer->snapshot ();
4037
2
    for (const auto& _ : + hb_enumerate (ruleSet)
4038
2
       | hb_filter (input_klass_map, hb_first))
4039
2
    {
4040
2
      auto *o = out->ruleSet.serialize_append (c->serializer);
4041
2
      if (unlikely (!o))
4042
0
      {
4043
0
  ret = false;
4044
0
  break;
4045
0
      }
4046
2
      if (coverage_glyph_classes.has (_.first) &&
4047
2
          o->serialize_subset (c, _.second, this,
4048
2
             lookup_map,
4049
2
             &backtrack_klass_map,
4050
2
             &input_klass_map,
4051
2
             &lookahead_klass_map))
4052
2
      {
4053
2
        last_non_zero = c->serializer->snapshot ();
4054
2
  non_zero_index = index;
4055
2
      }
4056
4057
2
      index++;
4058
2
    }
4059
4060
2
    if (!ret || non_zero_index == -1) return_trace (false);
4061
4062
    // prune empty trailing ruleSets
4063
2
    if (index > non_zero_index) {
4064
2
      c->serializer->revert (last_non_zero);
4065
2
      out->ruleSet.len = non_zero_index + 1;
4066
2
    }
4067
4068
2
    return_trace (bool (out->ruleSet));
4069
2
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
4070
4071
  bool sanitize (hb_sanitize_context_t *c) const
4072
1.25k
  {
4073
1.25k
    TRACE_SANITIZE (this);
4074
1.25k
    return_trace (coverage.sanitize (c, this) &&
4075
1.25k
      backtrackClassDef.sanitize (c, this) &&
4076
1.25k
      inputClassDef.sanitize (c, this) &&
4077
1.25k
      lookaheadClassDef.sanitize (c, this) &&
4078
1.25k
      ruleSet.sanitize (c, this));
4079
1.25k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4072
1.11k
  {
4073
1.11k
    TRACE_SANITIZE (this);
4074
1.11k
    return_trace (coverage.sanitize (c, this) &&
4075
1.11k
      backtrackClassDef.sanitize (c, this) &&
4076
1.11k
      inputClassDef.sanitize (c, this) &&
4077
1.11k
      lookaheadClassDef.sanitize (c, this) &&
4078
1.11k
      ruleSet.sanitize (c, this));
4079
1.11k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4072
140
  {
4073
140
    TRACE_SANITIZE (this);
4074
140
    return_trace (coverage.sanitize (c, this) &&
4075
140
      backtrackClassDef.sanitize (c, this) &&
4076
140
      inputClassDef.sanitize (c, this) &&
4077
140
      lookaheadClassDef.sanitize (c, this) &&
4078
140
      ruleSet.sanitize (c, this));
4079
140
  }
4080
4081
  protected:
4082
  HBUINT16  format;     /* Format identifier--format = 2 */
4083
  typename Types::template OffsetTo<Coverage>
4084
    coverage;   /* Offset to Coverage table--from
4085
           * beginning of table */
4086
  typename Types::template OffsetTo<ClassDef>
4087
    backtrackClassDef;  /* Offset to glyph ClassDef table
4088
           * containing backtrack sequence
4089
           * data--from beginning of table */
4090
  typename Types::template OffsetTo<ClassDef>
4091
    inputClassDef;    /* Offset to glyph ClassDef
4092
           * table containing input sequence
4093
           * data--from beginning of table */
4094
  typename Types::template OffsetTo<ClassDef>
4095
    lookaheadClassDef;  /* Offset to glyph ClassDef table
4096
           * containing lookahead sequence
4097
           * data--from beginning of table */
4098
  Array16Of<typename Types::template OffsetTo<ChainRuleSet>>
4099
    ruleSet;    /* Array of ChainRuleSet tables
4100
           * ordered by class */
4101
  public:
4102
  DEFINE_SIZE_ARRAY (4 + 4 * Types::size, ruleSet);
4103
};
4104
4105
struct ChainContextFormat3
4106
{
4107
  using RuleSet = OT::RuleSet<SmallTypes>;
4108
4109
  bool intersects (const hb_set_t *glyphs) const
4110
8.48k
  {
4111
8.48k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4112
4113
8.48k
    if (!(this+input[0]).intersects (glyphs))
4114
7.60k
      return false;
4115
4116
874
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4117
874
    struct ChainContextClosureLookupContext lookup_context = {
4118
874
      {intersects_coverage, nullptr},
4119
874
      ContextFormat::CoverageBasedContext,
4120
874
      {this, this, this}
4121
874
    };
4122
874
    return chain_context_intersects (glyphs,
4123
874
             backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4124
874
             input.len, (const HBUINT16 *) input.arrayZ + 1,
4125
874
             lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4126
874
             lookup_context);
4127
8.48k
  }
4128
4129
  bool may_have_non_1to1 () const
4130
2
  { return true; }
4131
4132
  void closure (hb_closure_context_t *c) const
4133
4.86k
  {
4134
4.86k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4135
4136
4.86k
    if (!(this+input[0]).intersects (c->glyphs))
4137
4.24k
      return;
4138
4139
622
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
4140
622
    if (unlikely (!cur_active_glyphs))
4141
0
      return;
4142
622
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
4143
622
           *cur_active_glyphs);
4144
4145
622
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4146
622
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4147
622
    struct ChainContextClosureLookupContext lookup_context = {
4148
622
      {intersects_coverage, intersected_coverage_glyphs},
4149
622
      ContextFormat::CoverageBasedContext,
4150
622
      {this, this, this}
4151
622
    };
4152
622
    chain_context_closure_lookup (c,
4153
622
          backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4154
622
          input.len, (const HBUINT16 *) input.arrayZ + 1,
4155
622
          lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4156
622
          lookup.len, lookup.arrayZ,
4157
622
          0, lookup_context);
4158
4159
622
    c->pop_cur_done_glyphs ();
4160
622
  }
4161
4162
  void closure_lookups (hb_closure_lookups_context_t *c) const
4163
304
  {
4164
304
    if (!intersects (c->glyphs))
4165
118
      return;
4166
4167
186
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4168
186
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4169
186
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4170
186
    recurse_lookups (c, lookup.len, lookup.arrayZ);
4171
186
  }
4172
4173
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
4174
4175
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
4176
0
  {
4177
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4178
4179
0
    (this+input[0]).collect_coverage (c->input);
4180
4181
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4182
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4183
4184
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
4185
0
      {collect_coverage},
4186
0
      {this, this, this}
4187
0
    };
4188
0
    chain_context_collect_glyphs_lookup (c,
4189
0
           backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4190
0
           input.len, (const HBUINT16 *) input.arrayZ + 1,
4191
0
           lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4192
0
           lookup.len, lookup.arrayZ,
4193
0
           lookup_context);
4194
0
  }
4195
4196
  bool would_apply (hb_would_apply_context_t *c) const
4197
0
  {
4198
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4199
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4200
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4201
0
    struct ChainContextApplyLookupContext lookup_context = {
4202
0
      {{match_coverage, match_coverage, match_coverage}},
4203
0
      {this, this, this}
4204
0
    };
4205
0
    return chain_context_would_apply_lookup (c,
4206
0
               backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4207
0
               input.len, (const HBUINT16 *) input.arrayZ + 1,
4208
0
               lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4209
0
               lookup.len, lookup.arrayZ, lookup_context);
4210
0
  }
4211
4212
  const Coverage &get_coverage () const
4213
622
  {
4214
622
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4215
622
    return this+input[0];
4216
622
  }
4217
4218
  bool apply (hb_ot_apply_context_t *c) const
4219
0
  {
4220
0
    TRACE_APPLY (this);
4221
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4222
4223
0
    unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
4224
0
    if (index == NOT_COVERED) return_trace (false);
4225
4226
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4227
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4228
0
    struct ChainContextApplyLookupContext lookup_context = {
4229
0
      {{match_coverage, match_coverage, match_coverage}},
4230
0
      {this, this, this}
4231
0
    };
4232
0
    return_trace (chain_context_apply_lookup (c,
4233
0
                backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4234
0
                input.len, (const HBUINT16 *) input.arrayZ + 1,
4235
0
                lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4236
0
                lookup.len, lookup.arrayZ, lookup_context));
4237
0
  }
4238
4239
  template<typename Iterator,
4240
     hb_requires (hb_is_iterator (Iterator))>
4241
  bool serialize_coverage_offsets (hb_subset_context_t *c, Iterator it, const void* base) const
4242
450
  {
4243
450
    TRACE_SERIALIZE (this);
4244
450
    auto *out = c->serializer->start_embed<Array16OfOffset16To<Coverage>> ();
4245
4246
450
    if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size)))
4247
0
      return_trace (false);
4248
4249
450
    for (auto& offset : it) {
4250
251
      auto *o = out->serialize_append (c->serializer);
4251
251
      if (unlikely (!o) || !o->serialize_subset (c, offset, base))
4252
0
        return_trace (false);
4253
251
    }
4254
4255
450
    return_trace (true);
4256
450
  }
4257
4258
  bool subset (hb_subset_context_t *c) const
4259
150
  {
4260
150
    TRACE_SUBSET (this);
4261
4262
150
    if (unlikely (!c->serializer->embed (this->format))) return_trace (false);
4263
4264
150
    if (!serialize_coverage_offsets (c, backtrack.iter (), this))
4265
0
      return_trace (false);
4266
4267
150
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4268
150
    if (!serialize_coverage_offsets (c, input.iter (), this))
4269
0
      return_trace (false);
4270
4271
150
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4272
150
    if (!serialize_coverage_offsets (c, lookahead.iter (), this))
4273
0
      return_trace (false);
4274
4275
150
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4276
150
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4277
4278
150
    HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookup.len);
4279
150
    if (!lookupCount) return_trace (false);
4280
4281
150
    unsigned count = serialize_lookuprecord_array (c->serializer, lookup.as_array (), lookup_map);
4282
150
    return_trace (c->serializer->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
4283
150
  }
4284
4285
  bool sanitize (hb_sanitize_context_t *c) const
4286
14.8k
  {
4287
14.8k
    TRACE_SANITIZE (this);
4288
14.8k
    if (unlikely (!backtrack.sanitize (c, this))) return_trace (false);
4289
14.8k
    hb_barrier ();
4290
14.8k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4291
14.8k
    if (unlikely (!input.sanitize (c, this))) return_trace (false);
4292
14.7k
    hb_barrier ();
4293
14.7k
    if (unlikely (!input.len)) return_trace (false); /* To be consistent with Context. */
4294
14.7k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4295
14.7k
    if (unlikely (!lookahead.sanitize (c, this))) return_trace (false);
4296
14.7k
    hb_barrier ();
4297
14.7k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4298
14.7k
    return_trace (likely (lookup.sanitize (c)));
4299
14.7k
  }
4300
4301
  protected:
4302
  HBUINT16  format;     /* Format identifier--format = 3 */
4303
  Array16OfOffset16To<Coverage>
4304
    backtrack;    /* Array of coverage tables
4305
           * in backtracking sequence, in  glyph
4306
           * sequence order */
4307
  Array16OfOffset16To<Coverage>
4308
    inputX    ; /* Array of coverage
4309
           * tables in input sequence, in glyph
4310
           * sequence order */
4311
  Array16OfOffset16To<Coverage>
4312
    lookaheadX;   /* Array of coverage tables
4313
           * in lookahead sequence, in glyph
4314
           * sequence order */
4315
  Array16Of<LookupRecord>
4316
    lookupX;    /* Array of LookupRecords--in
4317
           * design order) */
4318
  public:
4319
  DEFINE_SIZE_MIN (10);
4320
};
4321
4322
struct ChainContext
4323
{
4324
  template <typename context_t, typename ...Ts>
4325
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4326
53.4k
  {
4327
53.4k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
53.3k
    TRACE_DISPATCH (this, u.format.v);
4329
53.3k
    switch (u.format.v) {
4330
5.69k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
1.74k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
28.3k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
495
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
140
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
16.9k
    default:return_trace (c->default_return_value ());
4338
53.3k
    }
4339
53.3k
  }
OT::hb_intersects_context_t::return_t OT::ChainContext::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4326
10.9k
  {
4327
10.9k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
10.9k
    TRACE_DISPATCH (this, u.format.v);
4329
10.9k
    switch (u.format.v) {
4330
1.58k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
371
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
8.17k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
772
    default:return_trace (c->default_return_value ());
4338
10.9k
    }
4339
10.9k
  }
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ChainContext::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::ChainContext::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
OT::hb_closure_lookups_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
4326
397
  {
4327
397
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
397
    TRACE_DISPATCH (this, u.format.v);
4329
397
    switch (u.format.v) {
4330
59
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
26
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
304
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
8
    default:return_trace (c->default_return_value ());
4338
397
    }
4339
397
  }
hb_subset_context_t::return_t OT::ChainContext::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
Line
Count
Source
4326
236
  {
4327
236
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
236
    TRACE_DISPATCH (this, u.format.v);
4329
236
    switch (u.format.v) {
4330
84
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
2
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
150
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
0
    default:return_trace (c->default_return_value ());
4338
236
    }
4339
236
  }
hb_sanitize_context_t::return_t OT::ChainContext::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4326
35.5k
  {
4327
35.5k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
35.4k
    TRACE_DISPATCH (this, u.format.v);
4329
35.4k
    switch (u.format.v) {
4330
3.65k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
1.11k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
14.8k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
495
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
140
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
15.2k
    default:return_trace (c->default_return_value ());
4338
35.4k
    }
4339
35.4k
  }
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::ChainContext::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::ChainContext::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
OT::hb_have_non_1to1_context_t::return_t OT::ChainContext::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Line
Count
Source
4326
200
  {
4327
200
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
200
    TRACE_DISPATCH (this, u.format.v);
4329
200
    switch (u.format.v) {
4330
16
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
0
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
2
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
182
    default:return_trace (c->default_return_value ());
4338
200
    }
4339
200
  }
OT::hb_closure_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
4326
6.15k
  {
4327
6.15k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4328
6.15k
    TRACE_DISPATCH (this, u.format.v);
4329
6.15k
    switch (u.format.v) {
4330
296
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4331
230
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4332
4.86k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4333
0
#ifndef HB_NO_BEYOND_64K
4334
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4335
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4336
0
#endif
4337
763
    default:return_trace (c->default_return_value ());
4338
6.15k
    }
4339
6.15k
  }
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::ChainContext::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::ChainContext::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
4340
4341
  protected:
4342
  union {
4343
  struct { HBUINT16 v; }    format; /* Format identifier */
4344
  ChainContextFormat1_4<SmallTypes> format1;
4345
  ChainContextFormat2_5<SmallTypes> format2;
4346
  ChainContextFormat3     format3;
4347
#ifndef HB_NO_BEYOND_64K
4348
  ChainContextFormat1_4<MediumTypes>  format4;
4349
  ChainContextFormat2_5<MediumTypes>  format5;
4350
#endif
4351
  } u;
4352
};
4353
4354
4355
template <typename T>
4356
struct ExtensionFormat1
4357
{
4358
53.6k
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
4358
4.17k
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
4358
49.4k
  unsigned int get_type () const { return extensionLookupType; }
4359
4360
  template <typename X>
4361
  const X& get_subtable () const
4362
36.1k
  { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }
OT::Layout::GPOS_impl::PosLookupSubTable const& OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_subtable<OT::Layout::GPOS_impl::PosLookupSubTable>() const
Line
Count
Source
4362
2.52k
  { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }
OT::Layout::GSUB_impl::SubstLookupSubTable const& OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_subtable<OT::Layout::GSUB_impl::SubstLookupSubTable>() const
Line
Count
Source
4362
33.6k
  { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }
4363
4364
  template <typename context_t, typename ...Ts>
4365
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4366
36.1k
  {
4367
36.1k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
36.1k
    TRACE_DISPATCH (this, format);
4369
36.1k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
36.1k
  }
OT::hb_intersects_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4366
558
  {
4367
558
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
558
    TRACE_DISPATCH (this, format);
4369
558
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
558
  }
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::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::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
OT::hb_closure_lookups_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
4366
132
  {
4367
132
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
132
    TRACE_DISPATCH (this, format);
4369
132
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
132
  }
hb_sanitize_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4366
1.73k
  {
4367
1.73k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
1.73k
    TRACE_DISPATCH (this, format);
4369
1.73k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
1.73k
  }
OT::hb_collect_variation_indices_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const
Line
Count
Source
4366
102
  {
4367
102
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
102
    TRACE_DISPATCH (this, format);
4369
102
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
102
  }
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
OT::hb_intersects_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4366
9.24k
  {
4367
9.24k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
9.24k
    TRACE_DISPATCH (this, format);
4369
9.24k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
9.24k
  }
hb_sanitize_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4366
19.4k
  {
4367
19.4k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
19.4k
    TRACE_DISPATCH (this, format);
4369
19.4k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
19.4k
  }
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const
OT::hb_closure_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
4366
4.94k
  {
4367
4.94k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
4.94k
    TRACE_DISPATCH (this, format);
4369
4.94k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
4.94k
  }
OT::hb_closure_lookups_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
4366
5
  {
4367
5
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4368
5
    TRACE_DISPATCH (this, format);
4369
5
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4370
5
  }
Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::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
4371
4372
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
4373
  { dispatch (c); }
4374
4375
  /* This is called from may_dispatch() above with hb_sanitize_context_t. */
4376
  bool sanitize (hb_sanitize_context_t *c) const
4377
21.1k
  {
4378
21.1k
    TRACE_SANITIZE (this);
4379
21.1k
    return_trace (c->check_struct (this) &&
4380
21.1k
      hb_barrier () &&
4381
21.1k
      extensionLookupType != T::SubTable::Extension);
4382
21.1k
  }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4377
1.73k
  {
4378
1.73k
    TRACE_SANITIZE (this);
4379
1.73k
    return_trace (c->check_struct (this) &&
4380
1.73k
      hb_barrier () &&
4381
1.73k
      extensionLookupType != T::SubTable::Extension);
4382
1.73k
  }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4377
19.4k
  {
4378
19.4k
    TRACE_SANITIZE (this);
4379
19.4k
    return_trace (c->check_struct (this) &&
4380
19.4k
      hb_barrier () &&
4381
19.4k
      extensionLookupType != T::SubTable::Extension);
4382
19.4k
  }
4383
4384
  bool subset (hb_subset_context_t *c) const
4385
59
  {
4386
59
    TRACE_SUBSET (this);
4387
4388
59
    auto *out = c->serializer->start_embed (this);
4389
59
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4390
4391
59
    out->format = format;
4392
59
    out->extensionLookupType = extensionLookupType;
4393
4394
59
    const auto& src_offset =
4395
59
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4396
59
    auto& dest_offset =
4397
59
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4398
4399
59
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4400
59
  }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::subset(hb_subset_context_t*) const
Line
Count
Source
4385
55
  {
4386
55
    TRACE_SUBSET (this);
4387
4388
55
    auto *out = c->serializer->start_embed (this);
4389
55
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4390
4391
55
    out->format = format;
4392
55
    out->extensionLookupType = extensionLookupType;
4393
4394
55
    const auto& src_offset =
4395
55
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4396
55
    auto& dest_offset =
4397
55
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4398
4399
55
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4400
55
  }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::subset(hb_subset_context_t*) const
Line
Count
Source
4385
4
  {
4386
4
    TRACE_SUBSET (this);
4387
4388
4
    auto *out = c->serializer->start_embed (this);
4389
4
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4390
4391
4
    out->format = format;
4392
4
    out->extensionLookupType = extensionLookupType;
4393
4394
4
    const auto& src_offset =
4395
4
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4396
4
    auto& dest_offset =
4397
4
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4398
4399
4
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4400
4
  }
4401
4402
  protected:
4403
  HBUINT16  format;     /* Format identifier. Set to 1. */
4404
  HBUINT16  extensionLookupType;  /* Lookup type of subtable referenced
4405
           * by ExtensionOffset (i.e. the
4406
           * extension subtable). */
4407
  Offset32  extensionOffset;  /* Offset to the extension subtable,
4408
           * of lookup type subtable. */
4409
  public:
4410
  DEFINE_SIZE_STATIC (8);
4411
};
4412
4413
template <typename T>
4414
struct Extension
4415
{
4416
  unsigned int get_type () const
4417
20.3k
  {
4418
20.3k
    switch (u.format.v) {
4419
17.4k
    case 1: hb_barrier (); return u.format1.get_type ();
4420
2.90k
    default:return 0;
4421
20.3k
    }
4422
20.3k
  }
OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
4417
3.12k
  {
4418
3.12k
    switch (u.format.v) {
4419
1.59k
    case 1: hb_barrier (); return u.format1.get_type ();
4420
1.52k
    default:return 0;
4421
3.12k
    }
4422
3.12k
  }
OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
4417
17.2k
  {
4418
17.2k
    switch (u.format.v) {
4419
15.8k
    case 1: hb_barrier (); return u.format1.get_type ();
4420
1.37k
    default:return 0;
4421
17.2k
    }
4422
17.2k
  }
4423
  template <typename X>
4424
  const X& get_subtable () const
4425
  {
4426
    switch (u.format.v) {
4427
    case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> ();
4428
    default:return Null (typename T::SubTable);
4429
    }
4430
  }
4431
4432
  // Specialization of dispatch for subset. dispatch() normally just
4433
  // dispatches to the sub table this points too, but for subset
4434
  // we need to run subset on this subtable too.
4435
  template <typename ...Ts>
4436
  typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const
4437
59
  {
4438
59
    switch (u.format.v) {
4439
59
    case 1: hb_barrier (); return u.format1.subset (c);
4440
0
    default: return c->default_return_value ();
4441
59
    }
4442
59
  }
bool OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<>(hb_subset_context_t*) const
Line
Count
Source
4437
55
  {
4438
55
    switch (u.format.v) {
4439
55
    case 1: hb_barrier (); return u.format1.subset (c);
4440
0
    default: return c->default_return_value ();
4441
55
    }
4442
55
  }
bool OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<>(hb_subset_context_t*) const
Line
Count
Source
4437
4
  {
4438
4
    switch (u.format.v) {
4439
4
    case 1: hb_barrier (); return u.format1.subset (c);
4440
0
    default: return c->default_return_value ();
4441
4
    }
4442
4
  }
4443
4444
  template <typename context_t, typename ...Ts>
4445
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4446
83.0k
  {
4447
83.0k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
82.9k
    TRACE_DISPATCH (this, u.format.v);
4449
82.9k
    switch (u.format.v) {
4450
36.1k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
46.8k
    default:return_trace (c->default_return_value ());
4452
82.9k
    }
4453
82.9k
  }
OT::hb_intersects_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4446
598
  {
4447
598
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
598
    TRACE_DISPATCH (this, u.format.v);
4449
598
    switch (u.format.v) {
4450
558
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
40
    default:return_trace (c->default_return_value ());
4452
598
    }
4453
598
  }
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::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::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
OT::hb_closure_lookups_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
4446
132
  {
4447
132
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
132
    TRACE_DISPATCH (this, u.format.v);
4449
132
    switch (u.format.v) {
4450
132
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
0
    default:return_trace (c->default_return_value ());
4452
132
    }
4453
132
  }
hb_sanitize_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4446
2.79k
  {
4447
2.79k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
2.76k
    TRACE_DISPATCH (this, u.format.v);
4449
2.76k
    switch (u.format.v) {
4450
1.73k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
1.03k
    default:return_trace (c->default_return_value ());
4452
2.76k
    }
4453
2.76k
  }
OT::hb_collect_variation_indices_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const
Line
Count
Source
4446
102
  {
4447
102
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
102
    TRACE_DISPATCH (this, u.format.v);
4449
102
    switch (u.format.v) {
4450
102
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
0
    default:return_trace (c->default_return_value ());
4452
102
    }
4453
102
  }
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
OT::hb_intersects_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4446
9.47k
  {
4447
9.47k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
9.47k
    TRACE_DISPATCH (this, u.format.v);
4449
9.47k
    switch (u.format.v) {
4450
9.24k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
237
    default:return_trace (c->default_return_value ());
4452
9.47k
    }
4453
9.47k
  }
hb_sanitize_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4446
64.7k
  {
4447
64.7k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
64.6k
    TRACE_DISPATCH (this, u.format.v);
4449
64.6k
    switch (u.format.v) {
4450
19.4k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
45.2k
    default:return_trace (c->default_return_value ());
4452
64.6k
    }
4453
64.6k
  }
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const
OT::hb_closure_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
4446
5.22k
  {
4447
5.22k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
5.22k
    TRACE_DISPATCH (this, u.format.v);
4449
5.22k
    switch (u.format.v) {
4450
4.94k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
282
    default:return_trace (c->default_return_value ());
4452
5.22k
    }
4453
5.22k
  }
OT::hb_closure_lookups_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
4446
5
  {
4447
5
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4448
5
    TRACE_DISPATCH (this, u.format.v);
4449
5
    switch (u.format.v) {
4450
5
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4451
0
    default:return_trace (c->default_return_value ());
4452
5
    }
4453
5
  }
Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::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
4454
4455
  protected:
4456
  union {
4457
  struct { HBUINT16 v; }  format;   /* Format identifier */
4458
  ExtensionFormat1<T> format1;
4459
  } u;
4460
};
4461
4462
4463
/*
4464
 * GSUB/GPOS Common
4465
 */
4466
4467
struct hb_ot_layout_lookup_accelerator_t
4468
{
4469
  template <typename TLookup>
4470
  static hb_ot_layout_lookup_accelerator_t *create (const TLookup &lookup)
4471
0
  {
4472
0
    unsigned count = lookup.get_subtable_count ();
4473
4474
0
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
4475
0
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
4476
0
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
4477
4478
    /* The following is a calloc because when we are collecting subtables,
4479
     * some of them might be invalid and hence not collect; as a result,
4480
     * we might not fill in all the count entries of the subtables array.
4481
     * Zeroing it allows the set digest to gatekeep it without having to
4482
     * initialize it further. */
4483
0
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
4484
0
    if (unlikely (!thiz))
4485
0
      return nullptr;
4486
4487
0
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
4488
0
    lookup.dispatch (&c_accelerate_subtables);
4489
4490
0
    thiz->digest.init ();
4491
0
    for (auto& subtable : hb_iter (thiz->subtables, count))
4492
0
      thiz->digest.union_ (subtable.digest);
4493
4494
0
    thiz->count = count;
4495
4496
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4497
0
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
4498
4499
0
    for (unsigned i = 0; i < count; i++)
4500
0
      if (i != thiz->subtable_cache_user_idx)
4501
0
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
4502
0
#endif
4503
4504
0
    return thiz;
4505
0
  }
Unexecuted instantiation: OT::hb_ot_layout_lookup_accelerator_t* OT::hb_ot_layout_lookup_accelerator_t::create<OT::Layout::GPOS_impl::PosLookup>(OT::Layout::GPOS_impl::PosLookup const&)
Unexecuted instantiation: OT::hb_ot_layout_lookup_accelerator_t* OT::hb_ot_layout_lookup_accelerator_t::create<OT::Layout::GSUB_impl::SubstLookup>(OT::Layout::GSUB_impl::SubstLookup const&)
4506
4507
  void fini ()
4508
0
  {
4509
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4510
0
    for (unsigned i = 0; i < count; i++)
4511
0
      hb_free (subtables[i].external_cache);
4512
0
#endif
4513
0
  }
4514
4515
  bool may_have (hb_codepoint_t g) const
4516
0
  { return digest.may_have (g); }
4517
4518
#ifndef HB_OPTIMIZE_SIZE
4519
  HB_ALWAYS_INLINE
4520
#endif
4521
  bool apply (hb_ot_apply_context_t *c, bool use_cache) const
4522
0
  {
4523
0
    c->lookup_accel = this;
4524
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4525
0
    if (use_cache)
4526
0
    {
4527
0
      return
4528
0
      + hb_iter (hb_iter (subtables, count))
4529
0
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply_cached (c); })
4530
0
      | hb_any
4531
0
      ;
4532
0
    }
4533
0
    else
4534
0
#endif
4535
0
    {
4536
0
      return
4537
0
      + hb_iter (hb_iter (subtables, count))
4538
0
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply (c); })
4539
0
      | hb_any
4540
0
      ;
4541
0
    }
4542
0
    return false;
4543
0
  }
4544
4545
  bool cache_enter (hb_ot_apply_context_t *c) const
4546
0
  {
4547
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4548
0
    return subtable_cache_user_idx != (unsigned) -1 &&
4549
0
     subtables[subtable_cache_user_idx].cache_enter (c);
4550
#else
4551
    return false;
4552
#endif
4553
0
  }
4554
  void cache_leave (hb_ot_apply_context_t *c) const
4555
0
  {
4556
0
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4557
0
    subtables[subtable_cache_user_idx].cache_leave (c);
4558
0
#endif
4559
0
  }
4560
4561
4562
  hb_set_digest_t digest;
4563
  private:
4564
  unsigned count = 0; /* Number of subtables in the array. */
4565
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4566
  unsigned subtable_cache_user_idx = (unsigned) -1;
4567
#endif
4568
  hb_accelerate_subtables_context_t::hb_applicable_t subtables[HB_VAR_ARRAY];
4569
};
4570
4571
template <typename Types>
4572
struct GSUBGPOSVersion1_2
4573
{
4574
  friend struct GSUBGPOS;
4575
4576
  protected:
4577
  FixedVersion<>version;  /* Version of the GSUB/GPOS table--initially set
4578
         * to 0x00010000u */
4579
  typename Types:: template OffsetTo<ScriptList>
4580
    scriptList; /* ScriptList table */
4581
  typename Types::template OffsetTo<FeatureList>
4582
    featureList;  /* FeatureList table */
4583
  typename Types::template OffsetTo<LookupList<Types>>
4584
    lookupList; /* LookupList table */
4585
  Offset32To<FeatureVariations>
4586
    featureVars;  /* Offset to Feature Variations
4587
           table--from beginning of table
4588
         * (may be NULL).  Introduced
4589
         * in version 0x00010001. */
4590
  public:
4591
  DEFINE_SIZE_MIN (4 + 3 * Types::size);
4592
4593
  unsigned int get_size () const
4594
2.72k
  {
4595
2.72k
    return min_size +
4596
2.72k
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0);
4597
2.72k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::get_size() const
Line
Count
Source
4594
2.72k
  {
4595
2.72k
    return min_size +
4596
2.72k
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0);
4597
2.72k
  }
Unexecuted instantiation: OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::get_size() const
4598
4599
  const typename Types::template OffsetTo<LookupList<Types>>* get_lookup_list_offset () const
4600
5.44k
  {
4601
5.44k
    return &lookupList;
4602
5.44k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::get_lookup_list_offset() const
Line
Count
Source
4600
5.44k
  {
4601
5.44k
    return &lookupList;
4602
5.44k
  }
Unexecuted instantiation: OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::get_lookup_list_offset() const
4603
4604
  template <typename TLookup>
4605
  bool sanitize (hb_sanitize_context_t *c) const
4606
24.6k
  {
4607
24.6k
    TRACE_SANITIZE (this);
4608
24.6k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4609
24.6k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4610
24.6k
        featureList.sanitize (c, this) &&
4611
24.6k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4612
9.92k
      return_trace (false);
4613
4614
14.7k
#ifndef HB_NO_VAR
4615
14.7k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4616
684
      return_trace (false);
4617
14.0k
#endif
4618
4619
14.7k
    return_trace (true);
4620
14.7k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4606
11.3k
  {
4607
11.3k
    TRACE_SANITIZE (this);
4608
11.3k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4609
11.3k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4610
11.3k
        featureList.sanitize (c, this) &&
4611
11.3k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4612
4.63k
      return_trace (false);
4613
4614
6.72k
#ifndef HB_NO_VAR
4615
6.72k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4616
312
      return_trace (false);
4617
6.40k
#endif
4618
4619
6.40k
    return_trace (true);
4620
6.72k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4606
280
  {
4607
280
    TRACE_SANITIZE (this);
4608
280
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4609
280
    if (unlikely (!(scriptList.sanitize (c, this) &&
4610
280
        featureList.sanitize (c, this) &&
4611
280
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4612
185
      return_trace (false);
4613
4614
95
#ifndef HB_NO_VAR
4615
95
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4616
45
      return_trace (false);
4617
50
#endif
4618
4619
50
    return_trace (true);
4620
95
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4606
12.7k
  {
4607
12.7k
    TRACE_SANITIZE (this);
4608
12.7k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4609
12.7k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4610
12.7k
        featureList.sanitize (c, this) &&
4611
12.7k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4612
4.91k
      return_trace (false);
4613
4614
7.83k
#ifndef HB_NO_VAR
4615
7.83k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4616
300
      return_trace (false);
4617
7.53k
#endif
4618
4619
7.53k
    return_trace (true);
4620
7.83k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4606
246
  {
4607
246
    TRACE_SANITIZE (this);
4608
246
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4609
246
    if (unlikely (!(scriptList.sanitize (c, this) &&
4610
246
        featureList.sanitize (c, this) &&
4611
246
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4612
192
      return_trace (false);
4613
4614
54
#ifndef HB_NO_VAR
4615
54
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4616
27
      return_trace (false);
4617
27
#endif
4618
4619
27
    return_trace (true);
4620
54
  }
4621
4622
  template <typename TLookup>
4623
  bool subset (hb_subset_layout_context_t *c) const
4624
10.0k
  {
4625
10.0k
    TRACE_SUBSET (this);
4626
4627
10.0k
    auto *out = c->subset_context->serializer->start_embed (this);
4628
10.0k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4629
4630
10.0k
    out->version = version;
4631
4632
10.0k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4633
10.0k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4634
10.0k
  .serialize_subset (c->subset_context,
4635
10.0k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4636
10.0k
         this,
4637
10.0k
         c);
4638
4639
10.0k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4640
10.0k
  .serialize_subset (c->subset_context,
4641
10.0k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4642
10.0k
         this,
4643
10.0k
         c);
4644
4645
10.0k
    out->scriptList.serialize_subset (c->subset_context,
4646
10.0k
              scriptList,
4647
10.0k
              this,
4648
10.0k
              c);
4649
4650
10.0k
#ifndef HB_NO_VAR
4651
10.0k
    if (version.to_int () >= 0x00010001u)
4652
357
    {
4653
357
      auto snapshot = c->subset_context->serializer->snapshot ();
4654
357
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4655
48
        return_trace (false);
4656
4657
      // if all axes are pinned all feature vars are dropped.
4658
309
      bool ret = !c->subset_context->plan->all_axes_pinned
4659
309
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4660
309
      if (!ret && version.major == 1)
4661
93
      {
4662
93
        c->subset_context->serializer->revert (snapshot);
4663
93
  out->version.major = 1;
4664
93
  out->version.minor = 0;
4665
93
      }
4666
309
    }
4667
9.98k
#endif
4668
4669
10.0k
    return_trace (true);
4670
10.0k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4624
4.23k
  {
4625
4.23k
    TRACE_SUBSET (this);
4626
4627
4.23k
    auto *out = c->subset_context->serializer->start_embed (this);
4628
4.23k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4629
4630
4.23k
    out->version = version;
4631
4632
4.23k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4633
4.23k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4634
4.23k
  .serialize_subset (c->subset_context,
4635
4.23k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4636
4.23k
         this,
4637
4.23k
         c);
4638
4639
4.23k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4640
4.23k
  .serialize_subset (c->subset_context,
4641
4.23k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4642
4.23k
         this,
4643
4.23k
         c);
4644
4645
4.23k
    out->scriptList.serialize_subset (c->subset_context,
4646
4.23k
              scriptList,
4647
4.23k
              this,
4648
4.23k
              c);
4649
4650
4.23k
#ifndef HB_NO_VAR
4651
4.23k
    if (version.to_int () >= 0x00010001u)
4652
25
    {
4653
25
      auto snapshot = c->subset_context->serializer->snapshot ();
4654
25
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4655
0
        return_trace (false);
4656
4657
      // if all axes are pinned all feature vars are dropped.
4658
25
      bool ret = !c->subset_context->plan->all_axes_pinned
4659
25
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4660
25
      if (!ret && version.major == 1)
4661
25
      {
4662
25
        c->subset_context->serializer->revert (snapshot);
4663
25
  out->version.major = 1;
4664
25
  out->version.minor = 0;
4665
25
      }
4666
25
    }
4667
4.23k
#endif
4668
4669
4.23k
    return_trace (true);
4670
4.23k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4624
24
  {
4625
24
    TRACE_SUBSET (this);
4626
4627
24
    auto *out = c->subset_context->serializer->start_embed (this);
4628
24
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4629
4630
24
    out->version = version;
4631
4632
24
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4633
24
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4634
24
  .serialize_subset (c->subset_context,
4635
24
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4636
24
         this,
4637
24
         c);
4638
4639
24
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4640
24
  .serialize_subset (c->subset_context,
4641
24
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4642
24
         this,
4643
24
         c);
4644
4645
24
    out->scriptList.serialize_subset (c->subset_context,
4646
24
              scriptList,
4647
24
              this,
4648
24
              c);
4649
4650
24
#ifndef HB_NO_VAR
4651
24
    if (version.to_int () >= 0x00010001u)
4652
24
    {
4653
24
      auto snapshot = c->subset_context->serializer->snapshot ();
4654
24
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4655
0
        return_trace (false);
4656
4657
      // if all axes are pinned all feature vars are dropped.
4658
24
      bool ret = !c->subset_context->plan->all_axes_pinned
4659
24
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4660
24
      if (!ret && version.major == 1)
4661
0
      {
4662
0
        c->subset_context->serializer->revert (snapshot);
4663
0
  out->version.major = 1;
4664
0
  out->version.minor = 0;
4665
0
      }
4666
24
    }
4667
24
#endif
4668
4669
24
    return_trace (true);
4670
24
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4624
5.75k
  {
4625
5.75k
    TRACE_SUBSET (this);
4626
4627
5.75k
    auto *out = c->subset_context->serializer->start_embed (this);
4628
5.75k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4629
4630
5.75k
    out->version = version;
4631
4632
5.75k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4633
5.75k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4634
5.75k
  .serialize_subset (c->subset_context,
4635
5.75k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4636
5.75k
         this,
4637
5.75k
         c);
4638
4639
5.75k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4640
5.75k
  .serialize_subset (c->subset_context,
4641
5.75k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4642
5.75k
         this,
4643
5.75k
         c);
4644
4645
5.75k
    out->scriptList.serialize_subset (c->subset_context,
4646
5.75k
              scriptList,
4647
5.75k
              this,
4648
5.75k
              c);
4649
4650
5.75k
#ifndef HB_NO_VAR
4651
5.75k
    if (version.to_int () >= 0x00010001u)
4652
294
    {
4653
294
      auto snapshot = c->subset_context->serializer->snapshot ();
4654
294
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4655
48
        return_trace (false);
4656
4657
      // if all axes are pinned all feature vars are dropped.
4658
246
      bool ret = !c->subset_context->plan->all_axes_pinned
4659
246
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4660
246
      if (!ret && version.major == 1)
4661
68
      {
4662
68
        c->subset_context->serializer->revert (snapshot);
4663
68
  out->version.major = 1;
4664
68
  out->version.minor = 0;
4665
68
      }
4666
246
    }
4667
5.70k
#endif
4668
4669
5.70k
    return_trace (true);
4670
5.75k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4624
14
  {
4625
14
    TRACE_SUBSET (this);
4626
4627
14
    auto *out = c->subset_context->serializer->start_embed (this);
4628
14
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4629
4630
14
    out->version = version;
4631
4632
14
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4633
14
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4634
14
  .serialize_subset (c->subset_context,
4635
14
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4636
14
         this,
4637
14
         c);
4638
4639
14
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4640
14
  .serialize_subset (c->subset_context,
4641
14
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4642
14
         this,
4643
14
         c);
4644
4645
14
    out->scriptList.serialize_subset (c->subset_context,
4646
14
              scriptList,
4647
14
              this,
4648
14
              c);
4649
4650
14
#ifndef HB_NO_VAR
4651
14
    if (version.to_int () >= 0x00010001u)
4652
14
    {
4653
14
      auto snapshot = c->subset_context->serializer->snapshot ();
4654
14
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4655
0
        return_trace (false);
4656
4657
      // if all axes are pinned all feature vars are dropped.
4658
14
      bool ret = !c->subset_context->plan->all_axes_pinned
4659
14
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4660
14
      if (!ret && version.major == 1)
4661
0
      {
4662
0
        c->subset_context->serializer->revert (snapshot);
4663
0
  out->version.major = 1;
4664
0
  out->version.minor = 0;
4665
0
      }
4666
14
    }
4667
14
#endif
4668
4669
14
    return_trace (true);
4670
14
  }
4671
};
4672
4673
struct GSUBGPOS
4674
{
4675
  unsigned int get_size () const
4676
2.72k
  {
4677
2.72k
    switch (u.version.major) {
4678
2.72k
    case 1: hb_barrier (); return u.version1.get_size ();
4679
0
#ifndef HB_NO_BEYOND_64K
4680
0
    case 2: hb_barrier (); return u.version2.get_size ();
4681
0
#endif
4682
0
    default: return u.version.static_size;
4683
2.72k
    }
4684
2.72k
  }
4685
4686
  template <typename TLookup>
4687
  bool sanitize (hb_sanitize_context_t *c) const
4688
29.8k
  {
4689
29.8k
    TRACE_SANITIZE (this);
4690
29.8k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4691
29.7k
    hb_barrier ();
4692
29.7k
    switch (u.version.major) {
4693
24.1k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4694
0
#ifndef HB_NO_BEYOND_64K
4695
526
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4696
0
#endif
4697
5.16k
    default: return_trace (true);
4698
29.7k
    }
4699
29.7k
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4688
15.7k
  {
4689
15.7k
    TRACE_SANITIZE (this);
4690
15.7k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4691
15.7k
    hb_barrier ();
4692
15.7k
    switch (u.version.major) {
4693
11.3k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4694
0
#ifndef HB_NO_BEYOND_64K
4695
280
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4696
0
#endif
4697
4.07k
    default: return_trace (true);
4698
15.7k
    }
4699
15.7k
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4688
14.1k
  {
4689
14.1k
    TRACE_SANITIZE (this);
4690
14.1k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4691
14.0k
    hb_barrier ();
4692
14.0k
    switch (u.version.major) {
4693
12.7k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4694
0
#ifndef HB_NO_BEYOND_64K
4695
246
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4696
0
#endif
4697
1.09k
    default: return_trace (true);
4698
14.0k
    }
4699
14.0k
  }
4700
4701
  template <typename TLookup>
4702
  bool subset (hb_subset_layout_context_t *c) const
4703
12.6k
  {
4704
12.6k
    switch (u.version.major) {
4705
9.99k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4706
0
#ifndef HB_NO_BEYOND_64K
4707
38
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4708
0
#endif
4709
2.64k
    default: return false;
4710
12.6k
    }
4711
12.6k
  }
bool OT::GSUBGPOS::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4703
6.53k
  {
4704
6.53k
    switch (u.version.major) {
4705
4.23k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4706
0
#ifndef HB_NO_BEYOND_64K
4707
24
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4708
0
#endif
4709
2.28k
    default: return false;
4710
6.53k
    }
4711
6.53k
  }
bool OT::GSUBGPOS::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4703
6.13k
  {
4704
6.13k
    switch (u.version.major) {
4705
5.75k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4706
0
#ifndef HB_NO_BEYOND_64K
4707
14
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4708
0
#endif
4709
369
    default: return false;
4710
6.13k
    }
4711
6.13k
  }
4712
4713
  const ScriptList &get_script_list () const
4714
245k
  {
4715
245k
    switch (u.version.major) {
4716
86.7k
    case 1: hb_barrier (); return this+u.version1.scriptList;
4717
0
#ifndef HB_NO_BEYOND_64K
4718
243
    case 2: hb_barrier (); return this+u.version2.scriptList;
4719
0
#endif
4720
158k
    default: return Null (ScriptList);
4721
245k
    }
4722
245k
  }
4723
  const FeatureList &get_feature_list () const
4724
1.22M
  {
4725
1.22M
    switch (u.version.major) {
4726
1.09M
    case 1: hb_barrier (); return this+u.version1.featureList;
4727
0
#ifndef HB_NO_BEYOND_64K
4728
200
    case 2: hb_barrier (); return this+u.version2.featureList;
4729
0
#endif
4730
130k
    default: return Null (FeatureList);
4731
1.22M
    }
4732
1.22M
  }
4733
  unsigned int get_lookup_count () const
4734
29.0k
  {
4735
29.0k
    switch (u.version.major) {
4736
7.27k
    case 1: hb_barrier (); return (this+u.version1.lookupList).len;
4737
0
#ifndef HB_NO_BEYOND_64K
4738
27
    case 2: hb_barrier (); return (this+u.version2.lookupList).len;
4739
0
#endif
4740
21.7k
    default: return 0;
4741
29.0k
    }
4742
29.0k
  }
4743
  const Lookup& get_lookup (unsigned int i) const
4744
5.39M
  {
4745
5.39M
    switch (u.version.major) {
4746
5.39M
    case 1: hb_barrier (); return (this+u.version1.lookupList)[i];
4747
0
#ifndef HB_NO_BEYOND_64K
4748
0
    case 2: hb_barrier (); return (this+u.version2.lookupList)[i];
4749
0
#endif
4750
0
    default: return Null (Lookup);
4751
5.39M
    }
4752
5.39M
  }
4753
  const FeatureVariations &get_feature_variations () const
4754
99.6k
  {
4755
99.6k
    switch (u.version.major) {
4756
18.0k
    case 1: hb_barrier (); return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations));
4757
0
#ifndef HB_NO_BEYOND_64K
4758
96
    case 2: hb_barrier (); return this+u.version2.featureVars;
4759
0
#endif
4760
81.4k
    default: return Null (FeatureVariations);
4761
99.6k
    }
4762
99.6k
  }
4763
4764
1.00k
  bool has_data () const { return u.version.to_int (); }
4765
  unsigned int get_script_count () const
4766
146k
  { return get_script_list ().len; }
4767
  const Tag& get_script_tag (unsigned int i) const
4768
16.8k
  { return get_script_list ().get_tag (i); }
4769
  unsigned int get_script_tags (unsigned int start_offset,
4770
        unsigned int *script_count /* IN/OUT */,
4771
        hb_tag_t     *script_tags /* OUT */) const
4772
48.8k
  { return get_script_list ().get_tags (start_offset, script_count, script_tags); }
4773
  const Script& get_script (unsigned int i) const
4774
33.7k
  { return get_script_list ()[i]; }
4775
  bool find_script_index (hb_tag_t tag, unsigned int *index) const
4776
0
  { return get_script_list ().find_index (tag, index); }
4777
4778
  unsigned int get_feature_count () const
4779
121k
  { return get_feature_list ().len; }
4780
  hb_tag_t get_feature_tag (unsigned int i) const
4781
371k
  { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : get_feature_list ().get_tag (i); }
4782
  unsigned int get_feature_tags (unsigned int start_offset,
4783
         unsigned int *feature_count /* IN/OUT */,
4784
         hb_tag_t     *feature_tags /* OUT */) const
4785
48.8k
  { return get_feature_list ().get_tags (start_offset, feature_count, feature_tags); }
4786
  const Feature& get_feature (unsigned int i) const
4787
682k
  { return get_feature_list ()[i]; }
4788
  bool find_feature_index (hb_tag_t tag, unsigned int *index) const
4789
0
  { return get_feature_list ().find_index (tag, index); }
4790
4791
  bool find_variations_index (const int *coords, unsigned int num_coords,
4792
            unsigned int *index,
4793
            ItemVarStoreInstancer *instancer) const
4794
0
  {
4795
#ifdef HB_NO_VAR
4796
    *index = FeatureVariations::NOT_FOUND_INDEX;
4797
    return false;
4798
#endif
4799
0
    return get_feature_variations ().find_index (coords, num_coords, index, instancer);
4800
0
  }
4801
  const Feature& get_feature_variation (unsigned int feature_index,
4802
          unsigned int variations_index) const
4803
0
  {
4804
0
#ifndef HB_NO_VAR
4805
0
    if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
4806
0
  u.version.to_int () >= 0x00010001u)
4807
0
    {
4808
0
      const Feature *feature = get_feature_variations ().find_substitute (variations_index,
4809
0
                    feature_index);
4810
0
      if (feature)
4811
0
  return *feature;
4812
0
    }
4813
0
#endif
4814
0
    return get_feature (feature_index);
4815
0
  }
4816
4817
  void feature_variation_collect_lookups (const hb_set_t *feature_indexes,
4818
            const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map,
4819
            hb_set_t       *lookup_indexes /* OUT */) const
4820
48.2k
  {
4821
48.2k
#ifndef HB_NO_VAR
4822
48.2k
    get_feature_variations ().collect_lookups (feature_indexes, feature_record_cond_idx_map, lookup_indexes);
4823
48.2k
#endif
4824
48.2k
  }
4825
4826
#ifndef HB_NO_VAR
4827
  void collect_feature_substitutes_with_variations (hb_collect_feature_substitutes_with_var_context_t *c) const
4828
2.25k
  { get_feature_variations ().collect_feature_substitutes_with_variations (c); }
4829
#endif
4830
4831
  template <typename TLookup>
4832
  void closure_lookups (hb_face_t      *face,
4833
      const hb_set_t *glyphs,
4834
      hb_set_t       *lookup_indexes /* IN/OUT */) const
4835
49.1k
  {
4836
49.1k
    hb_set_t visited_lookups, inactive_lookups;
4837
49.1k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4838
4839
49.1k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4840
4841
49.1k
    for (unsigned lookup_index : *lookup_indexes)
4842
1.50M
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4843
4844
49.1k
    hb_set_union (lookup_indexes, &visited_lookups);
4845
49.1k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4846
49.1k
  }
void OT::GSUBGPOS::closure_lookups<OT::Layout::GPOS_impl::PosLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const
Line
Count
Source
4835
24.5k
  {
4836
24.5k
    hb_set_t visited_lookups, inactive_lookups;
4837
24.5k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4838
4839
24.5k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4840
4841
24.5k
    for (unsigned lookup_index : *lookup_indexes)
4842
437k
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4843
4844
24.5k
    hb_set_union (lookup_indexes, &visited_lookups);
4845
24.5k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4846
24.5k
  }
void OT::GSUBGPOS::closure_lookups<OT::Layout::GSUB_impl::SubstLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const
Line
Count
Source
4835
24.5k
  {
4836
24.5k
    hb_set_t visited_lookups, inactive_lookups;
4837
24.5k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4838
4839
24.5k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4840
4841
24.5k
    for (unsigned lookup_index : *lookup_indexes)
4842
1.06M
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4843
4844
24.5k
    hb_set_union (lookup_indexes, &visited_lookups);
4845
24.5k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4846
24.5k
  }
4847
4848
  void prune_langsys (const hb_map_t *duplicate_feature_map,
4849
                      const hb_set_t *layout_scripts,
4850
                      hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map,
4851
                      hb_set_t       *new_feature_indexes /* OUT */) const
4852
49.1k
  {
4853
49.1k
    hb_prune_langsys_context_t c (this, script_langsys_map, duplicate_feature_map, new_feature_indexes);
4854
4855
49.1k
    unsigned count = get_script_count ();
4856
65.9k
    for (unsigned script_index = 0; script_index < count; script_index++)
4857
16.8k
    {
4858
16.8k
      const Tag& tag = get_script_tag (script_index);
4859
16.8k
      if (!layout_scripts->has (tag)) continue;
4860
16.8k
      const Script& s = get_script (script_index);
4861
16.8k
      s.prune_langsys (&c, script_index);
4862
16.8k
    }
4863
49.1k
  }
4864
4865
  void prune_features (const hb_map_t *lookup_indices, /* IN */
4866
           const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map, /* IN */
4867
           const hb_hashmap_t<unsigned, const Feature*> *feature_substitutes_map, /* IN */
4868
           hb_set_t       *feature_indices /* IN/OUT */) const
4869
49.1k
  {
4870
49.1k
#ifndef HB_NO_VAR
4871
    // This is the set of feature indices which have alternate versions defined
4872
    // if the FeatureVariation's table and the alternate version(s) intersect the
4873
    // set of lookup indices.
4874
49.1k
    hb_set_t alternate_feature_indices;
4875
49.1k
    get_feature_variations ().closure_features (lookup_indices, feature_record_cond_idx_map, &alternate_feature_indices);
4876
49.1k
    if (unlikely (alternate_feature_indices.in_error()))
4877
10
    {
4878
10
      feature_indices->err ();
4879
10
      return;
4880
10
    }
4881
49.1k
#endif
4882
4883
49.1k
    for (unsigned i : hb_iter (feature_indices))
4884
330k
    {
4885
330k
      hb_tag_t tag =  get_feature_tag (i);
4886
330k
      if (tag == HB_TAG ('p', 'r', 'e', 'f'))
4887
        // Note: Never ever drop feature 'pref', even if it's empty.
4888
        // HarfBuzz chooses shaper for Khmer based on presence of this
4889
        // feature. See thread at:
4890
  // http://lists.freedesktop.org/archives/harfbuzz/2012-November/002660.html
4891
36
        continue;
4892
4893
4894
330k
      const Feature *f = &(get_feature (i));
4895
330k
      const Feature** p = nullptr;
4896
330k
      if (feature_substitutes_map->has (i, &p))
4897
0
        f = *p;
4898
4899
330k
      if (!f->featureParams.is_null () &&
4900
4.95k
          tag == HB_TAG ('s', 'i', 'z', 'e'))
4901
0
        continue;
4902
4903
330k
      if (!f->intersects_lookup_indexes (lookup_indices)
4904
323k
#ifndef HB_NO_VAR
4905
323k
          && !alternate_feature_indices.has (i)
4906
330k
#endif
4907
330k
    )
4908
323k
  feature_indices->del (i);
4909
330k
    }
4910
49.1k
  }
4911
4912
  void collect_name_ids (const hb_map_t *feature_index_map,
4913
                         hb_set_t *nameids_to_retain /* OUT */) const
4914
49.1k
  {
4915
49.1k
    unsigned count = get_feature_count ();
4916
75.8k
    for (unsigned i = 0 ; i < count; i++)
4917
26.7k
    {
4918
26.7k
      if (!feature_index_map->has (i)) continue;
4919
6.65k
      hb_tag_t tag = get_feature_tag (i);
4920
6.65k
      get_feature (i).collect_name_ids (tag, nameids_to_retain);
4921
6.65k
    }
4922
49.1k
  }
4923
4924
  template <typename T>
4925
  struct accelerator_t
4926
  {
4927
    accelerator_t (hb_face_t *face)
4928
26.4k
    {
4929
26.4k
      hb_sanitize_context_t sc;
4930
26.4k
      sc.lazy_some_gpos = true;
4931
26.4k
      this->table = sc.reference_table<T> (face);
4932
4933
26.4k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4934
0
      {
4935
0
  hb_blob_destroy (this->table.get_blob ());
4936
0
  this->table = hb_blob_get_empty ();
4937
0
      }
4938
4939
26.4k
      this->lookup_count = table->get_lookup_count ();
4940
4941
26.4k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4942
26.4k
      if (unlikely (!this->accels))
4943
214
      {
4944
214
  this->lookup_count = 0;
4945
214
  this->table.destroy ();
4946
214
  this->table = hb_blob_get_empty ();
4947
214
      }
4948
26.4k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::accelerator_t(hb_face_t*)
Line
Count
Source
4928
13.3k
    {
4929
13.3k
      hb_sanitize_context_t sc;
4930
13.3k
      sc.lazy_some_gpos = true;
4931
13.3k
      this->table = sc.reference_table<T> (face);
4932
4933
13.3k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4934
0
      {
4935
0
  hb_blob_destroy (this->table.get_blob ());
4936
0
  this->table = hb_blob_get_empty ();
4937
0
      }
4938
4939
13.3k
      this->lookup_count = table->get_lookup_count ();
4940
4941
13.3k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4942
13.3k
      if (unlikely (!this->accels))
4943
114
      {
4944
114
  this->lookup_count = 0;
4945
114
  this->table.destroy ();
4946
114
  this->table = hb_blob_get_empty ();
4947
114
      }
4948
13.3k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::accelerator_t(hb_face_t*)
Line
Count
Source
4928
13.0k
    {
4929
13.0k
      hb_sanitize_context_t sc;
4930
13.0k
      sc.lazy_some_gpos = true;
4931
13.0k
      this->table = sc.reference_table<T> (face);
4932
4933
13.0k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4934
0
      {
4935
0
  hb_blob_destroy (this->table.get_blob ());
4936
0
  this->table = hb_blob_get_empty ();
4937
0
      }
4938
4939
13.0k
      this->lookup_count = table->get_lookup_count ();
4940
4941
13.0k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4942
13.0k
      if (unlikely (!this->accels))
4943
100
      {
4944
100
  this->lookup_count = 0;
4945
100
  this->table.destroy ();
4946
100
  this->table = hb_blob_get_empty ();
4947
100
      }
4948
13.0k
    }
4949
    ~accelerator_t ()
4950
26.4k
    {
4951
53.3k
      for (unsigned int i = 0; i < this->lookup_count; i++)
4952
26.8k
      {
4953
26.8k
  auto *accel = this->accels[i].get_relaxed ();
4954
26.8k
  if (accel)
4955
0
    accel->fini ();
4956
26.8k
  hb_free (accel);
4957
26.8k
      }
4958
26.4k
      hb_free (this->accels);
4959
26.4k
      this->table.destroy ();
4960
26.4k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::~accelerator_t()
Line
Count
Source
4950
13.3k
    {
4951
30.9k
      for (unsigned int i = 0; i < this->lookup_count; i++)
4952
17.5k
      {
4953
17.5k
  auto *accel = this->accels[i].get_relaxed ();
4954
17.5k
  if (accel)
4955
0
    accel->fini ();
4956
17.5k
  hb_free (accel);
4957
17.5k
      }
4958
13.3k
      hb_free (this->accels);
4959
13.3k
      this->table.destroy ();
4960
13.3k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::~accelerator_t()
Line
Count
Source
4950
13.0k
    {
4951
22.4k
      for (unsigned int i = 0; i < this->lookup_count; i++)
4952
9.34k
      {
4953
9.34k
  auto *accel = this->accels[i].get_relaxed ();
4954
9.34k
  if (accel)
4955
0
    accel->fini ();
4956
9.34k
  hb_free (accel);
4957
9.34k
      }
4958
13.0k
      hb_free (this->accels);
4959
13.0k
      this->table.destroy ();
4960
13.0k
    }
4961
4962
0
    hb_blob_t *get_blob () const { return table.get_blob (); }
Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_blob() const
Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_blob() const
4963
4964
    hb_ot_layout_lookup_accelerator_t *get_accel (unsigned lookup_index) const
4965
0
    {
4966
0
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
4967
4968
0
    retry:
4969
0
      auto *accel = accels[lookup_index].get_acquire ();
4970
0
      if (unlikely (!accel))
4971
0
      {
4972
0
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
4973
0
  if (unlikely (!accel))
4974
0
    return nullptr;
4975
4976
0
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
4977
0
  {
4978
0
    accel->fini ();
4979
0
    hb_free (accel);
4980
0
    goto retry;
4981
0
  }
4982
0
      }
4983
4984
0
      return accel;
4985
0
    }
Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_accel(unsigned int) const
Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_accel(unsigned int) const
4986
4987
    hb_blob_ptr_t<T> table;
4988
    unsigned int lookup_count;
4989
    hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *accels;
4990
  };
4991
4992
  protected:
4993
  union {
4994
  FixedVersion<>      version;  /* Version identifier */
4995
  GSUBGPOSVersion1_2<SmallTypes>  version1;
4996
#ifndef HB_NO_BEYOND_64K
4997
  GSUBGPOSVersion1_2<MediumTypes> version2;
4998
#endif
4999
  } u;
5000
  public:
5001
  DEFINE_SIZE_MIN (4);
5002
};
5003
5004
5005
} /* namespace OT */
5006
5007
5008
#endif /* HB_OT_LAYOUT_GSUBGPOS_HH */