Coverage Report

Created: 2026-06-09 06:09

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
182k
  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
6.38k
  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.16k
  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
6.96k
  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
4.23k
  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
633
  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
669
  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
8.92k
  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
6.58k
  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
474
  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
3.77k
  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
168
  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
2.20k
  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
451
  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
3.90k
  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
3.55k
  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
2.64k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
1.03k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
634
  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
3.22k
  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
2.99k
  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
31.3k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
1.24k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
48
859
  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::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
48
16.8k
  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
10.2k
  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
524
  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
9.34k
  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
8.33k
  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
887
  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
10.0k
  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.93k
  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
10.4k
  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
927
  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
12.4k
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
49
12.4M
  static return_t default_return_value () { return false; }
50
9.48M
  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
3.15M
                            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
37.6k
  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
16.6k
  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
7.28k
  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::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
62
2
  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::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
62
6.16k
  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
3.41k
  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::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
62
76
  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::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
448
  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::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
62
884
  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::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
559
  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::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
96
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
21
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
62
252
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
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
58
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
62
13
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
62
337
  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
1.40k
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
63
1.26M
  static return_t default_return_value () { return false; }
64
956k
  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
316k
  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
59.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::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
45.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::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
1.63k
  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
46.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::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
72
20.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::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
1.50k
  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
24.2k
  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
13.8k
  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
15.4k
  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
865
  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
4.74k
  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
3.34k
  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
6.95k
  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::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
798
  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::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
485
  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
4.71k
  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
1.85k
  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
47.5k
  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::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
782
  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::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
72
405
  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::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
72
16.1k
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
73
23.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
6.96M
  {
76
6.96M
    if (unlikely (nesting_level_left == 0 || !recurse_func))
77
0
      return;
78
79
6.96M
    nesting_level_left--;
80
6.96M
    recurse_func (this, lookup_index, covered_seq_indicies, seq_index, end_index);
81
6.96M
    nesting_level_left++;
82
6.96M
  }
83
84
  void reset_lookup_visit_count ()
85
57.1k
  { lookup_count = 0; }
86
87
  bool lookup_limit_exceeded ()
88
701k
  { return lookup_count > HB_MAX_LOOKUP_VISIT_COUNT; }
89
90
  bool should_visit_lookup (unsigned int lookup_index)
91
12.1M
  {
92
12.1M
    if (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT)
93
1.92M
      return false;
94
95
10.1M
    if (is_lookup_done (lookup_index))
96
5.55M
      return false;
97
98
4.63M
    return true;
99
10.1M
  }
100
101
  bool is_lookup_done (unsigned int lookup_index)
102
10.1M
  {
103
10.1M
    if (unlikely (done_lookups_glyph_count->in_error () ||
104
10.1M
      done_lookups_glyph_set->in_error ()))
105
10.5k
      return true;
106
107
    /* Have we visited this lookup with the current set of glyphs? */
108
10.1M
    if (done_lookups_glyph_count->get (lookup_index) != glyphs->get_population ())
109
4.59M
    {
110
4.59M
      done_lookups_glyph_count->set (lookup_index, glyphs->get_population ());
111
112
4.59M
      if (!done_lookups_glyph_set->has (lookup_index))
113
1.25M
      {
114
1.25M
  if (unlikely (!done_lookups_glyph_set->set (lookup_index, hb::unique_ptr<hb_set_t> {hb_set_create ()})))
115
63
    return true;
116
1.25M
      }
117
118
4.59M
      done_lookups_glyph_set->get (lookup_index)->clear ();
119
4.59M
    }
120
121
10.1M
    hb_set_t *covered_glyph_set = done_lookups_glyph_set->get (lookup_index);
122
10.1M
    if (unlikely (covered_glyph_set->in_error ()))
123
9.45k
      return true;
124
10.1M
    if (parent_active_glyphs ().is_subset (*covered_glyph_set))
125
5.53M
      return true;
126
127
4.63M
    covered_glyph_set->union_ (parent_active_glyphs ());
128
4.63M
    return false;
129
10.1M
  }
130
131
65.3k
  const hb_set_t& previous_parent_active_glyphs () {
132
65.3k
    if (active_glyphs_stack.length <= 1)
133
63.2k
      return *glyphs;
134
135
2.08k
    return active_glyphs_stack[active_glyphs_stack.length - 2];
136
65.3k
  }
137
138
  const hb_set_t& parent_active_glyphs ()
139
15.1M
  {
140
15.1M
    if (!active_glyphs_stack)
141
9.57M
      return *glyphs;
142
143
5.55M
    return active_glyphs_stack.tail ();
144
15.1M
  }
145
146
  hb_set_t* push_cur_active_glyphs ()
147
7.01M
  {
148
7.01M
    hb_set_t *s = active_glyphs_stack.push ();
149
7.01M
    if (unlikely (active_glyphs_stack.in_error ()))
150
152
      return nullptr;
151
7.01M
    return s;
152
7.01M
  }
153
154
  bool pop_cur_done_glyphs ()
155
7.01M
  {
156
7.01M
    if (!active_glyphs_stack)
157
0
      return false;
158
159
7.01M
    active_glyphs_stack.pop ();
160
7.01M
    return true;
161
7.01M
  }
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
31.7k
        face (face_),
176
31.7k
        glyphs (glyphs_),
177
31.7k
        nesting_level_left (nesting_level_left_),
178
31.7k
        done_lookups_glyph_count (done_lookups_glyph_count_),
179
31.7k
        done_lookups_glyph_set (done_lookups_glyph_set_)
180
31.7k
  {}
181
182
31.7k
  ~hb_closure_context_t () { flush (); }
183
184
4.27M
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
185
186
  void flush ()
187
4.30M
  {
188
4.30M
    output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID);  /* Remove invalid glyphs. */
189
4.30M
    glyphs->union_ (*output);
190
4.30M
    output->clear ();
191
4.30M
    active_glyphs_stack.pop ();
192
4.30M
    active_glyphs_stack.reset ();
193
4.30M
  }
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
75.2k
  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
2.95k
  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.36k
  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
2.52k
  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
1.83k
  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
182
  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
329
  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
4.56k
  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
2.09k
  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
192
  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
2.24k
  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::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
103
  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::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
893
  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
218
  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
1.50k
  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
1.67k
  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
1.06k
  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::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
552
  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::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
234
  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::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
1.07k
  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
954
  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
11.3k
  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::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
650
  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::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
208
390
  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::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
208
7.77k
  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
5.54k
  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
274
  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
4.94k
  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
4.14k
  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
570
  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
4.67k
  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
1.91k
  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
2.46k
  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
361
  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
1.64k
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
209
2.96M
  static return_t default_return_value () { return hb_empty_t (); }
210
  void recurse (unsigned lookup_index)
211
42.2M
  {
212
42.2M
    if (unlikely (nesting_level_left == 0 || !recurse_func))
213
0
      return;
214
215
    /* Return if new lookup was recursed to before. */
216
42.2M
    if (lookup_limit_exceeded ()
217
42.2M
        || visited_lookups->in_error ()
218
42.2M
        || 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
41.5M
      return;
222
223
734k
    nesting_level_left--;
224
734k
    recurse_func (this, lookup_index);
225
734k
    nesting_level_left++;
226
734k
  }
227
228
  void set_lookup_visited (unsigned lookup_index)
229
2.51M
  { visited_lookups->add (lookup_index); }
230
231
  void set_lookup_inactive (unsigned lookup_index)
232
2.47M
  { inactive_lookups->add (lookup_index); }
233
234
  bool lookup_limit_exceeded ()
235
42.8M
  {
236
42.8M
    bool ret = lookup_count > HB_MAX_LOOKUP_VISIT_COUNT;
237
42.8M
    if (ret)
238
0
      DEBUG_MSG (SUBSET, nullptr, "lookup visit count limit exceeded in lookup closure!");
239
42.8M
    return ret; }
240
241
  bool is_lookup_visited (unsigned lookup_index)
242
2.55M
  {
243
2.55M
    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
2.55M
    if (unlikely (visited_lookups->in_error ()))
251
11.0k
      return true;
252
253
2.54M
    return visited_lookups->has (lookup_index);
254
2.55M
  }
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
75.1k
        face (face_),
267
75.1k
        glyphs (glyphs_),
268
75.1k
        recurse_func (nullptr),
269
75.1k
        nesting_level_left (nesting_level_left_),
270
75.1k
        visited_lookups (visited_lookups_),
271
75.1k
        inactive_lookups (inactive_lookups_),
272
75.1k
        lookup_count (0) {}
273
274
75.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
373k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
8.14k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
279
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
207
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
250
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
151k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
54
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
788
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
12
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
186k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
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&)
Line
Count
Source
286
258
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
286
4.80k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
286
2.24k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
286
1.86k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
286
1.29k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
286
568
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
286
8.71k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
286
1.33k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
286
1.31k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
286
999
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
286
759
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
286
1.63k
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
287
533k
  static return_t default_return_value () { return false; }
288
556k
  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
1.19M
            face (face_),
300
1.19M
            glyphs (glyphs_),
301
1.19M
            len (len_),
302
1.19M
            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
44.6M
  {
407
44.6M
    set_match_func (nullptr, nullptr);
408
44.6M
    lookup_props = c->lookup_props;
409
    /* Ignore ZWNJ if we are matching GPOS, or matching GSUB context and asked to. */
410
44.6M
    ignore_zwnj = c->table_index == 1 || (context_match && c->auto_zwnj);
411
    /* Ignore ZWJ if we are matching context, or asked to. */
412
44.6M
    ignore_zwj = context_match || c->auto_zwj;
413
    /* Ignore hidden glyphs (like CGJ) during GPOS. */
414
44.6M
    ignore_hidden = c->table_index == 1;
415
44.6M
    mask = context_match ? -1 : c->lookup_mask;
416
    /* Per syllable matching is only for GSUB. */
417
44.6M
    per_syllable = c->table_index == 0 && c->per_syllable;
418
44.6M
    syllable = 0;
419
44.6M
  }
420
421
  void set_match_func (match_func_t match_func_,
422
           const void *match_data_)
423
57.8M
  { 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
53.5M
  {
437
53.5M
    if (!(info.mask & mask) ||
438
53.5M
  (per_syllable && syllable && syllable != info.syllable ()))
439
322k
      return MATCH_NO;
440
441
53.2M
    if (match_func)
442
15.3M
      return match_func (info, glyph_data, match_data) ? MATCH_YES : MATCH_NO;
443
444
37.9M
    return MATCH_MAYBE;
445
53.2M
  }
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
247M
  {
460
247M
    if (!c->check_glyph_property (&info, lookup_props))
461
188M
      return SKIP_YES;
462
463
58.8M
    if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
464
58.8M
      (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
465
58.8M
      (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
466
58.8M
      (ignore_hidden || !_hb_glyph_info_is_hidden (&info))))
467
19.8M
      return SKIP_MAYBE;
468
469
39.0M
    return SKIP_NO;
470
58.8M
  }
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
44.6M
  {
489
44.6M
    c = c_;
490
44.6M
    end = c->buffer->len;
491
44.6M
    match_glyph_data16 = nullptr;
492
44.6M
#ifndef HB_NO_BEYOND_64K
493
44.6M
    match_glyph_data24 = nullptr;
494
44.6M
#endif
495
44.6M
    matcher.init (c, context_match);
496
44.6M
  }
497
  void set_lookup_props (unsigned int lookup_props)
498
3.22M
  {
499
3.22M
    matcher.lookup_props = lookup_props;
500
3.22M
  }
501
  void set_match_func (matcher_t::match_func_t match_func_,
502
           const void *match_data_)
503
13.2M
  {
504
13.2M
    matcher.set_match_func (match_func_, match_data_);
505
13.2M
  }
506
  void set_glyph_data (const HBUINT16 glyph_data[])
507
12.0M
  {
508
12.0M
    match_glyph_data16 = glyph_data;
509
12.0M
#ifndef HB_NO_BEYOND_64K
510
12.0M
    match_glyph_data24 = nullptr;
511
12.0M
#endif
512
12.0M
  }
513
#ifndef HB_NO_BEYOND_64K
514
  void set_glyph_data (const HBUINT24 glyph_data[])
515
1.17M
  {
516
1.17M
    match_glyph_data16 = nullptr;
517
1.17M
    match_glyph_data24 = glyph_data;
518
1.17M
  }
519
#endif
520
521
#ifndef HB_OPTIMIZE_SIZE
522
  HB_ALWAYS_INLINE
523
#endif
524
  void reset (unsigned int start_index_)
525
12.0M
  {
526
    // For GSUB forward iterator
527
12.0M
    idx = start_index_;
528
12.0M
    end = c->buffer->len;
529
12.0M
    matcher.syllable = c->buffer->cur().syllable();
530
12.0M
  }
531
  void reset_back (unsigned int start_index_, bool from_out_buffer = false)
532
1.17M
  {
533
    // For GSUB backward iterator
534
1.17M
    idx = start_index_;
535
1.17M
    matcher.syllable = c->buffer->cur().syllable();
536
1.17M
  }
537
538
#ifndef HB_OPTIMIZE_SIZE
539
  HB_ALWAYS_INLINE
540
#endif
541
  void reset_fast (unsigned int start_index_)
542
17.4M
  {
543
    // Doesn't set end or syllable. Used by GPOS which doesn't care / change.
544
17.4M
    idx = start_index_;
545
17.4M
  }
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
5.36M
  { 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
241M
  {
564
241M
    matcher_t::may_skip_t skip = matcher.may_skip (c, info);
565
241M
    if (unlikely (skip == matcher_t::SKIP_YES))
566
188M
      return SKIP;
567
568
53.5M
    matcher_t::may_match_t match = matcher.may_match (info, get_glyph_data ());
569
53.5M
    if (match == matcher_t::MATCH_YES ||
570
42.0M
  (match == matcher_t::MATCH_MAYBE &&
571
37.9M
   skip == matcher_t::SKIP_NO))
572
29.8M
      return MATCH;
573
574
23.6M
    if (skip == matcher_t::SKIP_NO)
575
4.05M
      return NOT_MATCH;
576
577
19.6M
    return SKIP;
578
23.6M
  }
579
580
#ifndef HB_OPTIMIZE_SIZE
581
  HB_ALWAYS_INLINE
582
#endif
583
  bool next (unsigned *unsafe_to = nullptr)
584
31.6M
  {
585
31.6M
    auto *info = c->buffer->info;
586
31.6M
    const signed stop = (signed) end - 1;
587
107M
    while ((signed) idx < stop)
588
105M
    {
589
105M
      idx++;
590
105M
      switch (match (info[idx]))
591
105M
      {
592
26.2M
  case MATCH:
593
26.2M
  {
594
26.2M
    advance_glyph_data ();
595
26.2M
    return true;
596
0
  }
597
3.17M
  case NOT_MATCH:
598
3.17M
  {
599
3.17M
    if (unsafe_to)
600
3.16M
      *unsafe_to = idx + 1;
601
3.17M
    return false;
602
0
  }
603
76.0M
  case SKIP:
604
76.0M
    continue;
605
105M
      }
606
105M
    }
607
2.24M
    if (unsafe_to)
608
1.44M
      *unsafe_to = end;
609
2.24M
    return false;
610
31.6M
  }
611
#ifndef HB_OPTIMIZE_SIZE
612
  HB_ALWAYS_INLINE
613
#endif
614
  bool prev (unsigned *unsafe_from = nullptr)
615
3.58M
  {
616
3.58M
    auto *out_info = c->buffer->out_info;
617
3.58M
    const unsigned stop = 0;
618
134M
    while (idx > stop)
619
134M
    {
620
134M
      idx--;
621
134M
      switch (match (out_info[idx]))
622
134M
      {
623
2.66M
  case MATCH:
624
2.66M
  {
625
2.66M
    advance_glyph_data ();
626
2.66M
    return true;
627
0
  }
628
880k
  case NOT_MATCH:
629
880k
  {
630
880k
    if (unsafe_from)
631
880k
      *unsafe_from = hb_max (1u, idx) - 1u;
632
880k
    return false;
633
0
  }
634
130M
  case SKIP:
635
130M
    continue;
636
134M
      }
637
134M
    }
638
35.1k
    if (unsafe_from)
639
35.1k
      *unsafe_from = 0;
640
35.1k
    return false;
641
3.58M
  }
642
643
  HB_ALWAYS_INLINE
644
  hb_codepoint_t
645
  get_glyph_data ()
646
53.5M
  {
647
53.5M
    if (match_glyph_data16) return *match_glyph_data16;
648
44.6M
#ifndef HB_NO_BEYOND_64K
649
44.6M
    else
650
44.6M
    if (match_glyph_data24) return *match_glyph_data24;
651
43.3M
#endif
652
43.3M
    return 0;
653
53.5M
  }
654
  HB_ALWAYS_INLINE
655
  void
656
  advance_glyph_data ()
657
28.9M
  {
658
28.9M
    if (match_glyph_data16) match_glyph_data16++;
659
23.9M
#ifndef HB_NO_BEYOND_64K
660
23.9M
    else
661
23.9M
    if (match_glyph_data24) match_glyph_data24++;
662
28.9M
#endif
663
28.9M
  }
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
601
  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
11.0M
  {
694
11.0M
    assert (recurse_func);
695
11.0M
    if (unlikely (nesting_level_left == 0))
696
601
    {
697
601
      buffer->successful = false;
698
601
      return default_return_value ();
699
601
    }
700
701
11.0M
    buffer->max_ops--;
702
11.0M
    if (unlikely (buffer->max_ops < 0))
703
0
    {
704
0
      buffer->successful = false;
705
0
      return default_return_value ();
706
0
    }
707
708
11.0M
    nesting_level_left--;
709
11.0M
    bool ret = recurse_func (this, sub_lookup_index);
710
11.0M
    nesting_level_left++;
711
11.0M
    return ret;
712
11.0M
  }
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
#ifndef HB_NO_BUFFER_MESSAGE
747
  hb_buffer_t::changed_func_t orig_changed_func = nullptr;
748
  void *orig_changed_data = nullptr;
749
#endif
750
751
  hb_ot_apply_context_t (unsigned int table_index_,
752
       hb_font_t *font_,
753
       hb_buffer_t *buffer_,
754
       hb_blob_t *table_blob_,
755
       hb_scalar_cache_t *var_store_cache_ = nullptr) :
756
112k
      table_index (table_index_),
757
112k
      font (font_), face (font->face), buffer (buffer_),
758
112k
      sanitizer (table_blob_),
759
      gdef (
760
#ifndef HB_NO_OT_LAYOUT
761
112k
            *face->table.GDEF->table
762
#else
763
            Null (GDEF)
764
#endif
765
           ),
766
      gdef_accel (
767
#ifndef HB_NO_OT_LAYOUT
768
112k
            *face->table.GDEF
769
#else
770
            Null (GDEF::accelerator_t)
771
#endif
772
           ),
773
112k
      var_store (gdef.get_var_store ()),
774
112k
      var_store_cache (var_store_cache_),
775
112k
      direction (buffer_->props.direction),
776
112k
      has_glyph_classes (gdef.has_glyph_classes ())
777
112k
  {
778
112k
    init_iters ();
779
112k
    match_positions.set_storage (stack_match_positions);
780
781
112k
#ifndef HB_NO_BUFFER_MESSAGE
782
112k
    if (buffer->messaging ())
783
0
    {
784
0
      assert (buffer->changed_func == nullptr ||
785
0
        buffer->changed_func == buffer_changed_trampoline);
786
0
      orig_changed_func = buffer->changed_func;
787
0
      orig_changed_data = buffer->changed_data;
788
0
      buffer->changed_func = buffer_changed_trampoline;
789
0
      buffer->changed_data = this;
790
0
    }
791
112k
#endif
792
112k
  }
793
  ~hb_ot_apply_context_t ()
794
112k
  {
795
112k
#ifndef HB_NO_BUFFER_MESSAGE
796
112k
    if (buffer->messaging ())
797
0
    {
798
0
      assert (buffer->changed_func == buffer_changed_trampoline);
799
0
      assert (buffer->changed_data == this);
800
0
      buffer->changed_func = orig_changed_func;
801
0
      buffer->changed_data = orig_changed_data;
802
0
    }
803
112k
#endif
804
112k
  }
805
806
  void init_iters ()
807
22.3M
  {
808
22.3M
    iter_input.init (this, false);
809
22.3M
    iter_context.init (this, true);
810
22.3M
  }
811
812
74.4k
  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 (); }
813
69.1k
  void set_auto_zwj (bool auto_zwj_, bool init = true) { auto_zwj = auto_zwj_; if (init) init_iters (); }
814
69.1k
  void set_auto_zwnj (bool auto_zwnj_, bool init = true) { auto_zwnj = auto_zwnj_; if (init) init_iters (); }
815
69.1k
  void set_per_syllable (bool per_syllable_, bool init = true) { per_syllable = per_syllable_; if (init) init_iters (); }
816
69.1k
  void set_random (bool random_) { random = random_; }
817
107k
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
818
22.1M
  void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
819
  void set_lookup_props (unsigned int lookup_props_)
820
22.1M
  {
821
22.1M
    lookup_props = gdef_accel.sanitize_lookup_props (lookup_props_);
822
22.1M
    init_iters ();
823
22.1M
  }
824
825
  uint32_t random_number ()
826
646
  {
827
    /* http://www.cplusplus.com/reference/random/minstd_rand/ */
828
646
    buffer->random_state = buffer->random_state * 48271 % 2147483647;
829
646
    return buffer->random_state;
830
646
  }
831
832
  static void buffer_changed_trampoline (hb_buffer_t *buffer HB_UNUSED, void *user_data)
833
0
  {
834
0
    ((hb_ot_apply_context_t *) user_data)->buffer_changed ();
835
0
  }
836
  void buffer_changed ()
837
0
  {
838
0
    buffer->update_digest ();
839
0
    if (likely (has_glyph_classes))
840
0
      for (unsigned i = 0; i < buffer->len; i++)
841
0
  _set_glyph_class_props (buffer->info[i]);
842
0
  }
843
844
  HB_ALWAYS_INLINE
845
  HB_HOT
846
  bool match_properties_mark (const hb_glyph_info_t *info,
847
            unsigned int    glyph_props,
848
            unsigned int    match_props) const
849
138M
  {
850
    /* If using mark filtering sets, the high short of
851
     * match_props has the set index.
852
     */
853
138M
    if (match_props & LookupFlag::UseMarkFilteringSet)
854
537k
      return gdef_accel.mark_set_covers (match_props >> 16, info->codepoint);
855
856
    /* The second byte of match_props has the meaning
857
     * "ignore marks of attachment type different than
858
     * the attachment type specified."
859
     */
860
137M
    if (match_props & LookupFlag::MarkAttachmentType)
861
130M
      return (match_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType);
862
863
6.81M
    return true;
864
137M
  }
865
866
#ifndef HB_OPTIMIZE_SIZE
867
  HB_ALWAYS_INLINE
868
#endif
869
  bool check_glyph_property (const hb_glyph_info_t *info,
870
           unsigned match_props) const
871
270M
  {
872
270M
    unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info);
873
874
    /* Not covered, if, for example, glyph class is ligature and
875
     * match_props includes LookupFlags::IgnoreLigatures
876
     */
877
270M
    if (glyph_props & match_props & LookupFlag::IgnoreFlags)
878
59.1M
      return false;
879
880
211M
    if (glyph_props & HB_OT_LAYOUT_GLYPH_PROPS_MARK)
881
138M
      return match_properties_mark (info, glyph_props, match_props);
882
883
73.6M
    return true;
884
211M
  }
885
886
  void _set_glyph_class (hb_codepoint_t glyph_index,
887
        unsigned int class_guess = 0,
888
        bool ligature = false,
889
        bool component = false)
890
77.0M
  {
891
77.0M
    buffer->digest.add (glyph_index);
892
893
77.0M
    if (new_syllables != (unsigned) -1)
894
7.51k
      buffer->cur().syllable() = new_syllables;
895
896
77.0M
    unsigned int props = _hb_glyph_info_get_glyph_props (&buffer->cur());
897
77.0M
    props |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED;
898
77.0M
    if (ligature)
899
434k
    {
900
434k
      props |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED;
901
      /* In the only place that the MULTIPLIED bit is used, Uniscribe
902
       * seems to only care about the "last" transformation between
903
       * Ligature and Multiple substitutions.  Ie. if you ligate, expand,
904
       * and ligate again, it forgives the multiplication and acts as
905
       * if only ligation happened.  As such, clear MULTIPLIED bit.
906
       */
907
434k
      props &= ~HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
908
434k
    }
909
77.0M
    if (component)
910
75.9M
      props |= HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
911
77.0M
    if (likely (has_glyph_classes))
912
8.03M
    {
913
8.03M
      _set_glyph_class_props (buffer->cur(), props, glyph_index);
914
8.03M
    }
915
68.9M
    else if (class_guess)
916
464k
    {
917
464k
      props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
918
464k
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props | class_guess);
919
464k
    }
920
68.5M
    else
921
68.5M
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props);
922
77.0M
  }
923
  void _set_glyph_class_props (hb_glyph_info_t &info,
924
             unsigned int props,
925
             hb_codepoint_t glyph_index)
926
8.03M
  {
927
8.03M
    props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
928
8.03M
    _hb_glyph_info_set_glyph_props (&info, props | gdef_accel.get_glyph_props (glyph_index));
929
8.03M
  }
930
  void _set_glyph_class_props (hb_glyph_info_t &info)
931
0
  {
932
0
    _set_glyph_class_props (info,
933
0
          _hb_glyph_info_get_glyph_props (&info),
934
0
          info.codepoint);
935
0
  }
936
937
  void replace_glyph (hb_codepoint_t glyph_index)
938
527k
  {
939
527k
    _set_glyph_class (glyph_index);
940
527k
    (void) buffer->replace_glyph (glyph_index);
941
527k
  }
942
  void replace_glyph_inplace (hb_codepoint_t glyph_index)
943
58.6k
  {
944
58.6k
    _set_glyph_class (glyph_index);
945
58.6k
    buffer->cur().codepoint = glyph_index;
946
58.6k
  }
947
  void replace_glyph_with_ligature (hb_codepoint_t glyph_index,
948
            unsigned int class_guess)
949
434k
  {
950
434k
    _set_glyph_class (glyph_index, class_guess, true);
951
434k
    (void) buffer->replace_glyph (glyph_index);
952
434k
  }
953
  void output_glyph_for_component (hb_codepoint_t glyph_index,
954
           unsigned int class_guess)
955
75.9M
  {
956
75.9M
    _set_glyph_class (glyph_index, class_guess, false, true);
957
75.9M
    (void) buffer->output_glyph (glyph_index);
958
75.9M
  }
959
};
960
961
enum class hb_ot_subtable_cache_op_t
962
{
963
  ENTER,
964
  LEAVE,
965
};
966
967
struct hb_accelerate_subtables_context_t :
968
       hb_dispatch_context_t<hb_accelerate_subtables_context_t>
969
{
970
  template <typename T>
971
  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) )
972
  template <typename T>
973
  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) )
974
  template <typename T>
975
  static inline bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
976
33.8M
  {
977
33.8M
    const T *typed_obj = (const T *) obj;
978
33.8M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
33.8M
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
89.9k
  {
977
89.9k
    const T *typed_obj = (const T *) obj;
978
89.9k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
89.9k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat2>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
10.7k
  {
977
10.7k
    const T *typed_obj = (const T *) obj;
978
10.7k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
10.7k
  }
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*)
Line
Count
Source
976
8.35M
  {
977
8.35M
    const T *typed_obj = (const T *) obj;
978
8.35M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
8.35M
  }
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*)
Line
Count
Source
976
228k
  {
977
228k
    const T *typed_obj = (const T *) obj;
978
228k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
228k
  }
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*)
Line
Count
Source
976
391k
  {
977
391k
    const T *typed_obj = (const T *) obj;
978
391k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
391k
  }
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*)
Line
Count
Source
976
197k
  {
977
197k
    const T *typed_obj = (const T *) obj;
978
197k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
197k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::CursivePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
2.76M
  {
977
2.76M
    const T *typed_obj = (const T *) obj;
978
2.76M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
2.76M
  }
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*)
Line
Count
Source
976
2.02M
  {
977
2.02M
    const T *typed_obj = (const T *) obj;
978
2.02M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
2.02M
  }
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*)
Line
Count
Source
976
555k
  {
977
555k
    const T *typed_obj = (const T *) obj;
978
555k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
555k
  }
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*)
Line
Count
Source
976
526k
  {
977
526k
    const T *typed_obj = (const T *) obj;
978
526k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
526k
  }
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*)
Line
Count
Source
976
31.8k
  {
977
31.8k
    const T *typed_obj = (const T *) obj;
978
31.8k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
31.8k
  }
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*)
Line
Count
Source
976
1.08M
  {
977
1.08M
    const T *typed_obj = (const T *) obj;
978
1.08M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
1.08M
  }
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*)
Line
Count
Source
976
31.1k
  {
977
31.1k
    const T *typed_obj = (const T *) obj;
978
31.1k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
31.1k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
2.81M
  {
977
2.81M
    const T *typed_obj = (const T *) obj;
978
2.81M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
2.81M
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
354k
  {
977
354k
    const T *typed_obj = (const T *) obj;
978
354k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
354k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
117k
  {
977
117k
    const T *typed_obj = (const T *) obj;
978
117k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
117k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
576k
  {
977
576k
    const T *typed_obj = (const T *) obj;
978
576k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
576k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
12.5k
  {
977
12.5k
    const T *typed_obj = (const T *) obj;
978
12.5k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
12.5k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
1.33M
  {
977
1.33M
    const T *typed_obj = (const T *) obj;
978
1.33M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
1.33M
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
92.6k
  {
977
92.6k
    const T *typed_obj = (const T *) obj;
978
92.6k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
92.6k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
181k
  {
977
181k
    const T *typed_obj = (const T *) obj;
978
181k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
181k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
161k
  {
977
161k
    const T *typed_obj = (const T *) obj;
978
161k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
161k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
62.1k
  {
977
62.1k
    const T *typed_obj = (const T *) obj;
978
62.1k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
62.1k
  }
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*)
Line
Count
Source
976
237k
  {
977
237k
    const T *typed_obj = (const T *) obj;
978
237k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
237k
  }
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*)
Line
Count
Source
976
631k
  {
977
631k
    const T *typed_obj = (const T *) obj;
978
631k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
631k
  }
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*)
Line
Count
Source
976
44.6k
  {
977
44.6k
    const T *typed_obj = (const T *) obj;
978
44.6k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
44.6k
  }
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*)
Line
Count
Source
976
16.7k
  {
977
16.7k
    const T *typed_obj = (const T *) obj;
978
16.7k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
16.7k
  }
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*)
Line
Count
Source
976
4.78M
  {
977
4.78M
    const T *typed_obj = (const T *) obj;
978
4.78M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
4.78M
  }
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*)
Line
Count
Source
976
7.84k
  {
977
7.84k
    const T *typed_obj = (const T *) obj;
978
7.84k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
7.84k
  }
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*)
Line
Count
Source
976
279k
  {
977
279k
    const T *typed_obj = (const T *) obj;
978
279k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
279k
  }
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*)
Line
Count
Source
976
2.96k
  {
977
2.96k
    const T *typed_obj = (const T *) obj;
978
2.96k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
2.96k
  }
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*)
Line
Count
Source
976
5.04M
  {
977
5.04M
    const T *typed_obj = (const T *) obj;
978
5.04M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
5.04M
  }
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*)
Line
Count
Source
976
121k
  {
977
121k
    const T *typed_obj = (const T *) obj;
978
121k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
121k
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
976
720k
  {
977
720k
    const T *typed_obj = (const T *) obj;
978
720k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
979
720k
  }
980
981
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
982
  template <typename T>
983
  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) )
984
  template <typename T>
985
  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) )
986
  template <typename T>
987
  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) )
988
  template <typename T>
989
  static inline bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
990
817k
  {
991
817k
    const T *typed_obj = (const T *) obj;
992
817k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
993
817k
  }
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*)
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*)
Line
Count
Source
990
556k
  {
991
556k
    const T *typed_obj = (const T *) obj;
992
556k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
993
556k
  }
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*)
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*)
Line
Count
Source
990
12.1k
  {
991
12.1k
    const T *typed_obj = (const T *) obj;
992
12.1k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
993
12.1k
  }
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*)
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*)
Line
Count
Source
990
240k
  {
991
240k
    const T *typed_obj = (const T *) obj;
992
240k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
993
240k
  }
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*)
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*)
Line
Count
Source
990
7.54k
  {
991
7.54k
    const T *typed_obj = (const T *) obj;
992
7.54k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
993
7.54k
  }
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*)
994
995
  template <typename T>
996
  static inline auto cache_func_ (hb_ot_apply_context_t *c,
997
          hb_ot_subtable_cache_op_t op,
998
          hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) )
999
  template <typename T=void>
1000
  static inline bool cache_func_ (hb_ot_apply_context_t *c,
1001
          hb_ot_subtable_cache_op_t op HB_UNUSED,
1002
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>)
1003
  template <typename Type>
1004
  static inline bool cache_func_to (hb_ot_apply_context_t *c,
1005
            hb_ot_subtable_cache_op_t op)
1006
10.1k
  {
1007
10.1k
    return cache_func_<Type> (c, op, hb_prioritize);
1008
10.1k
  }
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)
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)
Line
Count
Source
1006
3.41k
  {
1007
3.41k
    return cache_func_<Type> (c, op, hb_prioritize);
1008
3.41k
  }
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)
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)
Line
Count
Source
1006
2.19k
  {
1007
2.19k
    return cache_func_<Type> (c, op, hb_prioritize);
1008
2.19k
  }
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)
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)
Line
Count
Source
1006
3.46k
  {
1007
3.46k
    return cache_func_<Type> (c, op, hb_prioritize);
1008
3.46k
  }
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)
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)
Line
Count
Source
1006
1.09k
  {
1007
1.09k
    return cache_func_<Type> (c, op, hb_prioritize);
1008
1.09k
  }
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)
1009
#endif
1010
1011
  typedef bool (*hb_apply_func_t) (const void *obj, hb_ot_apply_context_t *c, void *external_cache);
1012
  typedef bool (*hb_cache_func_t) (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op);
1013
1014
  struct hb_applicable_t
1015
  {
1016
    friend struct hb_accelerate_subtables_context_t;
1017
    friend struct hb_ot_layout_lookup_accelerator_t;
1018
1019
    template <typename T>
1020
    void init (const T &obj_,
1021
         hb_apply_func_t apply_func_
1022
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1023
         , hb_apply_func_t apply_cached_func_
1024
         , hb_cache_func_t cache_func_
1025
         , void *external_cache_
1026
#endif
1027
    )
1028
110k
    {
1029
110k
      obj = &obj_;
1030
110k
      apply_func = apply_func_;
1031
110k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
110k
      apply_cached_func = apply_cached_func_;
1033
110k
      cache_func = cache_func_;
1034
110k
      external_cache = external_cache_;
1035
110k
#endif
1036
110k
      digest.init ();
1037
110k
      obj_.get_coverage ().collect_coverage (&digest);
1038
110k
    }
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*)
Line
Count
Source
1028
485
    {
1029
485
      obj = &obj_;
1030
485
      apply_func = apply_func_;
1031
485
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
485
      apply_cached_func = apply_cached_func_;
1033
485
      cache_func = cache_func_;
1034
485
      external_cache = external_cache_;
1035
485
#endif
1036
485
      digest.init ();
1037
485
      obj_.get_coverage ().collect_coverage (&digest);
1038
485
    }
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*)
Line
Count
Source
1028
1.00k
    {
1029
1.00k
      obj = &obj_;
1030
1.00k
      apply_func = apply_func_;
1031
1.00k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.00k
      apply_cached_func = apply_cached_func_;
1033
1.00k
      cache_func = cache_func_;
1034
1.00k
      external_cache = external_cache_;
1035
1.00k
#endif
1036
1.00k
      digest.init ();
1037
1.00k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.00k
    }
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*)
Line
Count
Source
1028
6.04k
    {
1029
6.04k
      obj = &obj_;
1030
6.04k
      apply_func = apply_func_;
1031
6.04k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
6.04k
      apply_cached_func = apply_cached_func_;
1033
6.04k
      cache_func = cache_func_;
1034
6.04k
      external_cache = external_cache_;
1035
6.04k
#endif
1036
6.04k
      digest.init ();
1037
6.04k
      obj_.get_coverage ().collect_coverage (&digest);
1038
6.04k
    }
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*)
Line
Count
Source
1028
5.99k
    {
1029
5.99k
      obj = &obj_;
1030
5.99k
      apply_func = apply_func_;
1031
5.99k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
5.99k
      apply_cached_func = apply_cached_func_;
1033
5.99k
      cache_func = cache_func_;
1034
5.99k
      external_cache = external_cache_;
1035
5.99k
#endif
1036
5.99k
      digest.init ();
1037
5.99k
      obj_.get_coverage ().collect_coverage (&digest);
1038
5.99k
    }
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*)
Line
Count
Source
1028
4.53k
    {
1029
4.53k
      obj = &obj_;
1030
4.53k
      apply_func = apply_func_;
1031
4.53k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
4.53k
      apply_cached_func = apply_cached_func_;
1033
4.53k
      cache_func = cache_func_;
1034
4.53k
      external_cache = external_cache_;
1035
4.53k
#endif
1036
4.53k
      digest.init ();
1037
4.53k
      obj_.get_coverage ().collect_coverage (&digest);
1038
4.53k
    }
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*)
Line
Count
Source
1028
2.92k
    {
1029
2.92k
      obj = &obj_;
1030
2.92k
      apply_func = apply_func_;
1031
2.92k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.92k
      apply_cached_func = apply_cached_func_;
1033
2.92k
      cache_func = cache_func_;
1034
2.92k
      external_cache = external_cache_;
1035
2.92k
#endif
1036
2.92k
      digest.init ();
1037
2.92k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.92k
    }
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*)
Line
Count
Source
1028
2.42k
    {
1029
2.42k
      obj = &obj_;
1030
2.42k
      apply_func = apply_func_;
1031
2.42k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.42k
      apply_cached_func = apply_cached_func_;
1033
2.42k
      cache_func = cache_func_;
1034
2.42k
      external_cache = external_cache_;
1035
2.42k
#endif
1036
2.42k
      digest.init ();
1037
2.42k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.42k
    }
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*)
Line
Count
Source
1028
5.48k
    {
1029
5.48k
      obj = &obj_;
1030
5.48k
      apply_func = apply_func_;
1031
5.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
5.48k
      apply_cached_func = apply_cached_func_;
1033
5.48k
      cache_func = cache_func_;
1034
5.48k
      external_cache = external_cache_;
1035
5.48k
#endif
1036
5.48k
      digest.init ();
1037
5.48k
      obj_.get_coverage ().collect_coverage (&digest);
1038
5.48k
    }
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*)
Line
Count
Source
1028
2.52k
    {
1029
2.52k
      obj = &obj_;
1030
2.52k
      apply_func = apply_func_;
1031
2.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.52k
      apply_cached_func = apply_cached_func_;
1033
2.52k
      cache_func = cache_func_;
1034
2.52k
      external_cache = external_cache_;
1035
2.52k
#endif
1036
2.52k
      digest.init ();
1037
2.52k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.52k
    }
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*)
Line
Count
Source
1028
1.19k
    {
1029
1.19k
      obj = &obj_;
1030
1.19k
      apply_func = apply_func_;
1031
1.19k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.19k
      apply_cached_func = apply_cached_func_;
1033
1.19k
      cache_func = cache_func_;
1034
1.19k
      external_cache = external_cache_;
1035
1.19k
#endif
1036
1.19k
      digest.init ();
1037
1.19k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.19k
    }
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*)
Line
Count
Source
1028
901
    {
1029
901
      obj = &obj_;
1030
901
      apply_func = apply_func_;
1031
901
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
901
      apply_cached_func = apply_cached_func_;
1033
901
      cache_func = cache_func_;
1034
901
      external_cache = external_cache_;
1035
901
#endif
1036
901
      digest.init ();
1037
901
      obj_.get_coverage ().collect_coverage (&digest);
1038
901
    }
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*)
Line
Count
Source
1028
1.51k
    {
1029
1.51k
      obj = &obj_;
1030
1.51k
      apply_func = apply_func_;
1031
1.51k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.51k
      apply_cached_func = apply_cached_func_;
1033
1.51k
      cache_func = cache_func_;
1034
1.51k
      external_cache = external_cache_;
1035
1.51k
#endif
1036
1.51k
      digest.init ();
1037
1.51k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.51k
    }
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*)
Line
Count
Source
1028
1.96k
    {
1029
1.96k
      obj = &obj_;
1030
1.96k
      apply_func = apply_func_;
1031
1.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.96k
      apply_cached_func = apply_cached_func_;
1033
1.96k
      cache_func = cache_func_;
1034
1.96k
      external_cache = external_cache_;
1035
1.96k
#endif
1036
1.96k
      digest.init ();
1037
1.96k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.96k
    }
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*)
Line
Count
Source
1028
4.63k
    {
1029
4.63k
      obj = &obj_;
1030
4.63k
      apply_func = apply_func_;
1031
4.63k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
4.63k
      apply_cached_func = apply_cached_func_;
1033
4.63k
      cache_func = cache_func_;
1034
4.63k
      external_cache = external_cache_;
1035
4.63k
#endif
1036
4.63k
      digest.init ();
1037
4.63k
      obj_.get_coverage ().collect_coverage (&digest);
1038
4.63k
    }
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*)
Line
Count
Source
1028
7.52k
    {
1029
7.52k
      obj = &obj_;
1030
7.52k
      apply_func = apply_func_;
1031
7.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
7.52k
      apply_cached_func = apply_cached_func_;
1033
7.52k
      cache_func = cache_func_;
1034
7.52k
      external_cache = external_cache_;
1035
7.52k
#endif
1036
7.52k
      digest.init ();
1037
7.52k
      obj_.get_coverage ().collect_coverage (&digest);
1038
7.52k
    }
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*)
Line
Count
Source
1028
1.48k
    {
1029
1.48k
      obj = &obj_;
1030
1.48k
      apply_func = apply_func_;
1031
1.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.48k
      apply_cached_func = apply_cached_func_;
1033
1.48k
      cache_func = cache_func_;
1034
1.48k
      external_cache = external_cache_;
1035
1.48k
#endif
1036
1.48k
      digest.init ();
1037
1.48k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.48k
    }
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*)
Line
Count
Source
1028
1.45k
    {
1029
1.45k
      obj = &obj_;
1030
1.45k
      apply_func = apply_func_;
1031
1.45k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.45k
      apply_cached_func = apply_cached_func_;
1033
1.45k
      cache_func = cache_func_;
1034
1.45k
      external_cache = external_cache_;
1035
1.45k
#endif
1036
1.45k
      digest.init ();
1037
1.45k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.45k
    }
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*)
Line
Count
Source
1028
2.85k
    {
1029
2.85k
      obj = &obj_;
1030
2.85k
      apply_func = apply_func_;
1031
2.85k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.85k
      apply_cached_func = apply_cached_func_;
1033
2.85k
      cache_func = cache_func_;
1034
2.85k
      external_cache = external_cache_;
1035
2.85k
#endif
1036
2.85k
      digest.init ();
1037
2.85k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.85k
    }
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*)
Line
Count
Source
1028
3.30k
    {
1029
3.30k
      obj = &obj_;
1030
3.30k
      apply_func = apply_func_;
1031
3.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
3.30k
      apply_cached_func = apply_cached_func_;
1033
3.30k
      cache_func = cache_func_;
1034
3.30k
      external_cache = external_cache_;
1035
3.30k
#endif
1036
3.30k
      digest.init ();
1037
3.30k
      obj_.get_coverage ().collect_coverage (&digest);
1038
3.30k
    }
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*)
Line
Count
Source
1028
7.96k
    {
1029
7.96k
      obj = &obj_;
1030
7.96k
      apply_func = apply_func_;
1031
7.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
7.96k
      apply_cached_func = apply_cached_func_;
1033
7.96k
      cache_func = cache_func_;
1034
7.96k
      external_cache = external_cache_;
1035
7.96k
#endif
1036
7.96k
      digest.init ();
1037
7.96k
      obj_.get_coverage ().collect_coverage (&digest);
1038
7.96k
    }
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*)
Line
Count
Source
1028
2.30k
    {
1029
2.30k
      obj = &obj_;
1030
2.30k
      apply_func = apply_func_;
1031
2.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.30k
      apply_cached_func = apply_cached_func_;
1033
2.30k
      cache_func = cache_func_;
1034
2.30k
      external_cache = external_cache_;
1035
2.30k
#endif
1036
2.30k
      digest.init ();
1037
2.30k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.30k
    }
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*)
Line
Count
Source
1028
1.97k
    {
1029
1.97k
      obj = &obj_;
1030
1.97k
      apply_func = apply_func_;
1031
1.97k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.97k
      apply_cached_func = apply_cached_func_;
1033
1.97k
      cache_func = cache_func_;
1034
1.97k
      external_cache = external_cache_;
1035
1.97k
#endif
1036
1.97k
      digest.init ();
1037
1.97k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.97k
    }
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*)
Line
Count
Source
1028
5.36k
    {
1029
5.36k
      obj = &obj_;
1030
5.36k
      apply_func = apply_func_;
1031
5.36k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
5.36k
      apply_cached_func = apply_cached_func_;
1033
5.36k
      cache_func = cache_func_;
1034
5.36k
      external_cache = external_cache_;
1035
5.36k
#endif
1036
5.36k
      digest.init ();
1037
5.36k
      obj_.get_coverage ().collect_coverage (&digest);
1038
5.36k
    }
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*)
Line
Count
Source
1028
1.03k
    {
1029
1.03k
      obj = &obj_;
1030
1.03k
      apply_func = apply_func_;
1031
1.03k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.03k
      apply_cached_func = apply_cached_func_;
1033
1.03k
      cache_func = cache_func_;
1034
1.03k
      external_cache = external_cache_;
1035
1.03k
#endif
1036
1.03k
      digest.init ();
1037
1.03k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.03k
    }
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*)
Line
Count
Source
1028
2.21k
    {
1029
2.21k
      obj = &obj_;
1030
2.21k
      apply_func = apply_func_;
1031
2.21k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.21k
      apply_cached_func = apply_cached_func_;
1033
2.21k
      cache_func = cache_func_;
1034
2.21k
      external_cache = external_cache_;
1035
2.21k
#endif
1036
2.21k
      digest.init ();
1037
2.21k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.21k
    }
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*)
Line
Count
Source
1028
720
    {
1029
720
      obj = &obj_;
1030
720
      apply_func = apply_func_;
1031
720
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
720
      apply_cached_func = apply_cached_func_;
1033
720
      cache_func = cache_func_;
1034
720
      external_cache = external_cache_;
1035
720
#endif
1036
720
      digest.init ();
1037
720
      obj_.get_coverage ().collect_coverage (&digest);
1038
720
    }
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*)
Line
Count
Source
1028
747
    {
1029
747
      obj = &obj_;
1030
747
      apply_func = apply_func_;
1031
747
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
747
      apply_cached_func = apply_cached_func_;
1033
747
      cache_func = cache_func_;
1034
747
      external_cache = external_cache_;
1035
747
#endif
1036
747
      digest.init ();
1037
747
      obj_.get_coverage ().collect_coverage (&digest);
1038
747
    }
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*)
Line
Count
Source
1028
9.23k
    {
1029
9.23k
      obj = &obj_;
1030
9.23k
      apply_func = apply_func_;
1031
9.23k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
9.23k
      apply_cached_func = apply_cached_func_;
1033
9.23k
      cache_func = cache_func_;
1034
9.23k
      external_cache = external_cache_;
1035
9.23k
#endif
1036
9.23k
      digest.init ();
1037
9.23k
      obj_.get_coverage ().collect_coverage (&digest);
1038
9.23k
    }
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*)
Line
Count
Source
1028
904
    {
1029
904
      obj = &obj_;
1030
904
      apply_func = apply_func_;
1031
904
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
904
      apply_cached_func = apply_cached_func_;
1033
904
      cache_func = cache_func_;
1034
904
      external_cache = external_cache_;
1035
904
#endif
1036
904
      digest.init ();
1037
904
      obj_.get_coverage ().collect_coverage (&digest);
1038
904
    }
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*)
Line
Count
Source
1028
1.78k
    {
1029
1.78k
      obj = &obj_;
1030
1.78k
      apply_func = apply_func_;
1031
1.78k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
1.78k
      apply_cached_func = apply_cached_func_;
1033
1.78k
      cache_func = cache_func_;
1034
1.78k
      external_cache = external_cache_;
1035
1.78k
#endif
1036
1.78k
      digest.init ();
1037
1.78k
      obj_.get_coverage ().collect_coverage (&digest);
1038
1.78k
    }
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*)
Line
Count
Source
1028
787
    {
1029
787
      obj = &obj_;
1030
787
      apply_func = apply_func_;
1031
787
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
787
      apply_cached_func = apply_cached_func_;
1033
787
      cache_func = cache_func_;
1034
787
      external_cache = external_cache_;
1035
787
#endif
1036
787
      digest.init ();
1037
787
      obj_.get_coverage ().collect_coverage (&digest);
1038
787
    }
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*)
Line
Count
Source
1028
10.7k
    {
1029
10.7k
      obj = &obj_;
1030
10.7k
      apply_func = apply_func_;
1031
10.7k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
10.7k
      apply_cached_func = apply_cached_func_;
1033
10.7k
      cache_func = cache_func_;
1034
10.7k
      external_cache = external_cache_;
1035
10.7k
#endif
1036
10.7k
      digest.init ();
1037
10.7k
      obj_.get_coverage ().collect_coverage (&digest);
1038
10.7k
    }
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*)
Line
Count
Source
1028
3.87k
    {
1029
3.87k
      obj = &obj_;
1030
3.87k
      apply_func = apply_func_;
1031
3.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
3.87k
      apply_cached_func = apply_cached_func_;
1033
3.87k
      cache_func = cache_func_;
1034
3.87k
      external_cache = external_cache_;
1035
3.87k
#endif
1036
3.87k
      digest.init ();
1037
3.87k
      obj_.get_coverage ().collect_coverage (&digest);
1038
3.87k
    }
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*)
Line
Count
Source
1028
2.13k
    {
1029
2.13k
      obj = &obj_;
1030
2.13k
      apply_func = apply_func_;
1031
2.13k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1032
2.13k
      apply_cached_func = apply_cached_func_;
1033
2.13k
      cache_func = cache_func_;
1034
2.13k
      external_cache = external_cache_;
1035
2.13k
#endif
1036
2.13k
      digest.init ();
1037
2.13k
      obj_.get_coverage ().collect_coverage (&digest);
1038
2.13k
    }
1039
1040
#ifdef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1041
    bool apply (hb_ot_apply_context_t *c) const
1042
    {
1043
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, nullptr);
1044
    }
1045
#else
1046
    bool apply (hb_ot_apply_context_t *c) const
1047
138M
    {
1048
138M
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, external_cache);
1049
138M
    }
1050
    bool apply_cached (hb_ot_apply_context_t *c) const
1051
7.19M
    {
1052
7.19M
      return digest.may_have (c->buffer->cur().codepoint) &&  apply_cached_func (obj, c, external_cache);
1053
7.19M
    }
1054
1055
    bool cache_enter (hb_ot_apply_context_t *c) const
1056
5.38k
    {
1057
5.38k
      return cache_func (c, hb_ot_subtable_cache_op_t::ENTER);
1058
5.38k
    }
1059
    void cache_leave (hb_ot_apply_context_t *c) const
1060
4.78k
    {
1061
4.78k
      cache_func (c, hb_ot_subtable_cache_op_t::LEAVE);
1062
4.78k
    }
1063
#endif
1064
1065
    private:
1066
    const void *obj;
1067
    hb_apply_func_t apply_func;
1068
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1069
    hb_apply_func_t apply_cached_func;
1070
    hb_cache_func_t cache_func;
1071
    void *external_cache;
1072
#endif
1073
    hb_set_digest_t digest;
1074
  };
1075
1076
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1077
  template <typename T>
1078
  auto cache_cost (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.cache_cost () )
1079
  template <typename T>
1080
  auto cache_cost (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( 0u )
1081
1082
  template <typename T>
1083
  auto external_cache_create (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.external_cache_create () )
1084
  template <typename T>
1085
  auto external_cache_create (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( nullptr )
1086
#endif
1087
1088
  /* Dispatch interface. */
1089
  template <typename T>
1090
  return_t dispatch (const T &obj)
1091
110k
  {
1092
110k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
110k
    void *external_cache = nullptr;
1094
110k
    if (i < 8)
1095
79.5k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
110k
#endif
1097
1098
110k
    hb_applicable_t *entry = &array[i++];
1099
1100
110k
    entry->init (obj,
1101
110k
     apply_to<T>
1102
110k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
110k
     , apply_cached_to<T>
1104
110k
     , cache_func_to<T>
1105
110k
     , external_cache
1106
110k
#endif
1107
110k
     );
1108
1109
110k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
110k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
110k
    if (cost > subtable_cache_user_cost)
1120
3.44k
    {
1121
3.44k
      subtable_cache_user_idx = i - 1;
1122
3.44k
      subtable_cache_user_cost = cost;
1123
3.44k
    }
1124
110k
#endif
1125
1126
110k
    return hb_empty_t ();
1127
110k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&)
Line
Count
Source
1091
485
  {
1092
485
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
485
    void *external_cache = nullptr;
1094
485
    if (i < 8)
1095
347
      external_cache = external_cache_create (obj, hb_prioritize);
1096
485
#endif
1097
1098
485
    hb_applicable_t *entry = &array[i++];
1099
1100
485
    entry->init (obj,
1101
485
     apply_to<T>
1102
485
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
485
     , apply_cached_to<T>
1104
485
     , cache_func_to<T>
1105
485
     , external_cache
1106
485
#endif
1107
485
     );
1108
1109
485
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
485
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
485
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
485
#endif
1125
1126
485
    return hb_empty_t ();
1127
485
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&)
Line
Count
Source
1091
1.00k
  {
1092
1.00k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.00k
    void *external_cache = nullptr;
1094
1.00k
    if (i < 8)
1095
977
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.00k
#endif
1097
1098
1.00k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.00k
    entry->init (obj,
1101
1.00k
     apply_to<T>
1102
1.00k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.00k
     , apply_cached_to<T>
1104
1.00k
     , cache_func_to<T>
1105
1.00k
     , external_cache
1106
1.00k
#endif
1107
1.00k
     );
1108
1109
1.00k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.00k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.00k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.00k
#endif
1125
1126
1.00k
    return hb_empty_t ();
1127
1.00k
  }
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&)
Line
Count
Source
1091
6.04k
  {
1092
6.04k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
6.04k
    void *external_cache = nullptr;
1094
6.04k
    if (i < 8)
1095
5.60k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
6.04k
#endif
1097
1098
6.04k
    hb_applicable_t *entry = &array[i++];
1099
1100
6.04k
    entry->init (obj,
1101
6.04k
     apply_to<T>
1102
6.04k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
6.04k
     , apply_cached_to<T>
1104
6.04k
     , cache_func_to<T>
1105
6.04k
     , external_cache
1106
6.04k
#endif
1107
6.04k
     );
1108
1109
6.04k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
6.04k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
6.04k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
6.04k
#endif
1125
1126
6.04k
    return hb_empty_t ();
1127
6.04k
  }
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&)
Line
Count
Source
1091
5.99k
  {
1092
5.99k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
5.99k
    void *external_cache = nullptr;
1094
5.99k
    if (i < 8)
1095
4.55k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
5.99k
#endif
1097
1098
5.99k
    hb_applicable_t *entry = &array[i++];
1099
1100
5.99k
    entry->init (obj,
1101
5.99k
     apply_to<T>
1102
5.99k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
5.99k
     , apply_cached_to<T>
1104
5.99k
     , cache_func_to<T>
1105
5.99k
     , external_cache
1106
5.99k
#endif
1107
5.99k
     );
1108
1109
5.99k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
5.99k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
5.99k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
5.99k
#endif
1125
1126
5.99k
    return hb_empty_t ();
1127
5.99k
  }
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&)
Line
Count
Source
1091
4.53k
  {
1092
4.53k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
4.53k
    void *external_cache = nullptr;
1094
4.53k
    if (i < 8)
1095
3.75k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
4.53k
#endif
1097
1098
4.53k
    hb_applicable_t *entry = &array[i++];
1099
1100
4.53k
    entry->init (obj,
1101
4.53k
     apply_to<T>
1102
4.53k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
4.53k
     , apply_cached_to<T>
1104
4.53k
     , cache_func_to<T>
1105
4.53k
     , external_cache
1106
4.53k
#endif
1107
4.53k
     );
1108
1109
4.53k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
4.53k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
4.53k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
4.53k
#endif
1125
1126
4.53k
    return hb_empty_t ();
1127
4.53k
  }
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&)
Line
Count
Source
1091
2.92k
  {
1092
2.92k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.92k
    void *external_cache = nullptr;
1094
2.92k
    if (i < 8)
1095
2.49k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.92k
#endif
1097
1098
2.92k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.92k
    entry->init (obj,
1101
2.92k
     apply_to<T>
1102
2.92k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.92k
     , apply_cached_to<T>
1104
2.92k
     , cache_func_to<T>
1105
2.92k
     , external_cache
1106
2.92k
#endif
1107
2.92k
     );
1108
1109
2.92k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.92k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.92k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.92k
#endif
1125
1126
2.92k
    return hb_empty_t ();
1127
2.92k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&)
Line
Count
Source
1091
2.42k
  {
1092
2.42k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.42k
    void *external_cache = nullptr;
1094
2.42k
    if (i < 8)
1095
1.70k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.42k
#endif
1097
1098
2.42k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.42k
    entry->init (obj,
1101
2.42k
     apply_to<T>
1102
2.42k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.42k
     , apply_cached_to<T>
1104
2.42k
     , cache_func_to<T>
1105
2.42k
     , external_cache
1106
2.42k
#endif
1107
2.42k
     );
1108
1109
2.42k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.42k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.42k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.42k
#endif
1125
1126
2.42k
    return hb_empty_t ();
1127
2.42k
  }
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&)
Line
Count
Source
1091
5.48k
  {
1092
5.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
5.48k
    void *external_cache = nullptr;
1094
5.48k
    if (i < 8)
1095
4.58k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
5.48k
#endif
1097
1098
5.48k
    hb_applicable_t *entry = &array[i++];
1099
1100
5.48k
    entry->init (obj,
1101
5.48k
     apply_to<T>
1102
5.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
5.48k
     , apply_cached_to<T>
1104
5.48k
     , cache_func_to<T>
1105
5.48k
     , external_cache
1106
5.48k
#endif
1107
5.48k
     );
1108
1109
5.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
5.48k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
5.48k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
5.48k
#endif
1125
1126
5.48k
    return hb_empty_t ();
1127
5.48k
  }
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&)
Line
Count
Source
1091
2.52k
  {
1092
2.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.52k
    void *external_cache = nullptr;
1094
2.52k
    if (i < 8)
1095
1.91k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.52k
#endif
1097
1098
2.52k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.52k
    entry->init (obj,
1101
2.52k
     apply_to<T>
1102
2.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.52k
     , apply_cached_to<T>
1104
2.52k
     , cache_func_to<T>
1105
2.52k
     , external_cache
1106
2.52k
#endif
1107
2.52k
     );
1108
1109
2.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.52k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.52k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.52k
#endif
1125
1126
2.52k
    return hb_empty_t ();
1127
2.52k
  }
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&)
Line
Count
Source
1091
1.19k
  {
1092
1.19k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.19k
    void *external_cache = nullptr;
1094
1.19k
    if (i < 8)
1095
608
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.19k
#endif
1097
1098
1.19k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.19k
    entry->init (obj,
1101
1.19k
     apply_to<T>
1102
1.19k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.19k
     , apply_cached_to<T>
1104
1.19k
     , cache_func_to<T>
1105
1.19k
     , external_cache
1106
1.19k
#endif
1107
1.19k
     );
1108
1109
1.19k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.19k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.19k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.19k
#endif
1125
1126
1.19k
    return hb_empty_t ();
1127
1.19k
  }
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&)
Line
Count
Source
1091
901
  {
1092
901
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
901
    void *external_cache = nullptr;
1094
901
    if (i < 8)
1095
468
      external_cache = external_cache_create (obj, hb_prioritize);
1096
901
#endif
1097
1098
901
    hb_applicable_t *entry = &array[i++];
1099
1100
901
    entry->init (obj,
1101
901
     apply_to<T>
1102
901
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
901
     , apply_cached_to<T>
1104
901
     , cache_func_to<T>
1105
901
     , external_cache
1106
901
#endif
1107
901
     );
1108
1109
901
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
901
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
901
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
901
#endif
1125
1126
901
    return hb_empty_t ();
1127
901
  }
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&)
Line
Count
Source
1091
1.51k
  {
1092
1.51k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.51k
    void *external_cache = nullptr;
1094
1.51k
    if (i < 8)
1095
990
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.51k
#endif
1097
1098
1.51k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.51k
    entry->init (obj,
1101
1.51k
     apply_to<T>
1102
1.51k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.51k
     , apply_cached_to<T>
1104
1.51k
     , cache_func_to<T>
1105
1.51k
     , external_cache
1106
1.51k
#endif
1107
1.51k
     );
1108
1109
1.51k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.51k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.51k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.51k
#endif
1125
1126
1.51k
    return hb_empty_t ();
1127
1.51k
  }
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&)
Line
Count
Source
1091
1.96k
  {
1092
1.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.96k
    void *external_cache = nullptr;
1094
1.96k
    if (i < 8)
1095
687
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.96k
#endif
1097
1098
1.96k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.96k
    entry->init (obj,
1101
1.96k
     apply_to<T>
1102
1.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.96k
     , apply_cached_to<T>
1104
1.96k
     , cache_func_to<T>
1105
1.96k
     , external_cache
1106
1.96k
#endif
1107
1.96k
     );
1108
1109
1.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.96k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.96k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.96k
#endif
1125
1126
1.96k
    return hb_empty_t ();
1127
1.96k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
1091
4.63k
  {
1092
4.63k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
4.63k
    void *external_cache = nullptr;
1094
4.63k
    if (i < 8)
1095
3.55k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
4.63k
#endif
1097
1098
4.63k
    hb_applicable_t *entry = &array[i++];
1099
1100
4.63k
    entry->init (obj,
1101
4.63k
     apply_to<T>
1102
4.63k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
4.63k
     , apply_cached_to<T>
1104
4.63k
     , cache_func_to<T>
1105
4.63k
     , external_cache
1106
4.63k
#endif
1107
4.63k
     );
1108
1109
4.63k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
4.63k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
4.63k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
4.63k
#endif
1125
1126
4.63k
    return hb_empty_t ();
1127
4.63k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
1091
7.52k
  {
1092
7.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
7.52k
    void *external_cache = nullptr;
1094
7.52k
    if (i < 8)
1095
4.36k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
7.52k
#endif
1097
1098
7.52k
    hb_applicable_t *entry = &array[i++];
1099
1100
7.52k
    entry->init (obj,
1101
7.52k
     apply_to<T>
1102
7.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
7.52k
     , apply_cached_to<T>
1104
7.52k
     , cache_func_to<T>
1105
7.52k
     , external_cache
1106
7.52k
#endif
1107
7.52k
     );
1108
1109
7.52k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
7.52k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
7.52k
    if (cost > subtable_cache_user_cost)
1120
1.03k
    {
1121
1.03k
      subtable_cache_user_idx = i - 1;
1122
1.03k
      subtable_cache_user_cost = cost;
1123
1.03k
    }
1124
7.52k
#endif
1125
1126
7.52k
    return hb_empty_t ();
1127
7.52k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&)
Line
Count
Source
1091
1.48k
  {
1092
1.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.48k
    void *external_cache = nullptr;
1094
1.48k
    if (i < 8)
1095
528
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.48k
#endif
1097
1098
1.48k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.48k
    entry->init (obj,
1101
1.48k
     apply_to<T>
1102
1.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.48k
     , apply_cached_to<T>
1104
1.48k
     , cache_func_to<T>
1105
1.48k
     , external_cache
1106
1.48k
#endif
1107
1.48k
     );
1108
1109
1.48k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.48k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.48k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.48k
#endif
1125
1126
1.48k
    return hb_empty_t ();
1127
1.48k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
1091
1.45k
  {
1092
1.45k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.45k
    void *external_cache = nullptr;
1094
1.45k
    if (i < 8)
1095
780
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.45k
#endif
1097
1098
1.45k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.45k
    entry->init (obj,
1101
1.45k
     apply_to<T>
1102
1.45k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.45k
     , apply_cached_to<T>
1104
1.45k
     , cache_func_to<T>
1105
1.45k
     , external_cache
1106
1.45k
#endif
1107
1.45k
     );
1108
1109
1.45k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.45k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.45k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.45k
#endif
1125
1126
1.45k
    return hb_empty_t ();
1127
1.45k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
1091
2.85k
  {
1092
2.85k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.85k
    void *external_cache = nullptr;
1094
2.85k
    if (i < 8)
1095
1.22k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.85k
#endif
1097
1098
2.85k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.85k
    entry->init (obj,
1101
2.85k
     apply_to<T>
1102
2.85k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.85k
     , apply_cached_to<T>
1104
2.85k
     , cache_func_to<T>
1105
2.85k
     , external_cache
1106
2.85k
#endif
1107
2.85k
     );
1108
1109
2.85k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.85k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.85k
    if (cost > subtable_cache_user_cost)
1120
605
    {
1121
605
      subtable_cache_user_idx = i - 1;
1122
605
      subtable_cache_user_cost = cost;
1123
605
    }
1124
2.85k
#endif
1125
1126
2.85k
    return hb_empty_t ();
1127
2.85k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
1091
3.30k
  {
1092
3.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
3.30k
    void *external_cache = nullptr;
1094
3.30k
    if (i < 8)
1095
2.62k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
3.30k
#endif
1097
1098
3.30k
    hb_applicable_t *entry = &array[i++];
1099
1100
3.30k
    entry->init (obj,
1101
3.30k
     apply_to<T>
1102
3.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
3.30k
     , apply_cached_to<T>
1104
3.30k
     , cache_func_to<T>
1105
3.30k
     , external_cache
1106
3.30k
#endif
1107
3.30k
     );
1108
1109
3.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
3.30k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
3.30k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
3.30k
#endif
1125
1126
3.30k
    return hb_empty_t ();
1127
3.30k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Line
Count
Source
1091
7.96k
  {
1092
7.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
7.96k
    void *external_cache = nullptr;
1094
7.96k
    if (i < 8)
1095
4.95k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
7.96k
#endif
1097
1098
7.96k
    hb_applicable_t *entry = &array[i++];
1099
1100
7.96k
    entry->init (obj,
1101
7.96k
     apply_to<T>
1102
7.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
7.96k
     , apply_cached_to<T>
1104
7.96k
     , cache_func_to<T>
1105
7.96k
     , external_cache
1106
7.96k
#endif
1107
7.96k
     );
1108
1109
7.96k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
7.96k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
7.96k
    if (cost > subtable_cache_user_cost)
1120
1.44k
    {
1121
1.44k
      subtable_cache_user_idx = i - 1;
1122
1.44k
      subtable_cache_user_cost = cost;
1123
1.44k
    }
1124
7.96k
#endif
1125
1126
7.96k
    return hb_empty_t ();
1127
7.96k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&)
Line
Count
Source
1091
2.30k
  {
1092
2.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.30k
    void *external_cache = nullptr;
1094
2.30k
    if (i < 8)
1095
1.94k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.30k
#endif
1097
1098
2.30k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.30k
    entry->init (obj,
1101
2.30k
     apply_to<T>
1102
2.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.30k
     , apply_cached_to<T>
1104
2.30k
     , cache_func_to<T>
1105
2.30k
     , external_cache
1106
2.30k
#endif
1107
2.30k
     );
1108
1109
2.30k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.30k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.30k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.30k
#endif
1125
1126
2.30k
    return hb_empty_t ();
1127
2.30k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
1091
1.97k
  {
1092
1.97k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.97k
    void *external_cache = nullptr;
1094
1.97k
    if (i < 8)
1095
1.16k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.97k
#endif
1097
1098
1.97k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.97k
    entry->init (obj,
1101
1.97k
     apply_to<T>
1102
1.97k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.97k
     , apply_cached_to<T>
1104
1.97k
     , cache_func_to<T>
1105
1.97k
     , external_cache
1106
1.97k
#endif
1107
1.97k
     );
1108
1109
1.97k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.97k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.97k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.97k
#endif
1125
1126
1.97k
    return hb_empty_t ();
1127
1.97k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Line
Count
Source
1091
5.36k
  {
1092
5.36k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
5.36k
    void *external_cache = nullptr;
1094
5.36k
    if (i < 8)
1095
1.54k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
5.36k
#endif
1097
1098
5.36k
    hb_applicable_t *entry = &array[i++];
1099
1100
5.36k
    entry->init (obj,
1101
5.36k
     apply_to<T>
1102
5.36k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
5.36k
     , apply_cached_to<T>
1104
5.36k
     , cache_func_to<T>
1105
5.36k
     , external_cache
1106
5.36k
#endif
1107
5.36k
     );
1108
1109
5.36k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
5.36k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
5.36k
    if (cost > subtable_cache_user_cost)
1120
349
    {
1121
349
      subtable_cache_user_idx = i - 1;
1122
349
      subtable_cache_user_cost = cost;
1123
349
    }
1124
5.36k
#endif
1125
1126
5.36k
    return hb_empty_t ();
1127
5.36k
  }
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&)
Line
Count
Source
1091
1.03k
  {
1092
1.03k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.03k
    void *external_cache = nullptr;
1094
1.03k
    if (i < 8)
1095
754
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.03k
#endif
1097
1098
1.03k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.03k
    entry->init (obj,
1101
1.03k
     apply_to<T>
1102
1.03k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.03k
     , apply_cached_to<T>
1104
1.03k
     , cache_func_to<T>
1105
1.03k
     , external_cache
1106
1.03k
#endif
1107
1.03k
     );
1108
1109
1.03k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.03k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.03k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.03k
#endif
1125
1126
1.03k
    return hb_empty_t ();
1127
1.03k
  }
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&)
Line
Count
Source
1091
2.21k
  {
1092
2.21k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.21k
    void *external_cache = nullptr;
1094
2.21k
    if (i < 8)
1095
1.98k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.21k
#endif
1097
1098
2.21k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.21k
    entry->init (obj,
1101
2.21k
     apply_to<T>
1102
2.21k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.21k
     , apply_cached_to<T>
1104
2.21k
     , cache_func_to<T>
1105
2.21k
     , external_cache
1106
2.21k
#endif
1107
2.21k
     );
1108
1109
2.21k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.21k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.21k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.21k
#endif
1125
1126
2.21k
    return hb_empty_t ();
1127
2.21k
  }
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&)
Line
Count
Source
1091
720
  {
1092
720
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
720
    void *external_cache = nullptr;
1094
720
    if (i < 8)
1095
230
      external_cache = external_cache_create (obj, hb_prioritize);
1096
720
#endif
1097
1098
720
    hb_applicable_t *entry = &array[i++];
1099
1100
720
    entry->init (obj,
1101
720
     apply_to<T>
1102
720
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
720
     , apply_cached_to<T>
1104
720
     , cache_func_to<T>
1105
720
     , external_cache
1106
720
#endif
1107
720
     );
1108
1109
720
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
720
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
720
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
720
#endif
1125
1126
720
    return hb_empty_t ();
1127
720
  }
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&)
Line
Count
Source
1091
747
  {
1092
747
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
747
    void *external_cache = nullptr;
1094
747
    if (i < 8)
1095
187
      external_cache = external_cache_create (obj, hb_prioritize);
1096
747
#endif
1097
1098
747
    hb_applicable_t *entry = &array[i++];
1099
1100
747
    entry->init (obj,
1101
747
     apply_to<T>
1102
747
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
747
     , apply_cached_to<T>
1104
747
     , cache_func_to<T>
1105
747
     , external_cache
1106
747
#endif
1107
747
     );
1108
1109
747
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
747
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
747
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
747
#endif
1125
1126
747
    return hb_empty_t ();
1127
747
  }
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&)
Line
Count
Source
1091
9.23k
  {
1092
9.23k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
9.23k
    void *external_cache = nullptr;
1094
9.23k
    if (i < 8)
1095
8.79k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
9.23k
#endif
1097
1098
9.23k
    hb_applicable_t *entry = &array[i++];
1099
1100
9.23k
    entry->init (obj,
1101
9.23k
     apply_to<T>
1102
9.23k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
9.23k
     , apply_cached_to<T>
1104
9.23k
     , cache_func_to<T>
1105
9.23k
     , external_cache
1106
9.23k
#endif
1107
9.23k
     );
1108
1109
9.23k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
9.23k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
9.23k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
9.23k
#endif
1125
1126
9.23k
    return hb_empty_t ();
1127
9.23k
  }
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&)
Line
Count
Source
1091
904
  {
1092
904
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
904
    void *external_cache = nullptr;
1094
904
    if (i < 8)
1095
263
      external_cache = external_cache_create (obj, hb_prioritize);
1096
904
#endif
1097
1098
904
    hb_applicable_t *entry = &array[i++];
1099
1100
904
    entry->init (obj,
1101
904
     apply_to<T>
1102
904
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
904
     , apply_cached_to<T>
1104
904
     , cache_func_to<T>
1105
904
     , external_cache
1106
904
#endif
1107
904
     );
1108
1109
904
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
904
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
904
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
904
#endif
1125
1126
904
    return hb_empty_t ();
1127
904
  }
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&)
Line
Count
Source
1091
1.78k
  {
1092
1.78k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
1.78k
    void *external_cache = nullptr;
1094
1.78k
    if (i < 8)
1095
1.36k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
1.78k
#endif
1097
1098
1.78k
    hb_applicable_t *entry = &array[i++];
1099
1100
1.78k
    entry->init (obj,
1101
1.78k
     apply_to<T>
1102
1.78k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
1.78k
     , apply_cached_to<T>
1104
1.78k
     , cache_func_to<T>
1105
1.78k
     , external_cache
1106
1.78k
#endif
1107
1.78k
     );
1108
1109
1.78k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
1.78k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
1.78k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
1.78k
#endif
1125
1126
1.78k
    return hb_empty_t ();
1127
1.78k
  }
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&)
Line
Count
Source
1091
787
  {
1092
787
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
787
    void *external_cache = nullptr;
1094
787
    if (i < 8)
1095
192
      external_cache = external_cache_create (obj, hb_prioritize);
1096
787
#endif
1097
1098
787
    hb_applicable_t *entry = &array[i++];
1099
1100
787
    entry->init (obj,
1101
787
     apply_to<T>
1102
787
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
787
     , apply_cached_to<T>
1104
787
     , cache_func_to<T>
1105
787
     , external_cache
1106
787
#endif
1107
787
     );
1108
1109
787
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
787
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
787
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
787
#endif
1125
1126
787
    return hb_empty_t ();
1127
787
  }
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&)
Line
Count
Source
1091
10.7k
  {
1092
10.7k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
10.7k
    void *external_cache = nullptr;
1094
10.7k
    if (i < 8)
1095
9.58k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
10.7k
#endif
1097
1098
10.7k
    hb_applicable_t *entry = &array[i++];
1099
1100
10.7k
    entry->init (obj,
1101
10.7k
     apply_to<T>
1102
10.7k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
10.7k
     , apply_cached_to<T>
1104
10.7k
     , cache_func_to<T>
1105
10.7k
     , external_cache
1106
10.7k
#endif
1107
10.7k
     );
1108
1109
10.7k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
10.7k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
10.7k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
10.7k
#endif
1125
1126
10.7k
    return hb_empty_t ();
1127
10.7k
  }
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&)
Line
Count
Source
1091
3.87k
  {
1092
3.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
3.87k
    void *external_cache = nullptr;
1094
3.87k
    if (i < 8)
1095
2.85k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
3.87k
#endif
1097
1098
3.87k
    hb_applicable_t *entry = &array[i++];
1099
1100
3.87k
    entry->init (obj,
1101
3.87k
     apply_to<T>
1102
3.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
3.87k
     , apply_cached_to<T>
1104
3.87k
     , cache_func_to<T>
1105
3.87k
     , external_cache
1106
3.87k
#endif
1107
3.87k
     );
1108
1109
3.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
3.87k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
3.87k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
3.87k
#endif
1125
1126
3.87k
    return hb_empty_t ();
1127
3.87k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&)
Line
Count
Source
1091
2.13k
  {
1092
2.13k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1093
2.13k
    void *external_cache = nullptr;
1094
2.13k
    if (i < 8)
1095
1.98k
      external_cache = external_cache_create (obj, hb_prioritize);
1096
2.13k
#endif
1097
1098
2.13k
    hb_applicable_t *entry = &array[i++];
1099
1100
2.13k
    entry->init (obj,
1101
2.13k
     apply_to<T>
1102
2.13k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1103
2.13k
     , apply_cached_to<T>
1104
2.13k
     , cache_func_to<T>
1105
2.13k
     , external_cache
1106
2.13k
#endif
1107
2.13k
     );
1108
1109
2.13k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1110
    /* Cache handling
1111
     *
1112
     * We allow one subtable from each lookup to use a cache. The assumption
1113
     * being that multiple subtables of the same lookup cannot use a cache
1114
     * because the resources they would use will collide.  As such, we ask
1115
     * each subtable to tell us how much it costs (which a cache would avoid),
1116
     * and we allocate the cache opportunity to the costliest subtable.
1117
     */
1118
2.13k
    unsigned cost = cache_cost (obj, hb_prioritize);
1119
2.13k
    if (cost > subtable_cache_user_cost)
1120
0
    {
1121
0
      subtable_cache_user_idx = i - 1;
1122
0
      subtable_cache_user_cost = cost;
1123
0
    }
1124
2.13k
#endif
1125
1126
2.13k
    return hb_empty_t ();
1127
2.13k
  }
1128
1.29M
  static return_t default_return_value () { return hb_empty_t (); }
1129
1130
  hb_accelerate_subtables_context_t (hb_applicable_t *array_) :
1131
66.1k
             array (array_) {}
1132
1133
  hb_applicable_t *array;
1134
  unsigned i = 0;
1135
1136
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1137
  unsigned subtable_cache_user_idx = (unsigned) -1;
1138
  unsigned subtable_cache_user_cost = 0;
1139
#endif
1140
};
1141
1142
1143
typedef bool (*intersects_func_t) (const hb_set_t *glyphs, unsigned value, const void *data, void *cache);
1144
typedef void (*intersected_glyphs_func_t) (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache);
1145
typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, unsigned value, const void *data);
1146
typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data);
1147
1148
struct ContextClosureFuncs
1149
{
1150
  intersects_func_t intersects;
1151
  intersected_glyphs_func_t intersected_glyphs;
1152
};
1153
struct ContextCollectGlyphsFuncs
1154
{
1155
  collect_glyphs_func_t collect;
1156
};
1157
struct ContextApplyFuncs
1158
{
1159
  match_func_t match;
1160
};
1161
struct ChainContextApplyFuncs
1162
{
1163
  match_func_t match[3];
1164
};
1165
1166
1167
static inline bool intersects_glyph (const hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED, void *cache HB_UNUSED)
1168
275M
{
1169
275M
  return glyphs->has (value);
1170
275M
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-face.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
1168
68.1M
{
1169
68.1M
  return glyphs->has (value);
1170
68.1M
}
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-serialize.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*)
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
1168
206M
{
1169
206M
  return glyphs->has (value);
1170
206M
}
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*)
1171
static inline bool intersects_class (const hb_set_t *glyphs, unsigned value, const void *data, void *cache)
1172
41.3k
{
1173
41.3k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1174
41.3k
  hb_map_t *map = (hb_map_t *) cache;
1175
1176
41.3k
  hb_codepoint_t *cached_v;
1177
41.3k
  if (map->has (value, &cached_v))
1178
27.8k
    return *cached_v;
1179
1180
13.4k
  bool v = class_def.intersects_class (glyphs, value);
1181
13.4k
  map->set (value, v);
1182
1183
13.4k
  return v;
1184
41.3k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-face.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
1172
11.8k
{
1173
11.8k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1174
11.8k
  hb_map_t *map = (hb_map_t *) cache;
1175
1176
11.8k
  hb_codepoint_t *cached_v;
1177
11.8k
  if (map->has (value, &cached_v))
1178
8.05k
    return *cached_v;
1179
1180
3.81k
  bool v = class_def.intersects_class (glyphs, value);
1181
3.81k
  map->set (value, v);
1182
1183
3.81k
  return v;
1184
11.8k
}
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-serialize.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*)
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
1172
29.4k
{
1173
29.4k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1174
29.4k
  hb_map_t *map = (hb_map_t *) cache;
1175
1176
29.4k
  hb_codepoint_t *cached_v;
1177
29.4k
  if (map->has (value, &cached_v))
1178
19.7k
    return *cached_v;
1179
1180
9.66k
  bool v = class_def.intersects_class (glyphs, value);
1181
9.66k
  map->set (value, v);
1182
1183
9.66k
  return v;
1184
29.4k
}
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*)
1185
static inline bool intersects_coverage (const hb_set_t *glyphs, unsigned value, const void *data, void *cache HB_UNUSED)
1186
78.1k
{
1187
78.1k
  Offset16To<Coverage> coverage;
1188
78.1k
  coverage = value;
1189
78.1k
  return (data+coverage).intersects (glyphs);
1190
78.1k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-face.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
1186
36.4k
{
1187
36.4k
  Offset16To<Coverage> coverage;
1188
36.4k
  coverage = value;
1189
36.4k
  return (data+coverage).intersects (glyphs);
1190
36.4k
}
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-serialize.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*)
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
1186
41.7k
{
1187
41.7k
  Offset16To<Coverage> coverage;
1188
41.7k
  coverage = value;
1189
41.7k
  return (data+coverage).intersects (glyphs);
1190
41.7k
}
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*)
1191
1192
1193
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)
1194
190k
{
1195
190k
  unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value];
1196
190k
  intersected_glyphs->add (g);
1197
190k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-face.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
1194
190k
{
1195
190k
  unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value];
1196
190k
  intersected_glyphs->add (g);
1197
190k
}
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-serialize.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*)
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*)
1198
1199
using intersected_class_cache_t = hb_hashmap_t<unsigned, hb_set_t>;
1200
1201
static inline void intersected_class_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache)
1202
2.43k
{
1203
2.43k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1204
1205
2.43k
  intersected_class_cache_t *map = (intersected_class_cache_t *) cache;
1206
1207
2.43k
  hb_set_t *cached_v;
1208
2.43k
  if (map->has (value, &cached_v))
1209
829
  {
1210
829
    intersected_glyphs->union_ (*cached_v);
1211
829
    return;
1212
829
  }
1213
1214
1.60k
  hb_set_t v;
1215
1.60k
  class_def.intersected_class_glyphs (glyphs, value, &v);
1216
1217
1.60k
  intersected_glyphs->union_ (v);
1218
1219
1.60k
  map->set (value, std::move (v));
1220
1.60k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-face.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
1202
2.43k
{
1203
2.43k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1204
1205
2.43k
  intersected_class_cache_t *map = (intersected_class_cache_t *) cache;
1206
1207
2.43k
  hb_set_t *cached_v;
1208
2.43k
  if (map->has (value, &cached_v))
1209
829
  {
1210
829
    intersected_glyphs->union_ (*cached_v);
1211
829
    return;
1212
829
  }
1213
1214
1.60k
  hb_set_t v;
1215
1.60k
  class_def.intersected_class_glyphs (glyphs, value, &v);
1216
1217
1.60k
  intersected_glyphs->union_ (v);
1218
1219
1.60k
  map->set (value, std::move (v));
1220
1.60k
}
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-serialize.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*)
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*)
1221
1222
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)
1223
4.42k
{
1224
4.42k
  Offset16To<Coverage> coverage;
1225
4.42k
  coverage = value;
1226
4.42k
  (data+coverage).intersect_set (*glyphs, *intersected_glyphs);
1227
4.42k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-face.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
1223
4.42k
{
1224
4.42k
  Offset16To<Coverage> coverage;
1225
4.42k
  coverage = value;
1226
4.42k
  (data+coverage).intersect_set (*glyphs, *intersected_glyphs);
1227
4.42k
}
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-serialize.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*)
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*)
1228
1229
1230
template <typename HBUINT>
1231
static inline bool array_is_subset_of (const hb_set_t *glyphs,
1232
               unsigned int count,
1233
               const HBUINT values[],
1234
               intersects_func_t intersects_func,
1235
               const void *intersects_data,
1236
               void *cache)
1237
1.66M
{
1238
1.66M
  for (const auto &_ : + hb_iter (values, count))
1239
275M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1240
1.60M
  return true;
1241
1.66M
}
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*)
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*)
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
1237
766k
{
1238
766k
  for (const auto &_ : + hb_iter (values, count))
1239
68.2M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1240
741k
  return true;
1241
766k
}
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*)
Line
Count
Source
1237
17.1k
{
1238
17.1k
  for (const auto &_ : + hb_iter (values, count))
1239
6.37k
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1240
15.6k
  return true;
1241
17.1k
}
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-serialize.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-serialize.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*)
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
1237
853k
{
1238
853k
  for (const auto &_ : + hb_iter (values, count))
1239
206M
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1240
824k
  return true;
1241
853k
}
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*)
Line
Count
Source
1237
23.2k
{
1238
23.2k
  for (const auto &_ : + hb_iter (values, count))
1239
7.70k
    if (!intersects_func (glyphs, _, intersects_data, cache)) return false;
1240
21.4k
  return true;
1241
23.2k
}
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*)
1242
1243
1244
static inline void collect_glyph (hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED)
1245
0
{
1246
0
  glyphs->add (value);
1247
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.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-serialize.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*)
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*)
1248
static inline void collect_class (hb_set_t *glyphs, unsigned value, const void *data)
1249
0
{
1250
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1251
0
  class_def.collect_class (glyphs, value);
1252
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.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-serialize.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*)
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*)
1253
static inline void collect_coverage (hb_set_t *glyphs, unsigned value, const void *data)
1254
0
{
1255
0
  Offset16To<Coverage> coverage;
1256
0
  coverage = value;
1257
0
  (data+coverage).collect_coverage (glyphs);
1258
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.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-serialize.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*)
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*)
1259
template <typename HBUINT>
1260
static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
1261
          hb_set_t *glyphs,
1262
          unsigned int count,
1263
          const HBUINT values[],
1264
          collect_glyphs_func_t collect_func,
1265
          const void *collect_data)
1266
0
{
1267
0
  return
1268
0
  + hb_iter (values, count)
1269
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
1270
0
  ;
1271
0
}
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-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-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-serialize.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*)
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*)
1272
1273
1274
static inline bool match_always (hb_glyph_info_t &info HB_UNUSED, unsigned value HB_UNUSED, const void *data HB_UNUSED)
1275
5.33M
{
1276
5.33M
  return true;
1277
5.33M
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1275
5.33M
{
1276
5.33M
  return true;
1277
5.33M
}
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-serialize.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*)
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*)
1278
static inline bool match_glyph (hb_glyph_info_t &info, unsigned value, const void *data HB_UNUSED)
1279
14.2M
{
1280
14.2M
  return info.codepoint == value;
1281
14.2M
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1279
14.2M
{
1280
14.2M
  return info.codepoint == value;
1281
14.2M
}
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-serialize.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*)
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*)
1282
static inline bool match_class (hb_glyph_info_t &info, unsigned value, const void *data)
1283
247k
{
1284
247k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1285
247k
  return class_def.get_class (info.codepoint) == value;
1286
247k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1283
247k
{
1284
247k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1285
247k
  return class_def.get_class (info.codepoint) == value;
1286
247k
}
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-serialize.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*)
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*)
1287
static inline unsigned get_class_cached (const ClassDef &class_def, hb_glyph_info_t &info)
1288
780k
{
1289
780k
  unsigned klass = info.syllable();
1290
780k
  if (klass < 255)
1291
520k
    return klass;
1292
259k
  klass = class_def.get_class (info.codepoint);
1293
259k
  if (likely (klass < 255))
1294
256k
    info.syllable() = klass;
1295
259k
  return klass;
1296
780k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
hb-ot-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Line
Count
Source
1288
780k
{
1289
780k
  unsigned klass = info.syllable();
1290
780k
  if (klass < 255)
1291
520k
    return klass;
1292
259k
  klass = class_def.get_class (info.codepoint);
1293
259k
  if (likely (klass < 255))
1294
256k
    info.syllable() = klass;
1295
259k
  return klass;
1296
780k
}
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-serialize.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&)
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&)
1297
static inline bool match_class_cached (hb_glyph_info_t &info, unsigned value, const void *data)
1298
603k
{
1299
603k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1300
603k
  return get_class_cached (class_def, info) == value;
1301
603k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1298
603k
{
1299
603k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1300
603k
  return get_class_cached (class_def, info) == value;
1301
603k
}
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-serialize.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*)
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*)
1302
static inline unsigned get_class_cached1 (const ClassDef &class_def, hb_glyph_info_t &info)
1303
41.9k
{
1304
41.9k
  unsigned klass = info.syllable() & 0x0F;
1305
41.9k
  if (klass < 15)
1306
21.9k
    return klass;
1307
19.9k
  klass = class_def.get_class (info.codepoint);
1308
19.9k
  if (likely (klass < 15))
1309
18.9k
    info.syllable() = (info.syllable() & 0xF0) | klass;
1310
19.9k
  return klass;
1311
41.9k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
hb-ot-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Line
Count
Source
1303
41.9k
{
1304
41.9k
  unsigned klass = info.syllable() & 0x0F;
1305
41.9k
  if (klass < 15)
1306
21.9k
    return klass;
1307
19.9k
  klass = class_def.get_class (info.codepoint);
1308
19.9k
  if (likely (klass < 15))
1309
18.9k
    info.syllable() = (info.syllable() & 0xF0) | klass;
1310
19.9k
  return klass;
1311
41.9k
}
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-serialize.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&)
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&)
1312
static inline bool match_class_cached1 (hb_glyph_info_t &info, unsigned value, const void *data)
1313
41.9k
{
1314
41.9k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1315
41.9k
  return get_class_cached1 (class_def, info) == value;
1316
41.9k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1313
41.9k
{
1314
41.9k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1315
41.9k
  return get_class_cached1 (class_def, info) == value;
1316
41.9k
}
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-serialize.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*)
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*)
1317
static inline unsigned get_class_cached2 (const ClassDef &class_def, hb_glyph_info_t &info)
1318
323k
{
1319
323k
  unsigned klass = (info.syllable() & 0xF0) >> 4;
1320
323k
  if (klass < 15)
1321
146k
    return klass;
1322
176k
  klass = class_def.get_class (info.codepoint);
1323
176k
  if (likely (klass < 15))
1324
161k
    info.syllable() = (info.syllable() & 0x0F) | (klass << 4);
1325
176k
  return klass;
1326
323k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
hb-ot-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Line
Count
Source
1318
323k
{
1319
323k
  unsigned klass = (info.syllable() & 0xF0) >> 4;
1320
323k
  if (klass < 15)
1321
146k
    return klass;
1322
176k
  klass = class_def.get_class (info.codepoint);
1323
176k
  if (likely (klass < 15))
1324
161k
    info.syllable() = (info.syllable() & 0x0F) | (klass << 4);
1325
176k
  return klass;
1326
323k
}
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-serialize.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&)
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&)
1327
static inline bool match_class_cached2 (hb_glyph_info_t &info, unsigned value, const void *data)
1328
175k
{
1329
175k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1330
175k
  return get_class_cached2 (class_def, info) == value;
1331
175k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1328
175k
{
1329
175k
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1330
175k
  return get_class_cached2 (class_def, info) == value;
1331
175k
}
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-serialize.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*)
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*)
1332
static inline bool match_coverage (hb_glyph_info_t &info, unsigned value, const void *data)
1333
637k
{
1334
637k
  Offset16To<Coverage> coverage;
1335
637k
  coverage = value;
1336
637k
  return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED;
1337
637k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
hb-ot-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Line
Count
Source
1333
637k
{
1334
637k
  Offset16To<Coverage> coverage;
1335
637k
  coverage = value;
1336
637k
  return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED;
1337
637k
}
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-serialize.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*)
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*)
1338
1339
template <typename HBUINT>
1340
static inline bool would_match_input (hb_would_apply_context_t *c,
1341
              unsigned int count, /* Including the first glyph (not matched) */
1342
              const HBUINT input[], /* Array of input values--start with second glyph */
1343
              match_func_t match_func,
1344
              const void *match_data)
1345
29.4k
{
1346
29.4k
  if (count != c->len)
1347
21.0k
    return false;
1348
1349
10.0k
  for (unsigned int i = 1; i < count; i++)
1350
9.29k
  {
1351
9.29k
    hb_glyph_info_t info;
1352
9.29k
    info.codepoint = c->glyphs[i];
1353
9.29k
    if (likely (!match_func (info, input[i - 1], match_data)))
1354
7.66k
      return false;
1355
9.29k
  }
1356
1357
734
  return true;
1358
8.40k
}
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-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*)
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*)
Line
Count
Source
1345
21.3k
{
1346
21.3k
  if (count != c->len)
1347
13.4k
    return false;
1348
1349
9.24k
  for (unsigned int i = 1; i < count; i++)
1350
8.53k
  {
1351
8.53k
    hb_glyph_info_t info;
1352
8.53k
    info.codepoint = c->glyphs[i];
1353
8.53k
    if (likely (!match_func (info, input[i - 1], match_data)))
1354
7.14k
      return false;
1355
8.53k
  }
1356
1357
713
  return true;
1358
7.85k
}
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*)
Line
Count
Source
1345
8.05k
{
1346
8.05k
  if (count != c->len)
1347
7.50k
    return false;
1348
1349
788
  for (unsigned int i = 1; i < count; i++)
1350
767
  {
1351
767
    hb_glyph_info_t info;
1352
767
    info.codepoint = c->glyphs[i];
1353
767
    if (likely (!match_func (info, input[i - 1], match_data)))
1354
525
      return false;
1355
767
  }
1356
1357
21
  return true;
1358
546
}
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-serialize.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*)
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*)
1359
template <typename HBUINT>
1360
#ifndef HB_OPTIMIZE_SIZE
1361
HB_ALWAYS_INLINE
1362
#endif
1363
static bool match_input (hb_ot_apply_context_t *c,
1364
       unsigned int count, /* Including the first glyph (not matched) */
1365
       const HBUINT input[], /* Array of input values--start with second glyph */
1366
       match_func_t match_func,
1367
       const void *match_data,
1368
       unsigned int *end_position,
1369
       unsigned int *p_total_component_count = nullptr)
1370
7.62M
{
1371
7.62M
  TRACE_APPLY (nullptr);
1372
1373
7.62M
  hb_buffer_t *buffer = c->buffer;
1374
1375
7.62M
  if (count == 1)
1376
269k
  {
1377
269k
    *end_position = buffer->idx + 1;
1378
269k
    c->match_positions[0] = buffer->idx;
1379
269k
    if (p_total_component_count)
1380
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1381
269k
    return_trace (true);
1382
269k
  }
1383
1384
7.35M
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1385
1386
7.35M
  auto &skippy_iter = c->iter_input;
1387
7.35M
  skippy_iter.reset (buffer->idx);
1388
7.35M
  skippy_iter.set_match_func (match_func, match_data);
1389
7.35M
  skippy_iter.set_glyph_data (input);
1390
1391
  /*
1392
   * This is perhaps the trickiest part of OpenType...  Remarks:
1393
   *
1394
   * - If all components of the ligature were marks, we call this a mark ligature.
1395
   *
1396
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1397
   *   it as a ligature glyph.
1398
   *
1399
   * - Ligatures cannot be formed across glyphs attached to different components
1400
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1401
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1402
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1403
   *   There are a couple of exceptions to this:
1404
   *
1405
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1406
   *     assuming that the font designer knows what they are doing (otherwise it can
1407
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1408
   *
1409
   *   o If two marks want to ligate and they belong to different components of the
1410
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1411
   *     mark-filtering rules, then allow.
1412
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1413
   */
1414
1415
7.35M
  unsigned int total_component_count = 0;
1416
1417
7.35M
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1418
7.35M
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1419
1420
7.35M
  enum {
1421
7.35M
    LIGBASE_NOT_CHECKED,
1422
7.35M
    LIGBASE_MAY_NOT_SKIP,
1423
7.35M
    LIGBASE_MAY_SKIP
1424
7.35M
  } ligbase = LIGBASE_NOT_CHECKED;
1425
1426
12.3M
  for (unsigned int i = 1; i < count; i++)
1427
9.20M
  {
1428
9.20M
    unsigned unsafe_to;
1429
9.20M
    if (!skippy_iter.next (&unsafe_to))
1430
4.19M
    {
1431
4.19M
      *end_position = unsafe_to;
1432
4.19M
      return_trace (false);
1433
4.19M
    }
1434
1435
5.00M
    if (unlikely (i + 1 > c->match_positions.length &&
1436
5.00M
      !c->match_positions.resize_dirty  (i + 1)))
1437
2.67k
      return_trace (false);
1438
5.00M
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1439
1440
5.00M
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1441
5.00M
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1442
1443
5.00M
    if (first_lig_id && first_lig_comp)
1444
67.5k
    {
1445
      /* If first component was attached to a previous ligature component,
1446
       * all subsequent components should be attached to the same ligature
1447
       * component, otherwise we shouldn't ligate them... */
1448
67.5k
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1449
42.1k
      {
1450
  /* ...unless, we are attached to a base ligature and that base
1451
   * ligature is ignorable. */
1452
42.1k
  if (ligbase == LIGBASE_NOT_CHECKED)
1453
40.2k
  {
1454
40.2k
    bool found = false;
1455
40.2k
    const auto *out = buffer->out_info;
1456
40.2k
    unsigned int j = buffer->out_len;
1457
1.00M
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1458
1.00M
    {
1459
1.00M
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1460
35.9k
      {
1461
35.9k
        j--;
1462
35.9k
        found = true;
1463
35.9k
        break;
1464
35.9k
      }
1465
964k
      j--;
1466
964k
    }
1467
1468
40.2k
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1469
25.7k
      ligbase = LIGBASE_MAY_SKIP;
1470
14.4k
    else
1471
14.4k
      ligbase = LIGBASE_MAY_NOT_SKIP;
1472
40.2k
  }
1473
1474
42.1k
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1475
14.4k
    return_trace (false);
1476
42.1k
      }
1477
67.5k
    }
1478
4.93M
    else
1479
4.93M
    {
1480
      /* If first component was NOT attached to a previous ligature component,
1481
       * all subsequent components should also NOT be attached to any ligature
1482
       * component, unless they are attached to the first component itself! */
1483
4.93M
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1484
6.94k
  return_trace (false);
1485
4.93M
    }
1486
1487
4.98M
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1488
4.98M
  }
1489
1490
3.13M
  *end_position = skippy_iter.idx + 1;
1491
1492
3.13M
  if (p_total_component_count)
1493
434k
  {
1494
434k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1495
434k
    *p_total_component_count = total_component_count;
1496
434k
  }
1497
1498
3.13M
  c->match_positions.arrayZ[0] = buffer->idx;
1499
1500
3.13M
  return_trace (true);
1501
7.35M
}
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-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*)
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*)
Line
Count
Source
1370
1.60M
{
1371
1.60M
  TRACE_APPLY (nullptr);
1372
1373
1.60M
  hb_buffer_t *buffer = c->buffer;
1374
1375
1.60M
  if (count == 1)
1376
0
  {
1377
0
    *end_position = buffer->idx + 1;
1378
0
    c->match_positions[0] = buffer->idx;
1379
0
    if (p_total_component_count)
1380
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1381
0
    return_trace (true);
1382
0
  }
1383
1384
1.60M
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1385
1386
1.60M
  auto &skippy_iter = c->iter_input;
1387
1.60M
  skippy_iter.reset (buffer->idx);
1388
1.60M
  skippy_iter.set_match_func (match_func, match_data);
1389
1.60M
  skippy_iter.set_glyph_data (input);
1390
1391
  /*
1392
   * This is perhaps the trickiest part of OpenType...  Remarks:
1393
   *
1394
   * - If all components of the ligature were marks, we call this a mark ligature.
1395
   *
1396
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1397
   *   it as a ligature glyph.
1398
   *
1399
   * - Ligatures cannot be formed across glyphs attached to different components
1400
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1401
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1402
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1403
   *   There are a couple of exceptions to this:
1404
   *
1405
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1406
   *     assuming that the font designer knows what they are doing (otherwise it can
1407
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1408
   *
1409
   *   o If two marks want to ligate and they belong to different components of the
1410
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1411
   *     mark-filtering rules, then allow.
1412
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1413
   */
1414
1415
1.60M
  unsigned int total_component_count = 0;
1416
1417
1.60M
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1418
1.60M
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1419
1420
1.60M
  enum {
1421
1.60M
    LIGBASE_NOT_CHECKED,
1422
1.60M
    LIGBASE_MAY_NOT_SKIP,
1423
1.60M
    LIGBASE_MAY_SKIP
1424
1.60M
  } ligbase = LIGBASE_NOT_CHECKED;
1425
1426
3.14M
  for (unsigned int i = 1; i < count; i++)
1427
2.71M
  {
1428
2.71M
    unsigned unsafe_to;
1429
2.71M
    if (!skippy_iter.next (&unsafe_to))
1430
1.15M
    {
1431
1.15M
      *end_position = unsafe_to;
1432
1.15M
      return_trace (false);
1433
1.15M
    }
1434
1435
1.55M
    if (unlikely (i + 1 > c->match_positions.length &&
1436
1.55M
      !c->match_positions.resize_dirty  (i + 1)))
1437
423
      return_trace (false);
1438
1.55M
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1439
1440
1.55M
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1441
1.55M
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1442
1443
1.55M
    if (first_lig_id && first_lig_comp)
1444
21.2k
    {
1445
      /* If first component was attached to a previous ligature component,
1446
       * all subsequent components should be attached to the same ligature
1447
       * component, otherwise we shouldn't ligate them... */
1448
21.2k
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1449
14.2k
      {
1450
  /* ...unless, we are attached to a base ligature and that base
1451
   * ligature is ignorable. */
1452
14.2k
  if (ligbase == LIGBASE_NOT_CHECKED)
1453
12.9k
  {
1454
12.9k
    bool found = false;
1455
12.9k
    const auto *out = buffer->out_info;
1456
12.9k
    unsigned int j = buffer->out_len;
1457
183k
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1458
183k
    {
1459
183k
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1460
12.2k
      {
1461
12.2k
        j--;
1462
12.2k
        found = true;
1463
12.2k
        break;
1464
12.2k
      }
1465
170k
      j--;
1466
170k
    }
1467
1468
12.9k
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1469
5.48k
      ligbase = LIGBASE_MAY_SKIP;
1470
7.42k
    else
1471
7.42k
      ligbase = LIGBASE_MAY_NOT_SKIP;
1472
12.9k
  }
1473
1474
14.2k
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1475
7.42k
    return_trace (false);
1476
14.2k
      }
1477
21.2k
    }
1478
1.53M
    else
1479
1.53M
    {
1480
      /* If first component was NOT attached to a previous ligature component,
1481
       * all subsequent components should also NOT be attached to any ligature
1482
       * component, unless they are attached to the first component itself! */
1483
1.53M
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1484
1.32k
  return_trace (false);
1485
1.53M
    }
1486
1487
1.54M
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1488
1.54M
  }
1489
1490
433k
  *end_position = skippy_iter.idx + 1;
1491
1492
433k
  if (p_total_component_count)
1493
433k
  {
1494
433k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1495
433k
    *p_total_component_count = total_component_count;
1496
433k
  }
1497
1498
433k
  c->match_positions.arrayZ[0] = buffer->idx;
1499
1500
433k
  return_trace (true);
1501
1.60M
}
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*)
Line
Count
Source
1370
38.9k
{
1371
38.9k
  TRACE_APPLY (nullptr);
1372
1373
38.9k
  hb_buffer_t *buffer = c->buffer;
1374
1375
38.9k
  if (count == 1)
1376
0
  {
1377
0
    *end_position = buffer->idx + 1;
1378
0
    c->match_positions[0] = buffer->idx;
1379
0
    if (p_total_component_count)
1380
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1381
0
    return_trace (true);
1382
0
  }
1383
1384
38.9k
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1385
1386
38.9k
  auto &skippy_iter = c->iter_input;
1387
38.9k
  skippy_iter.reset (buffer->idx);
1388
38.9k
  skippy_iter.set_match_func (match_func, match_data);
1389
38.9k
  skippy_iter.set_glyph_data (input);
1390
1391
  /*
1392
   * This is perhaps the trickiest part of OpenType...  Remarks:
1393
   *
1394
   * - If all components of the ligature were marks, we call this a mark ligature.
1395
   *
1396
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1397
   *   it as a ligature glyph.
1398
   *
1399
   * - Ligatures cannot be formed across glyphs attached to different components
1400
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1401
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1402
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1403
   *   There are a couple of exceptions to this:
1404
   *
1405
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1406
   *     assuming that the font designer knows what they are doing (otherwise it can
1407
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1408
   *
1409
   *   o If two marks want to ligate and they belong to different components of the
1410
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1411
   *     mark-filtering rules, then allow.
1412
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1413
   */
1414
1415
38.9k
  unsigned int total_component_count = 0;
1416
1417
38.9k
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1418
38.9k
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1419
1420
38.9k
  enum {
1421
38.9k
    LIGBASE_NOT_CHECKED,
1422
38.9k
    LIGBASE_MAY_NOT_SKIP,
1423
38.9k
    LIGBASE_MAY_SKIP
1424
38.9k
  } ligbase = LIGBASE_NOT_CHECKED;
1425
1426
93.8k
  for (unsigned int i = 1; i < count; i++)
1427
92.7k
  {
1428
92.7k
    unsigned unsafe_to;
1429
92.7k
    if (!skippy_iter.next (&unsafe_to))
1430
37.3k
    {
1431
37.3k
      *end_position = unsafe_to;
1432
37.3k
      return_trace (false);
1433
37.3k
    }
1434
1435
55.4k
    if (unlikely (i + 1 > c->match_positions.length &&
1436
55.4k
      !c->match_positions.resize_dirty  (i + 1)))
1437
252
      return_trace (false);
1438
55.1k
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1439
1440
55.1k
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1441
55.1k
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1442
1443
55.1k
    if (first_lig_id && first_lig_comp)
1444
787
    {
1445
      /* If first component was attached to a previous ligature component,
1446
       * all subsequent components should be attached to the same ligature
1447
       * component, otherwise we shouldn't ligate them... */
1448
787
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1449
681
      {
1450
  /* ...unless, we are attached to a base ligature and that base
1451
   * ligature is ignorable. */
1452
681
  if (ligbase == LIGBASE_NOT_CHECKED)
1453
425
  {
1454
425
    bool found = false;
1455
425
    const auto *out = buffer->out_info;
1456
425
    unsigned int j = buffer->out_len;
1457
762
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1458
651
    {
1459
651
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1460
314
      {
1461
314
        j--;
1462
314
        found = true;
1463
314
        break;
1464
314
      }
1465
337
      j--;
1466
337
    }
1467
1468
425
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1469
182
      ligbase = LIGBASE_MAY_SKIP;
1470
243
    else
1471
243
      ligbase = LIGBASE_MAY_NOT_SKIP;
1472
425
  }
1473
1474
681
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1475
243
    return_trace (false);
1476
681
      }
1477
787
    }
1478
54.3k
    else
1479
54.3k
    {
1480
      /* If first component was NOT attached to a previous ligature component,
1481
       * all subsequent components should also NOT be attached to any ligature
1482
       * component, unless they are attached to the first component itself! */
1483
54.3k
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1484
81
  return_trace (false);
1485
54.3k
    }
1486
1487
54.8k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1488
54.8k
  }
1489
1490
1.07k
  *end_position = skippy_iter.idx + 1;
1491
1492
1.07k
  if (p_total_component_count)
1493
1.07k
  {
1494
1.07k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1495
1.07k
    *p_total_component_count = total_component_count;
1496
1.07k
  }
1497
1498
1.07k
  c->match_positions.arrayZ[0] = buffer->idx;
1499
1500
1.07k
  return_trace (true);
1501
38.9k
}
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*)
Line
Count
Source
1370
4.98M
{
1371
4.98M
  TRACE_APPLY (nullptr);
1372
1373
4.98M
  hb_buffer_t *buffer = c->buffer;
1374
1375
4.98M
  if (count == 1)
1376
257k
  {
1377
257k
    *end_position = buffer->idx + 1;
1378
257k
    c->match_positions[0] = buffer->idx;
1379
257k
    if (p_total_component_count)
1380
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1381
257k
    return_trace (true);
1382
257k
  }
1383
1384
4.72M
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1385
1386
4.72M
  auto &skippy_iter = c->iter_input;
1387
4.72M
  skippy_iter.reset (buffer->idx);
1388
4.72M
  skippy_iter.set_match_func (match_func, match_data);
1389
4.72M
  skippy_iter.set_glyph_data (input);
1390
1391
  /*
1392
   * This is perhaps the trickiest part of OpenType...  Remarks:
1393
   *
1394
   * - If all components of the ligature were marks, we call this a mark ligature.
1395
   *
1396
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1397
   *   it as a ligature glyph.
1398
   *
1399
   * - Ligatures cannot be formed across glyphs attached to different components
1400
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1401
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1402
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1403
   *   There are a couple of exceptions to this:
1404
   *
1405
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1406
   *     assuming that the font designer knows what they are doing (otherwise it can
1407
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1408
   *
1409
   *   o If two marks want to ligate and they belong to different components of the
1410
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1411
   *     mark-filtering rules, then allow.
1412
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1413
   */
1414
1415
4.72M
  unsigned int total_component_count = 0;
1416
1417
4.72M
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1418
4.72M
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1419
1420
4.72M
  enum {
1421
4.72M
    LIGBASE_NOT_CHECKED,
1422
4.72M
    LIGBASE_MAY_NOT_SKIP,
1423
4.72M
    LIGBASE_MAY_SKIP
1424
4.72M
  } ligbase = LIGBASE_NOT_CHECKED;
1425
1426
7.01M
  for (unsigned int i = 1; i < count; i++)
1427
5.05M
  {
1428
5.05M
    unsigned unsafe_to;
1429
5.05M
    if (!skippy_iter.next (&unsafe_to))
1430
2.75M
    {
1431
2.75M
      *end_position = unsafe_to;
1432
2.75M
      return_trace (false);
1433
2.75M
    }
1434
1435
2.30M
    if (unlikely (i + 1 > c->match_positions.length &&
1436
2.30M
      !c->match_positions.resize_dirty  (i + 1)))
1437
836
      return_trace (false);
1438
2.30M
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1439
1440
2.30M
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1441
2.30M
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1442
1443
2.30M
    if (first_lig_id && first_lig_comp)
1444
45.5k
    {
1445
      /* If first component was attached to a previous ligature component,
1446
       * all subsequent components should be attached to the same ligature
1447
       * component, otherwise we shouldn't ligate them... */
1448
45.5k
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1449
27.2k
      {
1450
  /* ...unless, we are attached to a base ligature and that base
1451
   * ligature is ignorable. */
1452
27.2k
  if (ligbase == LIGBASE_NOT_CHECKED)
1453
26.8k
  {
1454
26.8k
    bool found = false;
1455
26.8k
    const auto *out = buffer->out_info;
1456
26.8k
    unsigned int j = buffer->out_len;
1457
820k
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1458
817k
    {
1459
817k
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1460
23.3k
      {
1461
23.3k
        j--;
1462
23.3k
        found = true;
1463
23.3k
        break;
1464
23.3k
      }
1465
793k
      j--;
1466
793k
    }
1467
1468
26.8k
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1469
20.1k
      ligbase = LIGBASE_MAY_SKIP;
1470
6.76k
    else
1471
6.76k
      ligbase = LIGBASE_MAY_NOT_SKIP;
1472
26.8k
  }
1473
1474
27.2k
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1475
6.76k
    return_trace (false);
1476
27.2k
      }
1477
45.5k
    }
1478
2.25M
    else
1479
2.25M
    {
1480
      /* If first component was NOT attached to a previous ligature component,
1481
       * all subsequent components should also NOT be attached to any ligature
1482
       * component, unless they are attached to the first component itself! */
1483
2.25M
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1484
5.54k
  return_trace (false);
1485
2.25M
    }
1486
1487
2.29M
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1488
2.29M
  }
1489
1490
1.95M
  *end_position = skippy_iter.idx + 1;
1491
1492
1.95M
  if (p_total_component_count)
1493
0
  {
1494
0
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1495
0
    *p_total_component_count = total_component_count;
1496
0
  }
1497
1498
1.95M
  c->match_positions.arrayZ[0] = buffer->idx;
1499
1500
1.95M
  return_trace (true);
1501
4.72M
}
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*)
Line
Count
Source
1370
1.00M
{
1371
1.00M
  TRACE_APPLY (nullptr);
1372
1373
1.00M
  hb_buffer_t *buffer = c->buffer;
1374
1375
1.00M
  if (count == 1)
1376
11.3k
  {
1377
11.3k
    *end_position = buffer->idx + 1;
1378
11.3k
    c->match_positions[0] = buffer->idx;
1379
11.3k
    if (p_total_component_count)
1380
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1381
11.3k
    return_trace (true);
1382
11.3k
  }
1383
1384
993k
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1385
1386
993k
  auto &skippy_iter = c->iter_input;
1387
993k
  skippy_iter.reset (buffer->idx);
1388
993k
  skippy_iter.set_match_func (match_func, match_data);
1389
993k
  skippy_iter.set_glyph_data (input);
1390
1391
  /*
1392
   * This is perhaps the trickiest part of OpenType...  Remarks:
1393
   *
1394
   * - If all components of the ligature were marks, we call this a mark ligature.
1395
   *
1396
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1397
   *   it as a ligature glyph.
1398
   *
1399
   * - Ligatures cannot be formed across glyphs attached to different components
1400
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1401
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1402
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1403
   *   There are a couple of exceptions to this:
1404
   *
1405
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1406
   *     assuming that the font designer knows what they are doing (otherwise it can
1407
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1408
   *
1409
   *   o If two marks want to ligate and they belong to different components of the
1410
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1411
   *     mark-filtering rules, then allow.
1412
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1413
   */
1414
1415
993k
  unsigned int total_component_count = 0;
1416
1417
993k
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1418
993k
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1419
1420
993k
  enum {
1421
993k
    LIGBASE_NOT_CHECKED,
1422
993k
    LIGBASE_MAY_NOT_SKIP,
1423
993k
    LIGBASE_MAY_SKIP
1424
993k
  } ligbase = LIGBASE_NOT_CHECKED;
1425
1426
2.08M
  for (unsigned int i = 1; i < count; i++)
1427
1.33M
  {
1428
1.33M
    unsigned unsafe_to;
1429
1.33M
    if (!skippy_iter.next (&unsafe_to))
1430
244k
    {
1431
244k
      *end_position = unsafe_to;
1432
244k
      return_trace (false);
1433
244k
    }
1434
1435
1.09M
    if (unlikely (i + 1 > c->match_positions.length &&
1436
1.09M
      !c->match_positions.resize_dirty  (i + 1)))
1437
1.16k
      return_trace (false);
1438
1.09M
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1439
1440
1.09M
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
1441
1.09M
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
1442
1443
1.09M
    if (first_lig_id && first_lig_comp)
1444
0
    {
1445
      /* If first component was attached to a previous ligature component,
1446
       * all subsequent components should be attached to the same ligature
1447
       * component, otherwise we shouldn't ligate them... */
1448
0
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
1449
0
      {
1450
  /* ...unless, we are attached to a base ligature and that base
1451
   * ligature is ignorable. */
1452
0
  if (ligbase == LIGBASE_NOT_CHECKED)
1453
0
  {
1454
0
    bool found = false;
1455
0
    const auto *out = buffer->out_info;
1456
0
    unsigned int j = buffer->out_len;
1457
0
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
1458
0
    {
1459
0
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
1460
0
      {
1461
0
        j--;
1462
0
        found = true;
1463
0
        break;
1464
0
      }
1465
0
      j--;
1466
0
    }
1467
1468
0
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
1469
0
      ligbase = LIGBASE_MAY_SKIP;
1470
0
    else
1471
0
      ligbase = LIGBASE_MAY_NOT_SKIP;
1472
0
  }
1473
1474
0
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
1475
0
    return_trace (false);
1476
0
      }
1477
0
    }
1478
1.09M
    else
1479
1.09M
    {
1480
      /* If first component was NOT attached to a previous ligature component,
1481
       * all subsequent components should also NOT be attached to any ligature
1482
       * component, unless they are attached to the first component itself! */
1483
1.09M
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
1484
0
  return_trace (false);
1485
1.09M
    }
1486
1487
1.09M
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]);
1488
1.09M
  }
1489
1490
747k
  *end_position = skippy_iter.idx + 1;
1491
1492
747k
  if (p_total_component_count)
1493
0
  {
1494
0
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1495
0
    *p_total_component_count = total_component_count;
1496
0
  }
1497
1498
747k
  c->match_positions.arrayZ[0] = buffer->idx;
1499
1500
747k
  return_trace (true);
1501
993k
}
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-serialize.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*)
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*)
1502
static inline bool ligate_input (hb_ot_apply_context_t *c,
1503
         unsigned int count, /* Including the first glyph */
1504
         unsigned int match_end,
1505
         hb_codepoint_t lig_glyph,
1506
         unsigned int total_component_count)
1507
434k
{
1508
434k
  TRACE_APPLY (nullptr);
1509
1510
434k
  hb_buffer_t *buffer = c->buffer;
1511
1512
434k
  buffer->merge_clusters (buffer->idx, match_end);
1513
1514
  /* - If a base and one or more marks ligate, consider that as a base, NOT
1515
   *   ligature, such that all following marks can still attach to it.
1516
   *   https://github.com/harfbuzz/harfbuzz/issues/1109
1517
   *
1518
   * - If all components of the ligature were marks, we call this a mark ligature.
1519
   *   If it *is* a mark ligature, we don't allocate a new ligature id, and leave
1520
   *   the ligature to keep its old ligature id.  This will allow it to attach to
1521
   *   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
1522
   *   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
1523
   *   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
1524
   *   later, we don't want them to lose their ligature id/component, otherwise
1525
   *   GPOS will fail to correctly position the mark ligature on top of the
1526
   *   LAM,LAM,HEH ligature.  See:
1527
   *     https://bugzilla.gnome.org/show_bug.cgi?id=676343
1528
   *
1529
   * - If a ligature is formed of components that some of which are also ligatures
1530
   *   themselves, and those ligature components had marks attached to *their*
1531
   *   components, we have to attach the marks to the new ligature component
1532
   *   positions!  Now *that*'s tricky!  And these marks may be following the
1533
   *   last component of the whole sequence, so we should loop forward looking
1534
   *   for them and update them.
1535
   *
1536
   *   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
1537
   *   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
1538
   *   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
1539
   *   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
1540
   *   the new ligature with a component value of 2.
1541
   *
1542
   *   This in fact happened to a font...  See:
1543
   *   https://bugzilla.gnome.org/show_bug.cgi?id=437633
1544
   */
1545
1546
434k
  bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]);
1547
434k
  bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]);
1548
479k
  for (unsigned int i = 1; i < count; i++)
1549
434k
    if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]]))
1550
389k
    {
1551
389k
      is_base_ligature = false;
1552
389k
      is_mark_ligature = false;
1553
389k
      break;
1554
389k
    }
1555
434k
  bool is_ligature = !is_base_ligature && !is_mark_ligature;
1556
1557
434k
  unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0;
1558
434k
  unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0;
1559
434k
  unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1560
434k
  unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1561
434k
  unsigned int components_so_far = last_num_components;
1562
1563
434k
  if (is_ligature)
1564
395k
  {
1565
395k
    _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count);
1566
395k
    if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
1567
4.62k
    {
1568
4.62k
      _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER);
1569
4.62k
    }
1570
395k
  }
1571
434k
  c->replace_glyph_with_ligature (lig_glyph, klass);
1572
1573
904k
  for (unsigned int i = 1; i < count; i++)
1574
470k
  {
1575
508k
    while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful)
1576
38.7k
    {
1577
38.7k
      if (is_ligature)
1578
37.9k
      {
1579
37.9k
  unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1580
37.9k
  if (this_comp == 0)
1581
5.86k
    this_comp = last_num_components;
1582
37.9k
  assert (components_so_far >= last_num_components);
1583
37.9k
  unsigned int new_lig_comp = components_so_far - last_num_components +
1584
37.9k
            hb_min (this_comp, last_num_components);
1585
37.9k
    _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp);
1586
37.9k
      }
1587
38.7k
      (void) buffer->next_glyph ();
1588
38.7k
    }
1589
1590
470k
    last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1591
470k
    last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1592
470k
    components_so_far += last_num_components;
1593
1594
    /* Skip the base glyph */
1595
470k
    buffer->idx++;
1596
470k
  }
1597
1598
434k
  if (!is_mark_ligature && last_lig_id)
1599
120k
  {
1600
    /* Re-adjust components for any marks following. */
1601
152k
    for (unsigned i = buffer->idx; i < buffer->len; ++i)
1602
152k
    {
1603
152k
      if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break;
1604
1605
103k
      unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]);
1606
103k
      if (!this_comp) break;
1607
1608
103k
      assert (components_so_far >= last_num_components);
1609
32.1k
      unsigned new_lig_comp = components_so_far - last_num_components +
1610
32.1k
            hb_min (this_comp, last_num_components);
1611
32.1k
      _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp);
1612
32.1k
    }
1613
120k
  }
1614
434k
  return_trace (true);
1615
434k
}
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-face.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
hb-ot-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
1507
434k
{
1508
434k
  TRACE_APPLY (nullptr);
1509
1510
434k
  hb_buffer_t *buffer = c->buffer;
1511
1512
434k
  buffer->merge_clusters (buffer->idx, match_end);
1513
1514
  /* - If a base and one or more marks ligate, consider that as a base, NOT
1515
   *   ligature, such that all following marks can still attach to it.
1516
   *   https://github.com/harfbuzz/harfbuzz/issues/1109
1517
   *
1518
   * - If all components of the ligature were marks, we call this a mark ligature.
1519
   *   If it *is* a mark ligature, we don't allocate a new ligature id, and leave
1520
   *   the ligature to keep its old ligature id.  This will allow it to attach to
1521
   *   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
1522
   *   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
1523
   *   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
1524
   *   later, we don't want them to lose their ligature id/component, otherwise
1525
   *   GPOS will fail to correctly position the mark ligature on top of the
1526
   *   LAM,LAM,HEH ligature.  See:
1527
   *     https://bugzilla.gnome.org/show_bug.cgi?id=676343
1528
   *
1529
   * - If a ligature is formed of components that some of which are also ligatures
1530
   *   themselves, and those ligature components had marks attached to *their*
1531
   *   components, we have to attach the marks to the new ligature component
1532
   *   positions!  Now *that*'s tricky!  And these marks may be following the
1533
   *   last component of the whole sequence, so we should loop forward looking
1534
   *   for them and update them.
1535
   *
1536
   *   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
1537
   *   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
1538
   *   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
1539
   *   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
1540
   *   the new ligature with a component value of 2.
1541
   *
1542
   *   This in fact happened to a font...  See:
1543
   *   https://bugzilla.gnome.org/show_bug.cgi?id=437633
1544
   */
1545
1546
434k
  bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]);
1547
434k
  bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]);
1548
479k
  for (unsigned int i = 1; i < count; i++)
1549
434k
    if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]]))
1550
389k
    {
1551
389k
      is_base_ligature = false;
1552
389k
      is_mark_ligature = false;
1553
389k
      break;
1554
389k
    }
1555
434k
  bool is_ligature = !is_base_ligature && !is_mark_ligature;
1556
1557
434k
  unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0;
1558
434k
  unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0;
1559
434k
  unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1560
434k
  unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1561
434k
  unsigned int components_so_far = last_num_components;
1562
1563
434k
  if (is_ligature)
1564
395k
  {
1565
395k
    _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count);
1566
395k
    if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
1567
4.62k
    {
1568
4.62k
      _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER);
1569
4.62k
    }
1570
395k
  }
1571
434k
  c->replace_glyph_with_ligature (lig_glyph, klass);
1572
1573
904k
  for (unsigned int i = 1; i < count; i++)
1574
470k
  {
1575
508k
    while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful)
1576
38.7k
    {
1577
38.7k
      if (is_ligature)
1578
37.9k
      {
1579
37.9k
  unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1580
37.9k
  if (this_comp == 0)
1581
5.86k
    this_comp = last_num_components;
1582
37.9k
  assert (components_so_far >= last_num_components);
1583
37.9k
  unsigned int new_lig_comp = components_so_far - last_num_components +
1584
37.9k
            hb_min (this_comp, last_num_components);
1585
37.9k
    _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp);
1586
37.9k
      }
1587
38.7k
      (void) buffer->next_glyph ();
1588
38.7k
    }
1589
1590
470k
    last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1591
470k
    last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1592
470k
    components_so_far += last_num_components;
1593
1594
    /* Skip the base glyph */
1595
470k
    buffer->idx++;
1596
470k
  }
1597
1598
434k
  if (!is_mark_ligature && last_lig_id)
1599
120k
  {
1600
    /* Re-adjust components for any marks following. */
1601
152k
    for (unsigned i = buffer->idx; i < buffer->len; ++i)
1602
152k
    {
1603
152k
      if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break;
1604
1605
103k
      unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]);
1606
103k
      if (!this_comp) break;
1607
1608
103k
      assert (components_so_far >= last_num_components);
1609
32.1k
      unsigned new_lig_comp = components_so_far - last_num_components +
1610
32.1k
            hb_min (this_comp, last_num_components);
1611
32.1k
      _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp);
1612
32.1k
    }
1613
120k
  }
1614
434k
  return_trace (true);
1615
434k
}
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-serialize.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)
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)
1616
1617
template <typename HBUINT>
1618
#ifndef HB_OPTIMIZE_SIZE
1619
HB_ALWAYS_INLINE
1620
#endif
1621
static bool match_backtrack (hb_ot_apply_context_t *c,
1622
           unsigned int count,
1623
           const HBUINT backtrack[],
1624
           match_func_t match_func,
1625
           const void *match_data,
1626
           unsigned int *match_start)
1627
1.71M
{
1628
1.71M
  TRACE_APPLY (nullptr);
1629
1630
1.71M
  if (!count)
1631
537k
  {
1632
537k
    *match_start = c->buffer->backtrack_len ();
1633
537k
    return_trace (true);
1634
537k
  }
1635
1636
1.17M
  auto &skippy_iter = c->iter_context;
1637
1.17M
  skippy_iter.reset_back (c->buffer->backtrack_len ());
1638
1.17M
  skippy_iter.set_match_func (match_func, match_data);
1639
1.17M
  skippy_iter.set_glyph_data (backtrack);
1640
1641
1.97M
  for (unsigned int i = 0; i < count; i++)
1642
1.69M
  {
1643
1.69M
    unsigned unsafe_from;
1644
1.69M
    if (!skippy_iter.prev (&unsafe_from))
1645
905k
    {
1646
905k
      *match_start = unsafe_from;
1647
905k
      return_trace (false);
1648
905k
    }
1649
1.69M
  }
1650
1651
274k
  *match_start = skippy_iter.idx;
1652
274k
  return_trace (true);
1653
1.17M
}
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-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*)
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*)
Line
Count
Source
1627
1.48M
{
1628
1.48M
  TRACE_APPLY (nullptr);
1629
1630
1.48M
  if (!count)
1631
417k
  {
1632
417k
    *match_start = c->buffer->backtrack_len ();
1633
417k
    return_trace (true);
1634
417k
  }
1635
1636
1.06M
  auto &skippy_iter = c->iter_context;
1637
1.06M
  skippy_iter.reset_back (c->buffer->backtrack_len ());
1638
1.06M
  skippy_iter.set_match_func (match_func, match_data);
1639
1.06M
  skippy_iter.set_glyph_data (backtrack);
1640
1641
1.83M
  for (unsigned int i = 0; i < count; i++)
1642
1.57M
  {
1643
1.57M
    unsigned unsafe_from;
1644
1.57M
    if (!skippy_iter.prev (&unsafe_from))
1645
807k
    {
1646
807k
      *match_start = unsafe_from;
1647
807k
      return_trace (false);
1648
807k
    }
1649
1.57M
  }
1650
1651
261k
  *match_start = skippy_iter.idx;
1652
261k
  return_trace (true);
1653
1.06M
}
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*)
Line
Count
Source
1627
231k
{
1628
231k
  TRACE_APPLY (nullptr);
1629
1630
231k
  if (!count)
1631
120k
  {
1632
120k
    *match_start = c->buffer->backtrack_len ();
1633
120k
    return_trace (true);
1634
120k
  }
1635
1636
110k
  auto &skippy_iter = c->iter_context;
1637
110k
  skippy_iter.reset_back (c->buffer->backtrack_len ());
1638
110k
  skippy_iter.set_match_func (match_func, match_data);
1639
110k
  skippy_iter.set_glyph_data (backtrack);
1640
1641
139k
  for (unsigned int i = 0; i < count; i++)
1642
127k
  {
1643
127k
    unsigned unsafe_from;
1644
127k
    if (!skippy_iter.prev (&unsafe_from))
1645
98.1k
    {
1646
98.1k
      *match_start = unsafe_from;
1647
98.1k
      return_trace (false);
1648
98.1k
    }
1649
127k
  }
1650
1651
12.7k
  *match_start = skippy_iter.idx;
1652
12.7k
  return_trace (true);
1653
110k
}
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-serialize.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*)
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*)
1654
1655
template <typename HBUINT>
1656
#ifndef HB_OPTIMIZE_SIZE
1657
HB_ALWAYS_INLINE
1658
#endif
1659
static bool match_lookahead (hb_ot_apply_context_t *c,
1660
           unsigned int count,
1661
           const HBUINT lookahead[],
1662
           match_func_t match_func,
1663
           const void *match_data,
1664
           unsigned int start_index,
1665
           unsigned int *end_index)
1666
1.71M
{
1667
1.71M
  TRACE_APPLY (nullptr);
1668
1669
1.71M
  if (!count)
1670
1.32M
  {
1671
1.32M
    *end_index = start_index;
1672
1.32M
    return_trace (true);
1673
1.32M
  }
1674
1675
389k
  auto &skippy_iter = c->iter_context;
1676
389k
  assert (start_index >= 1);
1677
389k
  skippy_iter.reset (start_index - 1);
1678
389k
  skippy_iter.set_match_func (match_func, match_data);
1679
389k
  skippy_iter.set_glyph_data (lookahead);
1680
1681
781k
  for (unsigned int i = 0; i < count; i++)
1682
652k
  {
1683
652k
    unsigned unsafe_to;
1684
652k
    if (!skippy_iter.next (&unsafe_to))
1685
260k
    {
1686
260k
      *end_index = unsafe_to;
1687
260k
      return_trace (false);
1688
260k
    }
1689
652k
  }
1690
1691
128k
  *end_index = skippy_iter.idx + 1;
1692
128k
  return_trace (true);
1693
389k
}
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-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*)
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*)
Line
Count
Source
1666
1.46M
{
1667
1.46M
  TRACE_APPLY (nullptr);
1668
1669
1.46M
  if (!count)
1670
1.10M
  {
1671
1.10M
    *end_index = start_index;
1672
1.10M
    return_trace (true);
1673
1.10M
  }
1674
1675
360k
  auto &skippy_iter = c->iter_context;
1676
360k
  assert (start_index >= 1);
1677
360k
  skippy_iter.reset (start_index - 1);
1678
360k
  skippy_iter.set_match_func (match_func, match_data);
1679
360k
  skippy_iter.set_glyph_data (lookahead);
1680
1681
717k
  for (unsigned int i = 0; i < count; i++)
1682
602k
  {
1683
602k
    unsigned unsafe_to;
1684
602k
    if (!skippy_iter.next (&unsafe_to))
1685
245k
    {
1686
245k
      *end_index = unsafe_to;
1687
245k
      return_trace (false);
1688
245k
    }
1689
602k
  }
1690
1691
114k
  *end_index = skippy_iter.idx + 1;
1692
114k
  return_trace (true);
1693
360k
}
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*)
Line
Count
Source
1666
247k
{
1667
247k
  TRACE_APPLY (nullptr);
1668
1669
247k
  if (!count)
1670
217k
  {
1671
217k
    *end_index = start_index;
1672
217k
    return_trace (true);
1673
217k
  }
1674
1675
29.6k
  auto &skippy_iter = c->iter_context;
1676
29.6k
  assert (start_index >= 1);
1677
29.6k
  skippy_iter.reset (start_index - 1);
1678
29.6k
  skippy_iter.set_match_func (match_func, match_data);
1679
29.6k
  skippy_iter.set_glyph_data (lookahead);
1680
1681
64.0k
  for (unsigned int i = 0; i < count; i++)
1682
49.8k
  {
1683
49.8k
    unsigned unsafe_to;
1684
49.8k
    if (!skippy_iter.next (&unsafe_to))
1685
15.3k
    {
1686
15.3k
      *end_index = unsafe_to;
1687
15.3k
      return_trace (false);
1688
15.3k
    }
1689
49.8k
  }
1690
1691
14.2k
  *end_index = skippy_iter.idx + 1;
1692
14.2k
  return_trace (true);
1693
29.6k
}
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-serialize.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*)
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*)
1694
1695
1696
1697
struct LookupRecord
1698
{
1699
  bool serialize (hb_serialize_context_t *c,
1700
      const hb_map_t         *lookup_map) const
1701
17.7M
  {
1702
17.7M
    TRACE_SERIALIZE (this);
1703
17.7M
    auto *out = c->embed (*this);
1704
17.7M
    if (unlikely (!out)) return_trace (false);
1705
1706
17.7M
    return_trace (c->check_assign (out->lookupListIndex, lookup_map->get (lookupListIndex), HB_SERIALIZE_ERROR_INT_OVERFLOW));
1707
17.7M
  }
1708
1709
  bool sanitize (hb_sanitize_context_t *c) const
1710
0
  {
1711
0
    TRACE_SANITIZE (this);
1712
0
    return_trace (c->check_struct (this));
1713
0
  }
1714
1715
  HBUINT16  sequenceIndex;    /* Index into current glyph
1716
           * sequence--first glyph = 0 */
1717
  HBUINT16  lookupListIndex;  /* Lookup to apply to that
1718
           * position--zero--based */
1719
  public:
1720
  DEFINE_SIZE_STATIC (4);
1721
};
1722
1723
static unsigned serialize_lookuprecord_array (hb_serialize_context_t *c,
1724
                const hb_array_t<const LookupRecord> lookupRecords,
1725
                const hb_map_t *lookup_map)
1726
55.2k
{
1727
55.2k
  unsigned count = 0;
1728
55.2k
  for (const LookupRecord& r : lookupRecords)
1729
48.7M
  {
1730
48.7M
    if (!lookup_map->has (r.lookupListIndex))
1731
31.0M
      continue;
1732
1733
17.7M
    if (!r.serialize (c, lookup_map))
1734
63
      return 0;
1735
1736
17.7M
    count++;
1737
17.7M
  }
1738
55.1k
  return count;
1739
55.2k
}
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-face.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-serialize.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*)
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
1726
55.2k
{
1727
55.2k
  unsigned count = 0;
1728
55.2k
  for (const LookupRecord& r : lookupRecords)
1729
48.7M
  {
1730
48.7M
    if (!lookup_map->has (r.lookupListIndex))
1731
31.0M
      continue;
1732
1733
17.7M
    if (!r.serialize (c, lookup_map))
1734
63
      return 0;
1735
1736
17.7M
    count++;
1737
17.7M
  }
1738
55.1k
  return count;
1739
55.2k
}
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*)
1740
1741
enum ContextFormat { SimpleContext = 1, ClassBasedContext = 2, CoverageBasedContext = 3 };
1742
1743
template <typename HBUINT>
1744
static void context_closure_recurse_lookups (hb_closure_context_t *c,
1745
               unsigned inputCount, const HBUINT input[],
1746
               unsigned lookupCount,
1747
               const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */,
1748
               unsigned value,
1749
               ContextFormat context_format,
1750
               const void *data,
1751
               intersected_glyphs_func_t intersected_glyphs_func,
1752
               void *cache)
1753
673k
{
1754
673k
  hb_set_t covered_seq_indicies;
1755
673k
  hb_set_t pos_glyphs;
1756
16.0M
  for (unsigned int i = 0; i < lookupCount; i++)
1757
15.3M
  {
1758
15.3M
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
1759
15.3M
    if (seqIndex >= inputCount) continue;
1760
1761
6.96M
    bool has_pos_glyphs = false;
1762
1763
6.96M
    if (!covered_seq_indicies.has (seqIndex))
1764
229k
    {
1765
229k
      has_pos_glyphs = true;
1766
229k
      pos_glyphs.clear ();
1767
229k
      if (seqIndex == 0)
1768
33.0k
      {
1769
33.0k
        switch (context_format) {
1770
6.25k
        case ContextFormat::SimpleContext:
1771
6.25k
          pos_glyphs.add (value);
1772
6.25k
          break;
1773
1.39k
        case ContextFormat::ClassBasedContext:
1774
1.39k
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
1775
1.39k
          break;
1776
25.4k
        case ContextFormat::CoverageBasedContext:
1777
25.4k
          pos_glyphs.set (c->parent_active_glyphs ());
1778
25.4k
          break;
1779
33.0k
        }
1780
33.0k
      }
1781
196k
      else
1782
196k
      {
1783
196k
        const void *input_data = input;
1784
196k
        unsigned input_value = seqIndex - 1;
1785
196k
        if (context_format != ContextFormat::SimpleContext)
1786
5.46k
        {
1787
5.46k
          input_data = data;
1788
5.46k
          input_value = input[seqIndex - 1];
1789
5.46k
        }
1790
1791
196k
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
1792
196k
      }
1793
229k
    }
1794
1795
6.96M
    covered_seq_indicies.add (seqIndex);
1796
6.96M
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
1797
6.96M
    if (unlikely (!cur_active_glyphs))
1798
0
      return;
1799
6.96M
    if (has_pos_glyphs) {
1800
229k
      *cur_active_glyphs = std::move (pos_glyphs);
1801
6.73M
    } else {
1802
6.73M
      *cur_active_glyphs = *c->glyphs;
1803
6.73M
    }
1804
1805
6.96M
    unsigned endIndex = inputCount;
1806
6.96M
    if (context_format == ContextFormat::CoverageBasedContext)
1807
169k
      endIndex += 1;
1808
1809
6.96M
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
1810
1811
6.96M
    c->pop_cur_done_glyphs ();
1812
6.96M
  }
1813
673k
}
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*)
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*)
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
1753
664k
{
1754
664k
  hb_set_t covered_seq_indicies;
1755
664k
  hb_set_t pos_glyphs;
1756
15.9M
  for (unsigned int i = 0; i < lookupCount; i++)
1757
15.3M
  {
1758
15.3M
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
1759
15.3M
    if (seqIndex >= inputCount) continue;
1760
1761
6.94M
    bool has_pos_glyphs = false;
1762
1763
6.94M
    if (!covered_seq_indicies.has (seqIndex))
1764
226k
    {
1765
226k
      has_pos_glyphs = true;
1766
226k
      pos_glyphs.clear ();
1767
226k
      if (seqIndex == 0)
1768
31.1k
      {
1769
31.1k
        switch (context_format) {
1770
4.28k
        case ContextFormat::SimpleContext:
1771
4.28k
          pos_glyphs.add (value);
1772
4.28k
          break;
1773
1.39k
        case ContextFormat::ClassBasedContext:
1774
1.39k
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
1775
1.39k
          break;
1776
25.4k
        case ContextFormat::CoverageBasedContext:
1777
25.4k
          pos_glyphs.set (c->parent_active_glyphs ());
1778
25.4k
          break;
1779
31.1k
        }
1780
31.1k
      }
1781
195k
      else
1782
195k
      {
1783
195k
        const void *input_data = input;
1784
195k
        unsigned input_value = seqIndex - 1;
1785
195k
        if (context_format != ContextFormat::SimpleContext)
1786
5.46k
        {
1787
5.46k
          input_data = data;
1788
5.46k
          input_value = input[seqIndex - 1];
1789
5.46k
        }
1790
1791
195k
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
1792
195k
      }
1793
226k
    }
1794
1795
6.94M
    covered_seq_indicies.add (seqIndex);
1796
6.94M
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
1797
6.94M
    if (unlikely (!cur_active_glyphs))
1798
0
      return;
1799
6.94M
    if (has_pos_glyphs) {
1800
226k
      *cur_active_glyphs = std::move (pos_glyphs);
1801
6.71M
    } else {
1802
6.71M
      *cur_active_glyphs = *c->glyphs;
1803
6.71M
    }
1804
1805
6.94M
    unsigned endIndex = inputCount;
1806
6.94M
    if (context_format == ContextFormat::CoverageBasedContext)
1807
169k
      endIndex += 1;
1808
1809
6.94M
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
1810
1811
6.94M
    c->pop_cur_done_glyphs ();
1812
6.94M
  }
1813
664k
}
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*)
Line
Count
Source
1753
8.64k
{
1754
8.64k
  hb_set_t covered_seq_indicies;
1755
8.64k
  hb_set_t pos_glyphs;
1756
92.4k
  for (unsigned int i = 0; i < lookupCount; i++)
1757
83.7k
  {
1758
83.7k
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
1759
83.7k
    if (seqIndex >= inputCount) continue;
1760
1761
23.8k
    bool has_pos_glyphs = false;
1762
1763
23.8k
    if (!covered_seq_indicies.has (seqIndex))
1764
2.75k
    {
1765
2.75k
      has_pos_glyphs = true;
1766
2.75k
      pos_glyphs.clear ();
1767
2.75k
      if (seqIndex == 0)
1768
1.97k
      {
1769
1.97k
        switch (context_format) {
1770
1.97k
        case ContextFormat::SimpleContext:
1771
1.97k
          pos_glyphs.add (value);
1772
1.97k
          break;
1773
0
        case ContextFormat::ClassBasedContext:
1774
0
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
1775
0
          break;
1776
0
        case ContextFormat::CoverageBasedContext:
1777
0
          pos_glyphs.set (c->parent_active_glyphs ());
1778
0
          break;
1779
1.97k
        }
1780
1.97k
      }
1781
781
      else
1782
781
      {
1783
781
        const void *input_data = input;
1784
781
        unsigned input_value = seqIndex - 1;
1785
781
        if (context_format != ContextFormat::SimpleContext)
1786
0
        {
1787
0
          input_data = data;
1788
0
          input_value = input[seqIndex - 1];
1789
0
        }
1790
1791
781
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
1792
781
      }
1793
2.75k
    }
1794
1795
23.8k
    covered_seq_indicies.add (seqIndex);
1796
23.8k
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
1797
23.8k
    if (unlikely (!cur_active_glyphs))
1798
0
      return;
1799
23.8k
    if (has_pos_glyphs) {
1800
2.75k
      *cur_active_glyphs = std::move (pos_glyphs);
1801
21.0k
    } else {
1802
21.0k
      *cur_active_glyphs = *c->glyphs;
1803
21.0k
    }
1804
1805
23.8k
    unsigned endIndex = inputCount;
1806
23.8k
    if (context_format == ContextFormat::CoverageBasedContext)
1807
0
      endIndex += 1;
1808
1809
23.8k
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
1810
1811
23.8k
    c->pop_cur_done_glyphs ();
1812
23.8k
  }
1813
8.64k
}
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-serialize.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*)
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*)
1814
1815
template <typename context_t>
1816
static inline void recurse_lookups (context_t *c,
1817
                                    unsigned int lookupCount,
1818
                                    const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */)
1819
495k
{
1820
42.7M
  for (unsigned int i = 0; i < lookupCount; i++)
1821
42.2M
    c->recurse (lookupRecord[i].lookupListIndex);
1822
495k
}
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-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-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-serialize.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-serialize.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*)
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
1819
495k
{
1820
42.7M
  for (unsigned int i = 0; i < lookupCount; i++)
1821
42.2M
    c->recurse (lookupRecord[i].lookupListIndex);
1822
495k
}
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*)
1823
1824
static inline void apply_lookup (hb_ot_apply_context_t *c,
1825
         unsigned int count, /* Including the first glyph */
1826
         unsigned int lookupCount,
1827
         const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
1828
         unsigned int match_end)
1829
2.07M
{
1830
2.07M
  hb_buffer_t *buffer = c->buffer;
1831
2.07M
  int end;
1832
1833
  /* All positions are distance from beginning of *output* buffer.
1834
   * Adjust. */
1835
2.07M
  {
1836
2.07M
    unsigned int bl = buffer->backtrack_len ();
1837
2.07M
    end = bl + match_end - buffer->idx;
1838
1839
2.07M
    int delta = bl - buffer->idx;
1840
    /* Convert positions to new indexing. */
1841
4.74M
    for (unsigned int j = 0; j < count; j++)
1842
2.67M
      c->match_positions.arrayZ[j] += delta;
1843
2.07M
  }
1844
1845
49.0M
  for (unsigned int i = 0; i < lookupCount && buffer->successful; i++)
1846
47.0M
  {
1847
47.0M
    unsigned int idx = lookupRecord[i].sequenceIndex;
1848
47.0M
    if (idx >= count)
1849
35.9M
      continue;
1850
1851
11.0M
    unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len ();
1852
1853
    /* This can happen if earlier recursed lookups deleted many entries. */
1854
11.0M
    if (unlikely (c->match_positions.arrayZ[idx] >= orig_len))
1855
788
      continue;
1856
1857
11.0M
    if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx])))
1858
70
      break;
1859
1860
11.0M
    if (unlikely (buffer->max_ops <= 0))
1861
10.2k
      break;
1862
1863
11.0M
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1864
0
    {
1865
0
      if (buffer->have_output)
1866
0
        c->buffer->sync_so_far ();
1867
0
      c->buffer->message (c->font,
1868
0
        "start recursing to lookup %u at %u",
1869
0
        (unsigned) lookupRecord[i].lookupListIndex,
1870
0
        buffer->idx);
1871
0
    }
1872
1873
11.0M
    bool ret = c->recurse (lookupRecord[i].lookupListIndex);
1874
1875
11.0M
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1876
0
    {
1877
0
      if (buffer->have_output)
1878
0
        c->buffer->sync_so_far ();
1879
0
      c->buffer->message (c->font,
1880
0
        "end recursing to lookup %u",
1881
0
        (unsigned) lookupRecord[i].lookupListIndex);
1882
0
    }
1883
1884
11.0M
    if (!ret)
1885
8.59M
      continue;
1886
1887
2.46M
    unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len ();
1888
2.46M
    int delta = new_len - orig_len;
1889
1890
2.46M
    if (!delta)
1891
1.78M
      continue;
1892
1893
    /* Recursed lookup changed buffer len.  Adjust.
1894
     *
1895
     * TODO:
1896
     *
1897
     * Right now, if buffer length increased by n, we assume n new glyphs
1898
     * were added right after the current position, and if buffer length
1899
     * was decreased by n, we assume n match positions after the current
1900
     * one where removed.  The former (buffer length increased) case is
1901
     * fine, but the decrease case can be improved in at least two ways,
1902
     * both of which are significant:
1903
     *
1904
     *   - If recursed-to lookup is MultipleSubst and buffer length
1905
     *     decreased, then it's current match position that was deleted,
1906
     *     NOT the one after it.
1907
     *
1908
     *   - If buffer length was decreased by n, it does not necessarily
1909
     *     mean that n match positions where removed, as there recursed-to
1910
     *     lookup might had a different LookupFlag.  Here's a constructed
1911
     *     case of that:
1912
     *     https://github.com/harfbuzz/harfbuzz/discussions/3538
1913
     *
1914
     * It should be possible to construct tests for both of these cases.
1915
     */
1916
1917
683k
    end += delta;
1918
683k
    if (end < int (c->match_positions.arrayZ[idx]))
1919
4.70k
    {
1920
      /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed
1921
       * lookup ended up removing many items.
1922
       * Just never rewind end beyond start of current position, since that is
1923
       * not possible in the recursed lookup.  Also adjust delta as such.
1924
       *
1925
       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496
1926
       * https://github.com/harfbuzz/harfbuzz/issues/1611
1927
       */
1928
4.70k
      delta += c->match_positions.arrayZ[idx] - end;
1929
4.70k
      end = c->match_positions.arrayZ[idx];
1930
4.70k
    }
1931
1932
683k
    unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
1933
1934
683k
    if (delta > 0)
1935
418k
    {
1936
418k
      if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
1937
3.83k
  break;
1938
414k
      if (unlikely (count + delta > c->match_positions.length &&
1939
414k
        !c->match_positions.resize_dirty  (count + delta)))
1940
31.1k
        return;
1941
414k
    }
1942
264k
    else
1943
264k
    {
1944
      /* NOTE: delta is non-positive. */
1945
264k
      delta = hb_max (delta, (int) next - (int) count);
1946
264k
      next -= delta;
1947
264k
    }
1948
1949
    /* Shift! */
1950
648k
    memmove (c->match_positions + next + delta, c->match_positions + next,
1951
648k
       (count - next) * sizeof (c->match_positions.arrayZ[0]));
1952
648k
    next += delta;
1953
648k
    count += delta;
1954
1955
    /* Fill in new entries. */
1956
2.60M
    for (unsigned int j = idx + 1; j < next; j++)
1957
1.95M
      c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1;
1958
1959
    /* And fixup the rest. */
1960
6.65M
    for (; next < count; next++)
1961
6.00M
      c->match_positions.arrayZ[next] += delta;
1962
648k
  }
1963
1964
2.07M
  assert (end >= 0);
1965
2.03M
  (void) buffer->move_to (end);
1966
2.03M
}
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-face.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
hb-ot-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Line
Count
Source
1829
2.07M
{
1830
2.07M
  hb_buffer_t *buffer = c->buffer;
1831
2.07M
  int end;
1832
1833
  /* All positions are distance from beginning of *output* buffer.
1834
   * Adjust. */
1835
2.07M
  {
1836
2.07M
    unsigned int bl = buffer->backtrack_len ();
1837
2.07M
    end = bl + match_end - buffer->idx;
1838
1839
2.07M
    int delta = bl - buffer->idx;
1840
    /* Convert positions to new indexing. */
1841
4.74M
    for (unsigned int j = 0; j < count; j++)
1842
2.67M
      c->match_positions.arrayZ[j] += delta;
1843
2.07M
  }
1844
1845
49.0M
  for (unsigned int i = 0; i < lookupCount && buffer->successful; i++)
1846
47.0M
  {
1847
47.0M
    unsigned int idx = lookupRecord[i].sequenceIndex;
1848
47.0M
    if (idx >= count)
1849
35.9M
      continue;
1850
1851
11.0M
    unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len ();
1852
1853
    /* This can happen if earlier recursed lookups deleted many entries. */
1854
11.0M
    if (unlikely (c->match_positions.arrayZ[idx] >= orig_len))
1855
788
      continue;
1856
1857
11.0M
    if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx])))
1858
70
      break;
1859
1860
11.0M
    if (unlikely (buffer->max_ops <= 0))
1861
10.2k
      break;
1862
1863
11.0M
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1864
0
    {
1865
0
      if (buffer->have_output)
1866
0
        c->buffer->sync_so_far ();
1867
0
      c->buffer->message (c->font,
1868
0
        "start recursing to lookup %u at %u",
1869
0
        (unsigned) lookupRecord[i].lookupListIndex,
1870
0
        buffer->idx);
1871
0
    }
1872
1873
11.0M
    bool ret = c->recurse (lookupRecord[i].lookupListIndex);
1874
1875
11.0M
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
1876
0
    {
1877
0
      if (buffer->have_output)
1878
0
        c->buffer->sync_so_far ();
1879
0
      c->buffer->message (c->font,
1880
0
        "end recursing to lookup %u",
1881
0
        (unsigned) lookupRecord[i].lookupListIndex);
1882
0
    }
1883
1884
11.0M
    if (!ret)
1885
8.59M
      continue;
1886
1887
2.46M
    unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len ();
1888
2.46M
    int delta = new_len - orig_len;
1889
1890
2.46M
    if (!delta)
1891
1.78M
      continue;
1892
1893
    /* Recursed lookup changed buffer len.  Adjust.
1894
     *
1895
     * TODO:
1896
     *
1897
     * Right now, if buffer length increased by n, we assume n new glyphs
1898
     * were added right after the current position, and if buffer length
1899
     * was decreased by n, we assume n match positions after the current
1900
     * one where removed.  The former (buffer length increased) case is
1901
     * fine, but the decrease case can be improved in at least two ways,
1902
     * both of which are significant:
1903
     *
1904
     *   - If recursed-to lookup is MultipleSubst and buffer length
1905
     *     decreased, then it's current match position that was deleted,
1906
     *     NOT the one after it.
1907
     *
1908
     *   - If buffer length was decreased by n, it does not necessarily
1909
     *     mean that n match positions where removed, as there recursed-to
1910
     *     lookup might had a different LookupFlag.  Here's a constructed
1911
     *     case of that:
1912
     *     https://github.com/harfbuzz/harfbuzz/discussions/3538
1913
     *
1914
     * It should be possible to construct tests for both of these cases.
1915
     */
1916
1917
683k
    end += delta;
1918
683k
    if (end < int (c->match_positions.arrayZ[idx]))
1919
4.70k
    {
1920
      /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed
1921
       * lookup ended up removing many items.
1922
       * Just never rewind end beyond start of current position, since that is
1923
       * not possible in the recursed lookup.  Also adjust delta as such.
1924
       *
1925
       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496
1926
       * https://github.com/harfbuzz/harfbuzz/issues/1611
1927
       */
1928
4.70k
      delta += c->match_positions.arrayZ[idx] - end;
1929
4.70k
      end = c->match_positions.arrayZ[idx];
1930
4.70k
    }
1931
1932
683k
    unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
1933
1934
683k
    if (delta > 0)
1935
418k
    {
1936
418k
      if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
1937
3.83k
  break;
1938
414k
      if (unlikely (count + delta > c->match_positions.length &&
1939
414k
        !c->match_positions.resize_dirty  (count + delta)))
1940
31.1k
        return;
1941
414k
    }
1942
264k
    else
1943
264k
    {
1944
      /* NOTE: delta is non-positive. */
1945
264k
      delta = hb_max (delta, (int) next - (int) count);
1946
264k
      next -= delta;
1947
264k
    }
1948
1949
    /* Shift! */
1950
648k
    memmove (c->match_positions + next + delta, c->match_positions + next,
1951
648k
       (count - next) * sizeof (c->match_positions.arrayZ[0]));
1952
648k
    next += delta;
1953
648k
    count += delta;
1954
1955
    /* Fill in new entries. */
1956
2.60M
    for (unsigned int j = idx + 1; j < next; j++)
1957
1.95M
      c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1;
1958
1959
    /* And fixup the rest. */
1960
6.65M
    for (; next < count; next++)
1961
6.00M
      c->match_positions.arrayZ[next] += delta;
1962
648k
  }
1963
1964
2.07M
  assert (end >= 0);
1965
2.03M
  (void) buffer->move_to (end);
1966
2.03M
}
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-serialize.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)
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)
1967
1968
1969
1970
/* Contextual lookups */
1971
1972
struct ContextClosureLookupContext
1973
{
1974
  ContextClosureFuncs funcs;
1975
  ContextFormat context_format;
1976
  const void *intersects_data;
1977
  void *intersects_cache;
1978
  void *intersected_glyphs_cache;
1979
};
1980
1981
struct ContextCollectGlyphsLookupContext
1982
{
1983
  ContextCollectGlyphsFuncs funcs;
1984
  const void *collect_data;
1985
};
1986
1987
struct ContextApplyLookupContext
1988
{
1989
  ContextApplyFuncs funcs;
1990
  const void *match_data;
1991
};
1992
1993
template <typename HBUINT>
1994
static inline bool context_intersects (const hb_set_t *glyphs,
1995
               unsigned int inputCount, /* Including the first glyph (not matched) */
1996
               const HBUINT input[], /* Array of input values--start with second glyph */
1997
               ContextClosureLookupContext &lookup_context)
1998
1.02M
{
1999
1.02M
  return array_is_subset_of (glyphs,
2000
1.02M
           inputCount ? inputCount - 1 : 0, input,
2001
1.02M
           lookup_context.funcs.intersects,
2002
1.02M
           lookup_context.intersects_data,
2003
1.02M
           lookup_context.intersects_cache);
2004
1.02M
}
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&)
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&)
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
1998
642k
{
1999
642k
  return array_is_subset_of (glyphs,
2000
642k
           inputCount ? inputCount - 1 : 0, input,
2001
642k
           lookup_context.funcs.intersects,
2002
642k
           lookup_context.intersects_data,
2003
642k
           lookup_context.intersects_cache);
2004
642k
}
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&)
Line
Count
Source
1998
6.24k
{
1999
6.24k
  return array_is_subset_of (glyphs,
2000
6.24k
           inputCount ? inputCount - 1 : 0, input,
2001
6.24k
           lookup_context.funcs.intersects,
2002
6.24k
           lookup_context.intersects_data,
2003
6.24k
           lookup_context.intersects_cache);
2004
6.24k
}
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-serialize.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-serialize.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&)
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
1998
364k
{
1999
364k
  return array_is_subset_of (glyphs,
2000
364k
           inputCount ? inputCount - 1 : 0, input,
2001
364k
           lookup_context.funcs.intersects,
2002
364k
           lookup_context.intersects_data,
2003
364k
           lookup_context.intersects_cache);
2004
364k
}
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&)
Line
Count
Source
1998
7.62k
{
1999
7.62k
  return array_is_subset_of (glyphs,
2000
7.62k
           inputCount ? inputCount - 1 : 0, input,
2001
7.62k
           lookup_context.funcs.intersects,
2002
7.62k
           lookup_context.intersects_data,
2003
7.62k
           lookup_context.intersects_cache);
2004
7.62k
}
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&)
2005
2006
template <typename HBUINT>
2007
static inline void context_closure_lookup (hb_closure_context_t *c,
2008
             unsigned int inputCount, /* Including the first glyph (not matched) */
2009
             const HBUINT input[], /* Array of input values--start with second glyph */
2010
             unsigned int lookupCount,
2011
             const LookupRecord lookupRecord[],
2012
             unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */
2013
             ContextClosureLookupContext &lookup_context)
2014
648k
{
2015
648k
  if (context_intersects (c->glyphs,
2016
648k
        inputCount, input,
2017
648k
        lookup_context))
2018
637k
    context_closure_recurse_lookups (c,
2019
637k
             inputCount, input,
2020
637k
             lookupCount, lookupRecord,
2021
637k
             value,
2022
637k
             lookup_context.context_format,
2023
637k
             lookup_context.intersects_data,
2024
637k
             lookup_context.funcs.intersected_glyphs,
2025
637k
             lookup_context.intersected_glyphs_cache);
2026
648k
}
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&)
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&)
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
2014
642k
{
2015
642k
  if (context_intersects (c->glyphs,
2016
642k
        inputCount, input,
2017
642k
        lookup_context))
2018
632k
    context_closure_recurse_lookups (c,
2019
632k
             inputCount, input,
2020
632k
             lookupCount, lookupRecord,
2021
632k
             value,
2022
632k
             lookup_context.context_format,
2023
632k
             lookup_context.intersects_data,
2024
632k
             lookup_context.funcs.intersected_glyphs,
2025
632k
             lookup_context.intersected_glyphs_cache);
2026
642k
}
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&)
Line
Count
Source
2014
6.24k
{
2015
6.24k
  if (context_intersects (c->glyphs,
2016
6.24k
        inputCount, input,
2017
6.24k
        lookup_context))
2018
5.47k
    context_closure_recurse_lookups (c,
2019
5.47k
             inputCount, input,
2020
5.47k
             lookupCount, lookupRecord,
2021
5.47k
             value,
2022
5.47k
             lookup_context.context_format,
2023
5.47k
             lookup_context.intersects_data,
2024
5.47k
             lookup_context.funcs.intersected_glyphs,
2025
5.47k
             lookup_context.intersected_glyphs_cache);
2026
6.24k
}
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-serialize.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&)
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&)
2027
2028
template <typename HBUINT>
2029
static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
2030
              unsigned int inputCount, /* Including the first glyph (not matched) */
2031
              const HBUINT input[], /* Array of input values--start with second glyph */
2032
              unsigned int lookupCount,
2033
              const LookupRecord lookupRecord[],
2034
              ContextCollectGlyphsLookupContext &lookup_context)
2035
0
{
2036
0
  collect_array (c, c->input,
2037
0
     inputCount ? inputCount - 1 : 0, input,
2038
0
     lookup_context.funcs.collect, lookup_context.collect_data);
2039
0
  recurse_lookups (c,
2040
0
       lookupCount, lookupRecord);
2041
0
}
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-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-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-serialize.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&)
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&)
2042
2043
template <typename HBUINT>
2044
static inline bool context_would_apply_lookup (hb_would_apply_context_t *c,
2045
                 unsigned int inputCount, /* Including the first glyph (not matched) */
2046
                 const HBUINT input[], /* Array of input values--start with second glyph */
2047
                 unsigned int lookupCount HB_UNUSED,
2048
                 const LookupRecord lookupRecord[] HB_UNUSED,
2049
                 const ContextApplyLookupContext &lookup_context)
2050
18.3k
{
2051
18.3k
  return would_match_input (c,
2052
18.3k
          inputCount, input,
2053
18.3k
          lookup_context.funcs.match, lookup_context.match_data);
2054
18.3k
}
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-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&)
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&)
Line
Count
Source
2050
12.0k
{
2051
12.0k
  return would_match_input (c,
2052
12.0k
          inputCount, input,
2053
12.0k
          lookup_context.funcs.match, lookup_context.match_data);
2054
12.0k
}
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&)
Line
Count
Source
2050
6.27k
{
2051
6.27k
  return would_match_input (c,
2052
6.27k
          inputCount, input,
2053
6.27k
          lookup_context.funcs.match, lookup_context.match_data);
2054
6.27k
}
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-serialize.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&)
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&)
2055
2056
template <typename HBUINT>
2057
static inline bool context_apply_lookup (hb_ot_apply_context_t *c,
2058
           unsigned int inputCount, /* Including the first glyph (not matched) */
2059
           const HBUINT input[], /* Array of input values--start with second glyph */
2060
           unsigned int lookupCount,
2061
           const LookupRecord lookupRecord[],
2062
           const ContextApplyLookupContext &lookup_context)
2063
4.11M
{
2064
4.11M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
2065
2066
4.00M
  unsigned match_end = 0;
2067
4.00M
  bool ret = false;
2068
4.00M
  if (match_input (c,
2069
4.00M
       inputCount, input,
2070
4.00M
       lookup_context.funcs.match, lookup_context.match_data,
2071
4.00M
       &match_end))
2072
1.42M
  {
2073
1.42M
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
2074
1.42M
    apply_lookup (c,
2075
1.42M
      inputCount,
2076
1.42M
      lookupCount, lookupRecord,
2077
1.42M
      match_end);
2078
1.42M
    ret = true;
2079
1.42M
  }
2080
2.58M
  else
2081
2.58M
  {
2082
2.58M
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
2083
2.58M
    ret = false;
2084
2.58M
  }
2085
2086
4.00M
  return ret;
2087
4.11M
}
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-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&)
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&)
Line
Count
Source
2063
3.44M
{
2064
3.44M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
2065
2066
3.34M
  unsigned match_end = 0;
2067
3.34M
  bool ret = false;
2068
3.34M
  if (match_input (c,
2069
3.34M
       inputCount, input,
2070
3.34M
       lookup_context.funcs.match, lookup_context.match_data,
2071
3.34M
       &match_end))
2072
909k
  {
2073
909k
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
2074
909k
    apply_lookup (c,
2075
909k
      inputCount,
2076
909k
      lookupCount, lookupRecord,
2077
909k
      match_end);
2078
909k
    ret = true;
2079
909k
  }
2080
2.43M
  else
2081
2.43M
  {
2082
2.43M
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
2083
2.43M
    ret = false;
2084
2.43M
  }
2085
2086
3.34M
  return ret;
2087
3.44M
}
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&)
Line
Count
Source
2063
669k
{
2064
669k
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
2065
2066
660k
  unsigned match_end = 0;
2067
660k
  bool ret = false;
2068
660k
  if (match_input (c,
2069
660k
       inputCount, input,
2070
660k
       lookup_context.funcs.match, lookup_context.match_data,
2071
660k
       &match_end))
2072
511k
  {
2073
511k
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
2074
511k
    apply_lookup (c,
2075
511k
      inputCount,
2076
511k
      lookupCount, lookupRecord,
2077
511k
      match_end);
2078
511k
    ret = true;
2079
511k
  }
2080
149k
  else
2081
149k
  {
2082
149k
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
2083
149k
    ret = false;
2084
149k
  }
2085
2086
660k
  return ret;
2087
669k
}
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-serialize.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&)
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&)
2088
2089
static inline bool context_cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
2090
10.1k
{
2091
10.1k
  switch (op)
2092
10.1k
  {
2093
5.38k
    case hb_ot_subtable_cache_op_t::ENTER:
2094
5.38k
    {
2095
5.38k
      if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable))
2096
594
  return false;
2097
4.78k
      auto &info = c->buffer->info;
2098
4.78k
      unsigned count = c->buffer->len;
2099
7.76M
      for (unsigned i = 0; i < count; i++)
2100
7.76M
  info[i].syllable() = 255;
2101
4.78k
      c->new_syllables = 255;
2102
4.78k
      return true;
2103
5.38k
    }
2104
4.78k
    case hb_ot_subtable_cache_op_t::LEAVE:
2105
4.78k
    {
2106
4.78k
      c->new_syllables = (unsigned) -1;
2107
4.78k
      HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable);
2108
4.78k
      break;
2109
5.38k
    }
2110
10.1k
  }
2111
4.78k
  return false;
2112
10.1k
}
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-face.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
hb-ot-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
2090
10.1k
{
2091
10.1k
  switch (op)
2092
10.1k
  {
2093
5.38k
    case hb_ot_subtable_cache_op_t::ENTER:
2094
5.38k
    {
2095
5.38k
      if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable))
2096
594
  return false;
2097
4.78k
      auto &info = c->buffer->info;
2098
4.78k
      unsigned count = c->buffer->len;
2099
7.76M
      for (unsigned i = 0; i < count; i++)
2100
7.76M
  info[i].syllable() = 255;
2101
4.78k
      c->new_syllables = 255;
2102
4.78k
      return true;
2103
5.38k
    }
2104
4.78k
    case hb_ot_subtable_cache_op_t::LEAVE:
2105
4.78k
    {
2106
4.78k
      c->new_syllables = (unsigned) -1;
2107
4.78k
      HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable);
2108
4.78k
      break;
2109
5.38k
    }
2110
10.1k
  }
2111
4.78k
  return false;
2112
10.1k
}
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-serialize.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)
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)
2113
2114
template <typename Types>
2115
struct Rule
2116
{
2117
  template <typename T>
2118
  friend struct RuleSet;
2119
2120
  bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const
2121
369k
  {
2122
369k
    return context_intersects (glyphs,
2123
369k
             inputCount, inputZ.arrayZ,
2124
369k
             lookup_context);
2125
369k
  }
OT::Rule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2121
361k
  {
2122
361k
    return context_intersects (glyphs,
2123
361k
             inputCount, inputZ.arrayZ,
2124
361k
             lookup_context);
2125
361k
  }
OT::Rule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2121
7.62k
  {
2122
7.62k
    return context_intersects (glyphs,
2123
7.62k
             inputCount, inputZ.arrayZ,
2124
7.62k
             lookup_context);
2125
7.62k
  }
2126
2127
  void closure (hb_closure_context_t *c, unsigned value, ContextClosureLookupContext &lookup_context) const
2128
647k
  {
2129
647k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2130
2131
643k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2132
643k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2133
643k
    context_closure_lookup (c,
2134
643k
          inputCount, inputZ.arrayZ,
2135
643k
          lookupCount, lookupRecord.arrayZ,
2136
643k
          value, lookup_context);
2137
643k
  }
OT::Rule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2128
641k
  {
2129
641k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2130
2131
637k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2132
637k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2133
637k
    context_closure_lookup (c,
2134
637k
          inputCount, inputZ.arrayZ,
2135
637k
          lookupCount, lookupRecord.arrayZ,
2136
637k
          value, lookup_context);
2137
637k
  }
OT::Rule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2128
6.24k
  {
2129
6.24k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2130
2131
6.24k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2132
6.24k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2133
6.24k
    context_closure_lookup (c,
2134
6.24k
          inputCount, inputZ.arrayZ,
2135
6.24k
          lookupCount, lookupRecord.arrayZ,
2136
6.24k
          value, lookup_context);
2137
6.24k
  }
2138
2139
  void closure_lookups (hb_closure_lookups_context_t *c,
2140
                        ContextClosureLookupContext &lookup_context) const
2141
361k
  {
2142
361k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2143
361k
    if (!intersects (c->glyphs, lookup_context)) return;
2144
2145
352k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2146
352k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2147
352k
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
2148
352k
  }
OT::Rule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2141
354k
  {
2142
354k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2143
354k
    if (!intersects (c->glyphs, lookup_context)) return;
2144
2145
346k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2146
346k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2147
346k
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
2148
346k
  }
OT::Rule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2141
6.84k
  {
2142
6.84k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2143
6.84k
    if (!intersects (c->glyphs, lookup_context)) return;
2144
2145
6.01k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2146
6.01k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2147
6.01k
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
2148
6.01k
  }
2149
2150
  void collect_glyphs (hb_collect_glyphs_context_t *c,
2151
           ContextCollectGlyphsLookupContext &lookup_context) const
2152
0
  {
2153
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2154
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2155
0
    context_collect_glyphs_lookup (c,
2156
0
           inputCount, inputZ.arrayZ,
2157
0
           lookupCount, lookupRecord.arrayZ,
2158
0
           lookup_context);
2159
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
2160
2161
  bool would_apply (hb_would_apply_context_t *c,
2162
        const ContextApplyLookupContext &lookup_context) const
2163
16.4k
  {
2164
16.4k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2165
16.4k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2166
16.4k
    return context_would_apply_lookup (c,
2167
16.4k
               inputCount, inputZ.arrayZ,
2168
16.4k
               lookupCount, lookupRecord.arrayZ,
2169
16.4k
               lookup_context);
2170
16.4k
  }
OT::Rule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2163
10.2k
  {
2164
10.2k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2165
10.2k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2166
10.2k
    return context_would_apply_lookup (c,
2167
10.2k
               inputCount, inputZ.arrayZ,
2168
10.2k
               lookupCount, lookupRecord.arrayZ,
2169
10.2k
               lookup_context);
2170
10.2k
  }
OT::Rule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2163
6.27k
  {
2164
6.27k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2165
6.27k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2166
6.27k
    return context_would_apply_lookup (c,
2167
6.27k
               inputCount, inputZ.arrayZ,
2168
6.27k
               lookupCount, lookupRecord.arrayZ,
2169
6.27k
               lookup_context);
2170
6.27k
  }
2171
2172
  bool apply (hb_ot_apply_context_t *c,
2173
        const ContextApplyLookupContext &lookup_context) const
2174
4.05M
  {
2175
4.05M
    TRACE_APPLY (this);
2176
4.05M
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2177
4.05M
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2178
4.05M
    return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
2179
4.05M
  }
OT::Rule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2174
3.38M
  {
2175
3.38M
    TRACE_APPLY (this);
2176
3.38M
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2177
3.38M
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2178
3.38M
    return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
2179
3.38M
  }
OT::Rule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2174
669k
  {
2175
669k
    TRACE_APPLY (this);
2176
669k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2177
669k
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
2178
669k
    return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
2179
669k
  }
2180
2181
  bool serialize (hb_serialize_context_t *c,
2182
      const hb_map_t *input_mapping, /* old->new glyphid or class mapping */
2183
      const hb_map_t *lookup_map) const
2184
6.25k
  {
2185
6.25k
    TRACE_SERIALIZE (this);
2186
6.25k
    auto *out = c->start_embed (this);
2187
6.25k
    if (unlikely (!c->extend_min (out))) return_trace (false);
2188
2189
6.25k
    out->inputCount = inputCount;
2190
6.25k
    const auto input = inputZ.as_array (inputCount - 1);
2191
6.25k
    for (const auto org : input)
2192
38.4M
    {
2193
38.4M
      HBUINT16 d;
2194
38.4M
      d = input_mapping->get (org);
2195
38.4M
      c->copy (d);
2196
38.4M
    }
2197
2198
6.25k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2199
6.25k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2200
2201
6.25k
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
2202
6.25k
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2203
6.25k
  }
OT::Rule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2184
5.31k
  {
2185
5.31k
    TRACE_SERIALIZE (this);
2186
5.31k
    auto *out = c->start_embed (this);
2187
5.31k
    if (unlikely (!c->extend_min (out))) return_trace (false);
2188
2189
5.31k
    out->inputCount = inputCount;
2190
5.31k
    const auto input = inputZ.as_array (inputCount - 1);
2191
5.31k
    for (const auto org : input)
2192
38.4M
    {
2193
38.4M
      HBUINT16 d;
2194
38.4M
      d = input_mapping->get (org);
2195
38.4M
      c->copy (d);
2196
38.4M
    }
2197
2198
5.31k
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2199
5.31k
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2200
2201
5.31k
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
2202
5.31k
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2203
5.31k
  }
OT::Rule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2184
945
  {
2185
945
    TRACE_SERIALIZE (this);
2186
945
    auto *out = c->start_embed (this);
2187
945
    if (unlikely (!c->extend_min (out))) return_trace (false);
2188
2189
945
    out->inputCount = inputCount;
2190
945
    const auto input = inputZ.as_array (inputCount - 1);
2191
945
    for (const auto org : input)
2192
1.83k
    {
2193
1.83k
      HBUINT16 d;
2194
1.83k
      d = input_mapping->get (org);
2195
1.83k
      c->copy (d);
2196
1.83k
    }
2197
2198
945
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
2199
945
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
2200
2201
945
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
2202
945
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
2203
945
  }
2204
2205
  bool subset (hb_subset_context_t *c,
2206
         const hb_map_t *lookup_map,
2207
         const hb_map_t *klass_map = nullptr) const
2208
20.9k
  {
2209
20.9k
    TRACE_SUBSET (this);
2210
20.9k
    if (unlikely (!inputCount)) return_trace (false);
2211
14.0k
    const auto input = inputZ.as_array (inputCount - 1);
2212
2213
14.0k
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
2214
14.0k
    if (!hb_all (input, mapping)) return_trace (false);
2215
14.0k
    return_trace (serialize (c->serializer, mapping, lookup_map));
2216
14.0k
  }
OT::Rule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2208
18.4k
  {
2209
18.4k
    TRACE_SUBSET (this);
2210
18.4k
    if (unlikely (!inputCount)) return_trace (false);
2211
12.3k
    const auto input = inputZ.as_array (inputCount - 1);
2212
2213
12.3k
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
2214
12.3k
    if (!hb_all (input, mapping)) return_trace (false);
2215
5.31k
    return_trace (serialize (c->serializer, mapping, lookup_map));
2216
12.3k
  }
OT::Rule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2208
2.41k
  {
2209
2.41k
    TRACE_SUBSET (this);
2210
2.41k
    if (unlikely (!inputCount)) return_trace (false);
2211
1.78k
    const auto input = inputZ.as_array (inputCount - 1);
2212
2213
1.78k
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
2214
1.78k
    if (!hb_all (input, mapping)) return_trace (false);
2215
945
    return_trace (serialize (c->serializer, mapping, lookup_map));
2216
1.78k
  }
2217
2218
  public:
2219
  bool sanitize (hb_sanitize_context_t *c) const
2220
371k
  {
2221
371k
    TRACE_SANITIZE (this);
2222
371k
    return_trace (c->check_struct (this) &&
2223
371k
      hb_barrier () &&
2224
371k
      c->check_range (inputZ.arrayZ,
2225
371k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2226
371k
          LookupRecord::static_size * lookupCount));
2227
371k
  }
OT::Rule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2220
357k
  {
2221
357k
    TRACE_SANITIZE (this);
2222
357k
    return_trace (c->check_struct (this) &&
2223
357k
      hb_barrier () &&
2224
357k
      c->check_range (inputZ.arrayZ,
2225
357k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2226
357k
          LookupRecord::static_size * lookupCount));
2227
357k
  }
OT::Rule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2220
13.4k
  {
2221
13.4k
    TRACE_SANITIZE (this);
2222
13.4k
    return_trace (c->check_struct (this) &&
2223
13.4k
      hb_barrier () &&
2224
13.4k
      c->check_range (inputZ.arrayZ,
2225
13.4k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
2226
13.4k
          LookupRecord::static_size * lookupCount));
2227
13.4k
  }
2228
2229
  protected:
2230
  HBUINT16  inputCount;   /* Total number of glyphs in input
2231
           * glyph sequence--includes the first
2232
           * glyph */
2233
  HBUINT16  lookupCount;    /* Number of LookupRecords */
2234
  UnsizedArrayOf<typename Types::HBUINT>
2235
    inputZ;     /* Array of match inputs--start with
2236
           * second glyph */
2237
/*UnsizedArrayOf<LookupRecord>
2238
    lookupRecordX;*/  /* Array of LookupRecords--in
2239
           * design order */
2240
  public:
2241
  DEFINE_SIZE_ARRAY (4, inputZ);
2242
};
2243
2244
template <typename Types>
2245
struct RuleSet
2246
{
2247
  using Rule = OT::Rule<Types>;
2248
2249
  bool intersects (const hb_set_t *glyphs,
2250
       ContextClosureLookupContext &lookup_context) const
2251
5.21k
  {
2252
5.21k
    return
2253
5.21k
    + hb_iter (rule)
2254
5.21k
    | hb_map (hb_add (this))
2255
7.79k
    | 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
2255
7.00k
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
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
Line
Count
Source
2255
787
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
2256
5.21k
    | hb_any
2257
5.21k
    ;
2258
5.21k
  }
OT::RuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2251
4.51k
  {
2252
4.51k
    return
2253
4.51k
    + hb_iter (rule)
2254
4.51k
    | hb_map (hb_add (this))
2255
4.51k
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
2256
4.51k
    | hb_any
2257
4.51k
    ;
2258
4.51k
  }
OT::RuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2251
707
  {
2252
707
    return
2253
707
    + hb_iter (rule)
2254
707
    | hb_map (hb_add (this))
2255
707
    | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); })
2256
707
    | hb_any
2257
707
    ;
2258
707
  }
2259
2260
  void closure (hb_closure_context_t *c, unsigned value,
2261
    ContextClosureLookupContext &lookup_context) const
2262
8.57k
  {
2263
8.57k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2264
2265
8.24k
    return
2266
8.24k
    + hb_iter (rule)
2267
8.24k
    | hb_map (hb_add (this))
2268
647k
    | 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
2268
641k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
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
Line
Count
Source
2268
6.24k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
2269
8.57k
    ;
2270
8.57k
  }
OT::RuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2262
8.01k
  {
2263
8.01k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2264
2265
7.68k
    return
2266
7.68k
    + hb_iter (rule)
2267
7.68k
    | hb_map (hb_add (this))
2268
7.68k
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
2269
8.01k
    ;
2270
8.01k
  }
OT::RuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Line
Count
Source
2262
562
  {
2263
562
    if (unlikely (c->lookup_limit_exceeded ())) return;
2264
2265
562
    return
2266
562
    + hb_iter (rule)
2267
562
    | hb_map (hb_add (this))
2268
562
    | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })
2269
562
    ;
2270
562
  }
2271
2272
  void closure_lookups (hb_closure_lookups_context_t *c,
2273
                        ContextClosureLookupContext &lookup_context) const
2274
3.93k
  {
2275
3.93k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2276
3.93k
    + hb_iter (rule)
2277
3.93k
    | hb_map (hb_add (this))
2278
361k
    | 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
2278
354k
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
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
Line
Count
Source
2278
6.84k
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
2279
3.93k
    ;
2280
3.93k
  }
OT::RuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2274
3.37k
  {
2275
3.37k
    if (unlikely (c->lookup_limit_exceeded ())) return;
2276
3.37k
    + hb_iter (rule)
2277
3.37k
    | hb_map (hb_add (this))
2278
3.37k
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
2279
3.37k
    ;
2280
3.37k
  }
OT::RuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Line
Count
Source
2274
557
  {
2275
557
    if (unlikely (c->lookup_limit_exceeded ())) return;
2276
557
    + hb_iter (rule)
2277
557
    | hb_map (hb_add (this))
2278
557
    | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); })
2279
557
    ;
2280
557
  }
2281
2282
  void collect_glyphs (hb_collect_glyphs_context_t *c,
2283
           ContextCollectGlyphsLookupContext &lookup_context) const
2284
0
  {
2285
0
    return
2286
0
    + hb_iter (rule)
2287
0
    | hb_map (hb_add (this))
2288
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
2289
0
    ;
2290
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
2291
2292
  bool would_apply (hb_would_apply_context_t *c,
2293
        const ContextApplyLookupContext &lookup_context) const
2294
8.92k
  {
2295
8.92k
    return
2296
8.92k
    + hb_iter (rule)
2297
8.92k
    | hb_map (hb_add (this))
2298
16.4k
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
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
Line
Count
Source
2298
10.2k
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
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
Line
Count
Source
2298
6.27k
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
2299
8.92k
    | hb_any
2300
8.92k
    ;
2301
8.92k
  }
OT::RuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2294
7.62k
  {
2295
7.62k
    return
2296
7.62k
    + hb_iter (rule)
2297
7.62k
    | hb_map (hb_add (this))
2298
7.62k
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
2299
7.62k
    | hb_any
2300
7.62k
    ;
2301
7.62k
  }
OT::RuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2294
1.29k
  {
2295
1.29k
    return
2296
1.29k
    + hb_iter (rule)
2297
1.29k
    | hb_map (hb_add (this))
2298
1.29k
    | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })
2299
1.29k
    | hb_any
2300
1.29k
    ;
2301
1.29k
  }
2302
2303
  bool apply (hb_ot_apply_context_t *c,
2304
        const ContextApplyLookupContext &lookup_context) const
2305
3.48M
  {
2306
3.48M
    TRACE_APPLY (this);
2307
2308
3.48M
    unsigned num_rules = rule.len;
2309
2310
3.48M
#ifndef HB_NO_OT_RULESETS_FAST_PATH
2311
3.48M
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
2312
2.21M
#endif
2313
2.21M
    {
2314
2.24M
    slow:
2315
2.24M
      return_trace (
2316
2.21M
      + hb_iter (rule)
2317
2.21M
      | hb_map (hb_add (this))
2318
2.21M
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2319
2.21M
      | hb_any
2320
2.21M
      )
2321
2.21M
      ;
2322
2.21M
    }
2323
2324
    /* This version is optimized for speed by matching the first & second
2325
     * components of the rule here, instead of calling into the matching code.
2326
     *
2327
     * Replicated from LigatureSet::apply(). */
2328
2329
    /* We use the iter_context instead of iter_input, to avoid skipping
2330
     * default-ignorables and such.
2331
     *
2332
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
2333
     */
2334
1.26M
    auto &skippy_iter = c->iter_context;
2335
1.26M
    skippy_iter.reset (c->buffer->idx);
2336
1.26M
    skippy_iter.set_match_func (match_always, nullptr);
2337
1.26M
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
2338
1.26M
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
2339
1.26M
    hb_glyph_info_t *first = nullptr, *second = nullptr;
2340
1.26M
    bool matched = skippy_iter.next ();
2341
1.26M
    if (likely (matched))
2342
1.00M
    {
2343
1.00M
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2344
17.6k
      {
2345
  /* Can't use the fast path if eg. the next char is a default-ignorable
2346
   * or other skippable. */
2347
17.6k
        goto slow;
2348
17.6k
      }
2349
2350
986k
      first = &c->buffer->info[skippy_iter.idx];
2351
986k
      unsafe_to1 = skippy_iter.idx + 1;
2352
986k
    }
2353
263k
    else
2354
263k
    {
2355
      /* Failed to match a next glyph. Only try applying rules that have
2356
       * no further input. */
2357
263k
      return_trace (
2358
263k
      + hb_iter (rule)
2359
263k
      | hb_map (hb_add (this))
2360
263k
      | hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; })
2361
263k
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2362
263k
      | hb_any
2363
263k
      )
2364
263k
      ;
2365
263k
    }
2366
986k
    matched = skippy_iter.next ();
2367
986k
    if (likely (matched))
2368
670k
    {
2369
670k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2370
7.50k
      {
2371
  /* Can't use the fast path if eg. the next char is a default-ignorable
2372
   * or other skippable. */
2373
7.50k
        goto slow;
2374
7.50k
      }
2375
2376
662k
      second = &c->buffer->info[skippy_iter.idx];
2377
662k
      unsafe_to2 = skippy_iter.idx + 1;
2378
662k
    }
2379
2380
978k
    auto match_input = lookup_context.funcs.match;
2381
978k
    auto *input_data = lookup_context.match_data;
2382
3.51M
    for (unsigned int i = 0; i < num_rules; i++)
2383
3.27M
    {
2384
3.27M
      const auto &r = this+rule.arrayZ[i];
2385
2386
3.27M
      const auto &input = r.inputZ;
2387
2388
3.27M
      if (r.inputCount <= 1 ||
2389
2.94M
    (!match_input ||
2390
2.94M
     match_input (*first, input.arrayZ[0], input_data)))
2391
1.34M
      {
2392
1.34M
        if (!second ||
2393
921k
      (r.inputCount <= 2 ||
2394
511k
       (!match_input ||
2395
511k
        match_input (*second, input.arrayZ[1], input_data)))
2396
1.34M
     )
2397
1.21M
  {
2398
1.21M
    if (r.apply (c, lookup_context))
2399
745k
    {
2400
745k
      if (unsafe_to != (unsigned) -1)
2401
443k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2402
745k
      return_trace (true);
2403
745k
    }
2404
1.21M
  }
2405
137k
  else
2406
137k
    unsafe_to = unsafe_to2;
2407
1.34M
      }
2408
1.92M
      else
2409
1.92M
      {
2410
1.92M
  if (unsafe_to == (unsigned) -1)
2411
576k
    unsafe_to = unsafe_to1;
2412
2413
  // Skip ahead to next possible first glyph match.
2414
2.39M
  for (; i + 1 < num_rules; i++)
2415
2.17M
  {
2416
2.17M
    const auto &r2 = this+rule.arrayZ[i + 1];
2417
2.17M
    const auto &input2 = r2.inputZ;
2418
2.17M
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
2419
1.71M
      break;
2420
2.17M
  }
2421
1.92M
      }
2422
3.27M
    }
2423
233k
    if (likely (unsafe_to != (unsigned) -1))
2424
226k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2425
2426
233k
    return_trace (false);
2427
978k
  }
OT::RuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2305
2.91M
  {
2306
2.91M
    TRACE_APPLY (this);
2307
2308
2.91M
    unsigned num_rules = rule.len;
2309
2310
2.91M
#ifndef HB_NO_OT_RULESETS_FAST_PATH
2311
2.91M
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
2312
2.15M
#endif
2313
2.15M
    {
2314
2.16M
    slow:
2315
2.16M
      return_trace (
2316
2.15M
      + hb_iter (rule)
2317
2.15M
      | hb_map (hb_add (this))
2318
2.15M
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2319
2.15M
      | hb_any
2320
2.15M
      )
2321
2.15M
      ;
2322
2.15M
    }
2323
2324
    /* This version is optimized for speed by matching the first & second
2325
     * components of the rule here, instead of calling into the matching code.
2326
     *
2327
     * Replicated from LigatureSet::apply(). */
2328
2329
    /* We use the iter_context instead of iter_input, to avoid skipping
2330
     * default-ignorables and such.
2331
     *
2332
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
2333
     */
2334
755k
    auto &skippy_iter = c->iter_context;
2335
755k
    skippy_iter.reset (c->buffer->idx);
2336
755k
    skippy_iter.set_match_func (match_always, nullptr);
2337
755k
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
2338
755k
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
2339
755k
    hb_glyph_info_t *first = nullptr, *second = nullptr;
2340
755k
    bool matched = skippy_iter.next ();
2341
755k
    if (likely (matched))
2342
747k
    {
2343
747k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2344
3.87k
      {
2345
  /* Can't use the fast path if eg. the next char is a default-ignorable
2346
   * or other skippable. */
2347
3.87k
        goto slow;
2348
3.87k
      }
2349
2350
743k
      first = &c->buffer->info[skippy_iter.idx];
2351
743k
      unsafe_to1 = skippy_iter.idx + 1;
2352
743k
    }
2353
8.45k
    else
2354
8.45k
    {
2355
      /* Failed to match a next glyph. Only try applying rules that have
2356
       * no further input. */
2357
8.45k
      return_trace (
2358
8.45k
      + hb_iter (rule)
2359
8.45k
      | hb_map (hb_add (this))
2360
8.45k
      | hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; })
2361
8.45k
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2362
8.45k
      | hb_any
2363
8.45k
      )
2364
8.45k
      ;
2365
8.45k
    }
2366
743k
    matched = skippy_iter.next ();
2367
743k
    if (likely (matched))
2368
539k
    {
2369
539k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2370
2.70k
      {
2371
  /* Can't use the fast path if eg. the next char is a default-ignorable
2372
   * or other skippable. */
2373
2.70k
        goto slow;
2374
2.70k
      }
2375
2376
536k
      second = &c->buffer->info[skippy_iter.idx];
2377
536k
      unsafe_to2 = skippy_iter.idx + 1;
2378
536k
    }
2379
2380
740k
    auto match_input = lookup_context.funcs.match;
2381
740k
    auto *input_data = lookup_context.match_data;
2382
3.15M
    for (unsigned int i = 0; i < num_rules; i++)
2383
2.93M
    {
2384
2.93M
      const auto &r = this+rule.arrayZ[i];
2385
2386
2.93M
      const auto &input = r.inputZ;
2387
2388
2.93M
      if (r.inputCount <= 1 ||
2389
2.60M
    (!match_input ||
2390
2.60M
     match_input (*first, input.arrayZ[0], input_data)))
2391
1.01M
      {
2392
1.01M
        if (!second ||
2393
734k
      (r.inputCount <= 2 ||
2394
435k
       (!match_input ||
2395
435k
        match_input (*second, input.arrayZ[1], input_data)))
2396
1.01M
     )
2397
909k
  {
2398
909k
    if (r.apply (c, lookup_context))
2399
517k
    {
2400
517k
      if (unsafe_to != (unsigned) -1)
2401
435k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2402
517k
      return_trace (true);
2403
517k
    }
2404
909k
  }
2405
105k
  else
2406
105k
    unsafe_to = unsafe_to2;
2407
1.01M
      }
2408
1.92M
      else
2409
1.92M
      {
2410
1.92M
  if (unsafe_to == (unsigned) -1)
2411
569k
    unsafe_to = unsafe_to1;
2412
2413
  // Skip ahead to next possible first glyph match.
2414
2.37M
  for (; i + 1 < num_rules; i++)
2415
2.15M
  {
2416
2.15M
    const auto &r2 = this+rule.arrayZ[i + 1];
2417
2.15M
    const auto &input2 = r2.inputZ;
2418
2.15M
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
2419
1.70M
      break;
2420
2.15M
  }
2421
1.92M
      }
2422
2.93M
    }
2423
222k
    if (likely (unsafe_to != (unsigned) -1))
2424
222k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2425
2426
222k
    return_trace (false);
2427
740k
  }
OT::RuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Line
Count
Source
2305
575k
  {
2306
575k
    TRACE_APPLY (this);
2307
2308
575k
    unsigned num_rules = rule.len;
2309
2310
575k
#ifndef HB_NO_OT_RULESETS_FAST_PATH
2311
575k
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
2312
63.2k
#endif
2313
63.2k
    {
2314
81.8k
    slow:
2315
81.8k
      return_trace (
2316
63.2k
      + hb_iter (rule)
2317
63.2k
      | hb_map (hb_add (this))
2318
63.2k
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2319
63.2k
      | hb_any
2320
63.2k
      )
2321
63.2k
      ;
2322
63.2k
    }
2323
2324
    /* This version is optimized for speed by matching the first & second
2325
     * components of the rule here, instead of calling into the matching code.
2326
     *
2327
     * Replicated from LigatureSet::apply(). */
2328
2329
    /* We use the iter_context instead of iter_input, to avoid skipping
2330
     * default-ignorables and such.
2331
     *
2332
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
2333
     */
2334
512k
    auto &skippy_iter = c->iter_context;
2335
512k
    skippy_iter.reset (c->buffer->idx);
2336
512k
    skippy_iter.set_match_func (match_always, nullptr);
2337
512k
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
2338
512k
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
2339
512k
    hb_glyph_info_t *first = nullptr, *second = nullptr;
2340
512k
    bool matched = skippy_iter.next ();
2341
512k
    if (likely (matched))
2342
256k
    {
2343
256k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2344
13.8k
      {
2345
  /* Can't use the fast path if eg. the next char is a default-ignorable
2346
   * or other skippable. */
2347
13.8k
        goto slow;
2348
13.8k
      }
2349
2350
243k
      first = &c->buffer->info[skippy_iter.idx];
2351
243k
      unsafe_to1 = skippy_iter.idx + 1;
2352
243k
    }
2353
255k
    else
2354
255k
    {
2355
      /* Failed to match a next glyph. Only try applying rules that have
2356
       * no further input. */
2357
255k
      return_trace (
2358
255k
      + hb_iter (rule)
2359
255k
      | hb_map (hb_add (this))
2360
255k
      | hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; })
2361
255k
      | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
2362
255k
      | hb_any
2363
255k
      )
2364
255k
      ;
2365
255k
    }
2366
243k
    matched = skippy_iter.next ();
2367
243k
    if (likely (matched))
2368
130k
    {
2369
130k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
2370
4.79k
      {
2371
  /* Can't use the fast path if eg. the next char is a default-ignorable
2372
   * or other skippable. */
2373
4.79k
        goto slow;
2374
4.79k
      }
2375
2376
125k
      second = &c->buffer->info[skippy_iter.idx];
2377
125k
      unsafe_to2 = skippy_iter.idx + 1;
2378
125k
    }
2379
2380
238k
    auto match_input = lookup_context.funcs.match;
2381
238k
    auto *input_data = lookup_context.match_data;
2382
352k
    for (unsigned int i = 0; i < num_rules; i++)
2383
341k
    {
2384
341k
      const auto &r = this+rule.arrayZ[i];
2385
2386
341k
      const auto &input = r.inputZ;
2387
2388
341k
      if (r.inputCount <= 1 ||
2389
335k
    (!match_input ||
2390
335k
     match_input (*first, input.arrayZ[0], input_data)))
2391
333k
      {
2392
333k
        if (!second ||
2393
187k
      (r.inputCount <= 2 ||
2394
75.4k
       (!match_input ||
2395
75.4k
        match_input (*second, input.arrayZ[1], input_data)))
2396
333k
     )
2397
301k
  {
2398
301k
    if (r.apply (c, lookup_context))
2399
227k
    {
2400
227k
      if (unsafe_to != (unsigned) -1)
2401
7.37k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2402
227k
      return_trace (true);
2403
227k
    }
2404
301k
  }
2405
31.8k
  else
2406
31.8k
    unsafe_to = unsafe_to2;
2407
333k
      }
2408
8.23k
      else
2409
8.23k
      {
2410
8.23k
  if (unsafe_to == (unsigned) -1)
2411
6.91k
    unsafe_to = unsafe_to1;
2412
2413
  // Skip ahead to next possible first glyph match.
2414
23.0k
  for (; i + 1 < num_rules; i++)
2415
22.6k
  {
2416
22.6k
    const auto &r2 = this+rule.arrayZ[i + 1];
2417
22.6k
    const auto &input2 = r2.inputZ;
2418
22.6k
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
2419
7.79k
      break;
2420
22.6k
  }
2421
8.23k
      }
2422
341k
    }
2423
11.0k
    if (likely (unsafe_to != (unsigned) -1))
2424
3.56k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
2425
2426
11.0k
    return_trace (false);
2427
238k
  }
2428
2429
  bool subset (hb_subset_context_t *c,
2430
         const hb_map_t *lookup_map,
2431
         const hb_map_t *klass_map = nullptr) const
2432
2.85k
  {
2433
2.85k
    TRACE_SUBSET (this);
2434
2435
2.85k
    auto snap = c->serializer->snapshot ();
2436
2.85k
    auto *out = c->serializer->start_embed (*this);
2437
2.85k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2438
2439
2.85k
    for (const Offset16To<Rule>& _ : rule)
2440
1.16M
    {
2441
1.16M
      if (!_) continue;
2442
23.6k
      auto o_snap = c->serializer->snapshot ();
2443
23.6k
      auto *o = out->rule.serialize_append (c->serializer);
2444
23.6k
      if (unlikely (!o)) continue;
2445
2446
20.9k
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
2447
14.6k
      {
2448
14.6k
  out->rule.pop ();
2449
14.6k
  c->serializer->revert (o_snap);
2450
14.6k
      }
2451
20.9k
    }
2452
2453
2.85k
    bool ret = bool (out->rule);
2454
2.85k
    if (!ret) c->serializer->revert (snap);
2455
2456
2.85k
    return_trace (ret);
2457
2.85k
  }
OT::RuleSet<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2432
2.46k
  {
2433
2.46k
    TRACE_SUBSET (this);
2434
2435
2.46k
    auto snap = c->serializer->snapshot ();
2436
2.46k
    auto *out = c->serializer->start_embed (*this);
2437
2.46k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2438
2439
2.46k
    for (const Offset16To<Rule>& _ : rule)
2440
1.16M
    {
2441
1.16M
      if (!_) continue;
2442
21.2k
      auto o_snap = c->serializer->snapshot ();
2443
21.2k
      auto *o = out->rule.serialize_append (c->serializer);
2444
21.2k
      if (unlikely (!o)) continue;
2445
2446
18.4k
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
2447
13.1k
      {
2448
13.1k
  out->rule.pop ();
2449
13.1k
  c->serializer->revert (o_snap);
2450
13.1k
      }
2451
18.4k
    }
2452
2453
2.46k
    bool ret = bool (out->rule);
2454
2.46k
    if (!ret) c->serializer->revert (snap);
2455
2456
2.46k
    return_trace (ret);
2457
2.46k
  }
OT::RuleSet<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Line
Count
Source
2432
393
  {
2433
393
    TRACE_SUBSET (this);
2434
2435
393
    auto snap = c->serializer->snapshot ();
2436
393
    auto *out = c->serializer->start_embed (*this);
2437
393
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2438
2439
393
    for (const Offset16To<Rule>& _ : rule)
2440
5.33k
    {
2441
5.33k
      if (!_) continue;
2442
2.43k
      auto o_snap = c->serializer->snapshot ();
2443
2.43k
      auto *o = out->rule.serialize_append (c->serializer);
2444
2.43k
      if (unlikely (!o)) continue;
2445
2446
2.41k
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
2447
1.46k
      {
2448
1.46k
  out->rule.pop ();
2449
1.46k
  c->serializer->revert (o_snap);
2450
1.46k
      }
2451
2.41k
    }
2452
2453
393
    bool ret = bool (out->rule);
2454
393
    if (!ret) c->serializer->revert (snap);
2455
2456
393
    return_trace (ret);
2457
393
  }
2458
2459
  bool sanitize (hb_sanitize_context_t *c) const
2460
44.3k
  {
2461
44.3k
    TRACE_SANITIZE (this);
2462
44.3k
    return_trace (rule.sanitize (c, this));
2463
44.3k
  }
OT::RuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2460
41.7k
  {
2461
41.7k
    TRACE_SANITIZE (this);
2462
41.7k
    return_trace (rule.sanitize (c, this));
2463
41.7k
  }
OT::RuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2460
2.61k
  {
2461
2.61k
    TRACE_SANITIZE (this);
2462
2.61k
    return_trace (rule.sanitize (c, this));
2463
2.61k
  }
2464
2465
  protected:
2466
  Array16OfOffset16To<Rule>
2467
    rule;     /* Array of Rule tables
2468
           * ordered by preference */
2469
  public:
2470
  DEFINE_SIZE_ARRAY (2, rule);
2471
};
2472
2473
2474
template <typename Types>
2475
struct ContextFormat1_4
2476
{
2477
  using RuleSet = OT::RuleSet<Types>;
2478
2479
  bool intersects (const hb_set_t *glyphs) const
2480
4.93k
  {
2481
4.93k
    struct ContextClosureLookupContext lookup_context = {
2482
4.93k
      {intersects_glyph, intersected_glyph},
2483
4.93k
      ContextFormat::SimpleContext,
2484
4.93k
      nullptr
2485
4.93k
    };
2486
2487
4.93k
    return
2488
4.93k
    + hb_zip (this+coverage, ruleSet)
2489
4.93k
    | hb_filter (*glyphs, hb_first)
2490
4.93k
    | hb_map (hb_second)
2491
4.93k
    | hb_map (hb_add (this))
2492
4.93k
    | 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
2492
2.97k
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
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
Line
Count
Source
2492
707
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
2493
4.93k
    | hb_any
2494
4.93k
    ;
2495
4.93k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2480
3.90k
  {
2481
3.90k
    struct ContextClosureLookupContext lookup_context = {
2482
3.90k
      {intersects_glyph, intersected_glyph},
2483
3.90k
      ContextFormat::SimpleContext,
2484
3.90k
      nullptr
2485
3.90k
    };
2486
2487
3.90k
    return
2488
3.90k
    + hb_zip (this+coverage, ruleSet)
2489
3.90k
    | hb_filter (*glyphs, hb_first)
2490
3.90k
    | hb_map (hb_second)
2491
3.90k
    | hb_map (hb_add (this))
2492
3.90k
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
2493
3.90k
    | hb_any
2494
3.90k
    ;
2495
3.90k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2480
1.03k
  {
2481
1.03k
    struct ContextClosureLookupContext lookup_context = {
2482
1.03k
      {intersects_glyph, intersected_glyph},
2483
1.03k
      ContextFormat::SimpleContext,
2484
1.03k
      nullptr
2485
1.03k
    };
2486
2487
1.03k
    return
2488
1.03k
    + hb_zip (this+coverage, ruleSet)
2489
1.03k
    | hb_filter (*glyphs, hb_first)
2490
1.03k
    | hb_map (hb_second)
2491
1.03k
    | hb_map (hb_add (this))
2492
1.03k
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
2493
1.03k
    | hb_any
2494
1.03k
    ;
2495
1.03k
  }
2496
2497
  bool may_have_non_1to1 () const
2498
96
  { return true; }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
2498
96
  { return true; }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
2499
2500
  void closure (hb_closure_context_t *c) const
2501
5.54k
  {
2502
5.54k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2503
5.54k
    if (unlikely (!cur_active_glyphs)) return;
2504
5.52k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
2505
2506
5.52k
    struct ContextClosureLookupContext lookup_context = {
2507
5.52k
      {intersects_glyph, intersected_glyph},
2508
5.52k
      ContextFormat::SimpleContext,
2509
5.52k
      nullptr
2510
5.52k
    };
2511
2512
5.52k
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
2513
10.9k
    | hb_filter ([&] (hb_codepoint_t _) {
2514
10.9k
      return c->previous_parent_active_glyphs ().has (_);
2515
10.9k
    }, 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
2513
10.1k
    | hb_filter ([&] (hb_codepoint_t _) {
2514
10.1k
      return c->previous_parent_active_glyphs ().has (_);
2515
10.1k
    }, hb_first)
OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
2513
759
    | hb_filter ([&] (hb_codepoint_t _) {
2514
759
      return c->previous_parent_active_glyphs ().has (_);
2515
759
    }, hb_first)
2516
6.00k
    | 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
2516
5.44k
    | 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::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
Line
Count
Source
2516
562
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
2517
6.00k
    | 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
2517
5.44k
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
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
Line
Count
Source
2517
562
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
2518
5.52k
    ;
2519
2520
5.52k
    c->pop_cur_done_glyphs ();
2521
5.52k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2501
4.74k
  {
2502
4.74k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2503
4.74k
    if (unlikely (!cur_active_glyphs)) return;
2504
4.73k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
2505
2506
4.73k
    struct ContextClosureLookupContext lookup_context = {
2507
4.73k
      {intersects_glyph, intersected_glyph},
2508
4.73k
      ContextFormat::SimpleContext,
2509
4.73k
      nullptr
2510
4.73k
    };
2511
2512
4.73k
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
2513
4.73k
    | hb_filter ([&] (hb_codepoint_t _) {
2514
4.73k
      return c->previous_parent_active_glyphs ().has (_);
2515
4.73k
    }, hb_first)
2516
4.73k
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
2517
4.73k
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
2518
4.73k
    ;
2519
2520
4.73k
    c->pop_cur_done_glyphs ();
2521
4.73k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2501
798
  {
2502
798
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2503
798
    if (unlikely (!cur_active_glyphs)) return;
2504
787
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
2505
2506
787
    struct ContextClosureLookupContext lookup_context = {
2507
787
      {intersects_glyph, intersected_glyph},
2508
787
      ContextFormat::SimpleContext,
2509
787
      nullptr
2510
787
    };
2511
2512
787
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
2513
787
    | hb_filter ([&] (hb_codepoint_t _) {
2514
787
      return c->previous_parent_active_glyphs ().has (_);
2515
787
    }, hb_first)
2516
787
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
2517
787
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
2518
787
    ;
2519
2520
787
    c->pop_cur_done_glyphs ();
2521
787
  }
2522
2523
  void closure_lookups (hb_closure_lookups_context_t *c) const
2524
2.05k
  {
2525
2.05k
    struct ContextClosureLookupContext lookup_context = {
2526
2.05k
      {intersects_glyph, nullptr},
2527
2.05k
      ContextFormat::SimpleContext,
2528
2.05k
      nullptr
2529
2.05k
    };
2530
2531
2.05k
    + hb_zip (this+coverage, ruleSet)
2532
2.05k
    | hb_filter (*c->glyphs, hb_first)
2533
2.05k
    | hb_map (hb_second)
2534
2.05k
    | hb_map (hb_add (this))
2535
2.46k
    | 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
2535
1.90k
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
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
Line
Count
Source
2535
557
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
2536
2.05k
    ;
2537
2.05k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2524
1.50k
  {
2525
1.50k
    struct ContextClosureLookupContext lookup_context = {
2526
1.50k
      {intersects_glyph, nullptr},
2527
1.50k
      ContextFormat::SimpleContext,
2528
1.50k
      nullptr
2529
1.50k
    };
2530
2531
1.50k
    + hb_zip (this+coverage, ruleSet)
2532
1.50k
    | hb_filter (*c->glyphs, hb_first)
2533
1.50k
    | hb_map (hb_second)
2534
1.50k
    | hb_map (hb_add (this))
2535
1.50k
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
2536
1.50k
    ;
2537
1.50k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2524
552
  {
2525
552
    struct ContextClosureLookupContext lookup_context = {
2526
552
      {intersects_glyph, nullptr},
2527
552
      ContextFormat::SimpleContext,
2528
552
      nullptr
2529
552
    };
2530
2531
552
    + hb_zip (this+coverage, ruleSet)
2532
552
    | hb_filter (*c->glyphs, hb_first)
2533
552
    | hb_map (hb_second)
2534
552
    | hb_map (hb_add (this))
2535
552
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
2536
552
    ;
2537
552
  }
2538
2539
1
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Line
Count
Source
2539
1
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
2540
2541
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2542
0
  {
2543
0
    (this+coverage).collect_coverage (c->input);
2544
2545
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2546
0
      {collect_glyph},
2547
0
      nullptr
2548
0
    };
2549
2550
0
    + hb_iter (ruleSet)
2551
0
    | hb_map (hb_add (this))
2552
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
2553
0
    ;
2554
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
2555
2556
  bool would_apply (hb_would_apply_context_t *c) const
2557
6.10k
  {
2558
6.10k
    const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
2559
6.10k
    struct ContextApplyLookupContext lookup_context = {
2560
6.10k
      {match_glyph},
2561
6.10k
      nullptr
2562
6.10k
    };
2563
6.10k
    return rule_set.would_apply (c, lookup_context);
2564
6.10k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
2557
4.80k
  {
2558
4.80k
    const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
2559
4.80k
    struct ContextApplyLookupContext lookup_context = {
2560
4.80k
      {match_glyph},
2561
4.80k
      nullptr
2562
4.80k
    };
2563
4.80k
    return rule_set.would_apply (c, lookup_context);
2564
4.80k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
2557
1.29k
  {
2558
1.29k
    const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
2559
1.29k
    struct ContextApplyLookupContext lookup_context = {
2560
1.29k
      {match_glyph},
2561
1.29k
      nullptr
2562
1.29k
    };
2563
1.29k
    return rule_set.would_apply (c, lookup_context);
2564
1.29k
  }
2565
2566
11.6k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
2566
9.36k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
2566
2.24k
  const Coverage &get_coverage () const { return this+coverage; }
2567
2568
  bool apply (hb_ot_apply_context_t *c) const
2569
3.39M
  {
2570
3.39M
    TRACE_APPLY (this);
2571
3.39M
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2572
3.39M
    if (likely (index == NOT_COVERED))
2573
308k
      return_trace (false);
2574
2575
3.08M
    const RuleSet &rule_set = this+ruleSet[index];
2576
3.08M
    struct ContextApplyLookupContext lookup_context = {
2577
3.08M
      {match_glyph},
2578
3.08M
      nullptr
2579
3.08M
    };
2580
3.08M
    return_trace (rule_set.apply (c, lookup_context));
2581
3.39M
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
2569
2.81M
  {
2570
2.81M
    TRACE_APPLY (this);
2571
2.81M
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2572
2.81M
    if (likely (index == NOT_COVERED))
2573
307k
      return_trace (false);
2574
2575
2.51M
    const RuleSet &rule_set = this+ruleSet[index];
2576
2.51M
    struct ContextApplyLookupContext lookup_context = {
2577
2.51M
      {match_glyph},
2578
2.51M
      nullptr
2579
2.51M
    };
2580
2.51M
    return_trace (rule_set.apply (c, lookup_context));
2581
2.81M
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
2569
576k
  {
2570
576k
    TRACE_APPLY (this);
2571
576k
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2572
576k
    if (likely (index == NOT_COVERED))
2573
1.05k
      return_trace (false);
2574
2575
575k
    const RuleSet &rule_set = this+ruleSet[index];
2576
575k
    struct ContextApplyLookupContext lookup_context = {
2577
575k
      {match_glyph},
2578
575k
      nullptr
2579
575k
    };
2580
575k
    return_trace (rule_set.apply (c, lookup_context));
2581
576k
  }
2582
2583
  bool subset (hb_subset_context_t *c) const
2584
2.07k
  {
2585
2.07k
    TRACE_SUBSET (this);
2586
2.07k
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
2587
2.07k
    const hb_map_t &glyph_map = *c->plan->glyph_map;
2588
2589
2.07k
    auto *out = c->serializer->start_embed (*this);
2590
2.07k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2591
2.06k
    out->format = format;
2592
2593
2.06k
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2594
2.06k
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
2595
2.06k
    + hb_zip (this+coverage, ruleSet)
2596
2.06k
    | hb_filter (glyphset, hb_first)
2597
2.06k
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
2598
2.06k
    | hb_map (hb_first)
2599
2.06k
    | hb_map (glyph_map)
2600
2.06k
    | hb_sink (new_coverage)
2601
2.06k
    ;
2602
2603
2.06k
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
2604
2.06k
    return_trace (bool (new_coverage));
2605
2.07k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2584
1.68k
  {
2585
1.68k
    TRACE_SUBSET (this);
2586
1.68k
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
2587
1.68k
    const hb_map_t &glyph_map = *c->plan->glyph_map;
2588
2589
1.68k
    auto *out = c->serializer->start_embed (*this);
2590
1.68k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2591
1.68k
    out->format = format;
2592
2593
1.68k
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2594
1.68k
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
2595
1.68k
    + hb_zip (this+coverage, ruleSet)
2596
1.68k
    | hb_filter (glyphset, hb_first)
2597
1.68k
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
2598
1.68k
    | hb_map (hb_first)
2599
1.68k
    | hb_map (glyph_map)
2600
1.68k
    | hb_sink (new_coverage)
2601
1.68k
    ;
2602
2603
1.68k
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
2604
1.68k
    return_trace (bool (new_coverage));
2605
1.68k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2584
387
  {
2585
387
    TRACE_SUBSET (this);
2586
387
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
2587
387
    const hb_map_t &glyph_map = *c->plan->glyph_map;
2588
2589
387
    auto *out = c->serializer->start_embed (*this);
2590
387
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2591
387
    out->format = format;
2592
2593
387
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2594
387
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
2595
387
    + hb_zip (this+coverage, ruleSet)
2596
387
    | hb_filter (glyphset, hb_first)
2597
387
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
2598
387
    | hb_map (hb_first)
2599
387
    | hb_map (glyph_map)
2600
387
    | hb_sink (new_coverage)
2601
387
    ;
2602
2603
387
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
2604
387
    return_trace (bool (new_coverage));
2605
387
  }
2606
2607
  bool sanitize (hb_sanitize_context_t *c) const
2608
14.5k
  {
2609
14.5k
    TRACE_SANITIZE (this);
2610
14.5k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2611
14.5k
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2608
10.1k
  {
2609
10.1k
    TRACE_SANITIZE (this);
2610
10.1k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2611
10.1k
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2608
4.43k
  {
2609
4.43k
    TRACE_SANITIZE (this);
2610
4.43k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
2611
4.43k
  }
2612
2613
  protected:
2614
  HBUINT16  format;     /* Format identifier--format = 1 */
2615
  typename Types::template OffsetTo<Coverage>
2616
    coverage;   /* Offset to Coverage table--from
2617
           * beginning of table */
2618
  Array16Of<typename Types::template OffsetTo<RuleSet>>
2619
    ruleSet;    /* Array of RuleSet tables
2620
           * ordered by Coverage Index */
2621
  public:
2622
  DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet);
2623
};
2624
2625
2626
template <typename Types>
2627
struct ContextFormat2_5
2628
{
2629
  using RuleSet = OT::RuleSet<SmallTypes>;
2630
2631
  bool intersects (const hb_set_t *glyphs) const
2632
4.19k
  {
2633
4.19k
    if (!(this+coverage).intersects (glyphs))
2634
2.18k
      return false;
2635
2636
2.01k
    const ClassDef &class_def = this+classDef;
2637
2638
2.01k
    hb_map_t cache;
2639
2.01k
    struct ContextClosureLookupContext lookup_context = {
2640
2.01k
      {intersects_class, nullptr},
2641
2.01k
      ContextFormat::ClassBasedContext,
2642
2.01k
      &class_def,
2643
2.01k
      &cache
2644
2.01k
    };
2645
2646
2.01k
    hb_set_t retained_coverage_glyphs;
2647
2.01k
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2648
2649
2.01k
    hb_set_t coverage_glyph_classes;
2650
2.01k
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2651
2652
2653
2.01k
    return
2654
2.01k
    + hb_iter (ruleSet)
2655
2.01k
    | hb_map (hb_add (this))
2656
2.01k
    | hb_enumerate
2657
2.01k
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2658
2.82k
        { return class_def.intersects_class (glyphs, p.first) &&
2659
1.79k
           coverage_glyph_classes.has (p.first) &&
2660
1.53k
           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
2658
2.13k
        { return class_def.intersects_class (glyphs, p.first) &&
2659
1.38k
           coverage_glyph_classes.has (p.first) &&
2660
1.14k
           p.second.intersects (glyphs, lookup_context); })
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
Line
Count
Source
2658
692
        { return class_def.intersects_class (glyphs, p.first) &&
2659
410
           coverage_glyph_classes.has (p.first) &&
2660
390
           p.second.intersects (glyphs, lookup_context); })
2661
2.01k
    | hb_any
2662
4.19k
    ;
2663
4.19k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2632
3.55k
  {
2633
3.55k
    if (!(this+coverage).intersects (glyphs))
2634
1.91k
      return false;
2635
2636
1.64k
    const ClassDef &class_def = this+classDef;
2637
2638
1.64k
    hb_map_t cache;
2639
1.64k
    struct ContextClosureLookupContext lookup_context = {
2640
1.64k
      {intersects_class, nullptr},
2641
1.64k
      ContextFormat::ClassBasedContext,
2642
1.64k
      &class_def,
2643
1.64k
      &cache
2644
1.64k
    };
2645
2646
1.64k
    hb_set_t retained_coverage_glyphs;
2647
1.64k
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2648
2649
1.64k
    hb_set_t coverage_glyph_classes;
2650
1.64k
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2651
2652
2653
1.64k
    return
2654
1.64k
    + hb_iter (ruleSet)
2655
1.64k
    | hb_map (hb_add (this))
2656
1.64k
    | hb_enumerate
2657
1.64k
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2658
1.64k
        { return class_def.intersects_class (glyphs, p.first) &&
2659
1.64k
           coverage_glyph_classes.has (p.first) &&
2660
1.64k
           p.second.intersects (glyphs, lookup_context); })
2661
1.64k
    | hb_any
2662
3.55k
    ;
2663
3.55k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
Line
Count
Source
2632
634
  {
2633
634
    if (!(this+coverage).intersects (glyphs))
2634
269
      return false;
2635
2636
365
    const ClassDef &class_def = this+classDef;
2637
2638
365
    hb_map_t cache;
2639
365
    struct ContextClosureLookupContext lookup_context = {
2640
365
      {intersects_class, nullptr},
2641
365
      ContextFormat::ClassBasedContext,
2642
365
      &class_def,
2643
365
      &cache
2644
365
    };
2645
2646
365
    hb_set_t retained_coverage_glyphs;
2647
365
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
2648
2649
365
    hb_set_t coverage_glyph_classes;
2650
365
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2651
2652
2653
365
    return
2654
365
    + hb_iter (ruleSet)
2655
365
    | hb_map (hb_add (this))
2656
365
    | hb_enumerate
2657
365
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2658
365
        { return class_def.intersects_class (glyphs, p.first) &&
2659
365
           coverage_glyph_classes.has (p.first) &&
2660
365
           p.second.intersects (glyphs, lookup_context); })
2661
365
    | hb_any
2662
634
    ;
2663
634
  }
2664
2665
  bool may_have_non_1to1 () const
2666
21
  { return true; }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
2666
21
  { return true; }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
2667
2668
  void closure (hb_closure_context_t *c) const
2669
3.83k
  {
2670
3.83k
    if (!(this+coverage).intersects (c->glyphs))
2671
1.63k
      return;
2672
2673
2.19k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2674
2.19k
    if (unlikely (!cur_active_glyphs)) return;
2675
2.16k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2676
2.16k
           *cur_active_glyphs);
2677
2678
2.16k
    const ClassDef &class_def = this+classDef;
2679
2680
2.16k
    hb_map_t cache;
2681
2.16k
    intersected_class_cache_t intersected_cache;
2682
2.16k
    struct ContextClosureLookupContext lookup_context = {
2683
2.16k
      {intersects_class, intersected_class_glyphs},
2684
2.16k
      ContextFormat::ClassBasedContext,
2685
2.16k
      &class_def,
2686
2.16k
      &cache,
2687
2.16k
      &intersected_cache
2688
2.16k
    };
2689
2690
2.16k
    + hb_enumerate (ruleSet)
2691
2.16k
    | hb_filter ([&] (unsigned _)
2692
5.25k
    { 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
2692
4.65k
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
2692
602
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
2693
2.16k
     hb_first)
2694
2.16k
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2695
2.56k
                {
2696
2.56k
                  const RuleSet& rule_set = this+_.second;
2697
2.56k
                  rule_set.closure (c, _.first, lookup_context);
2698
2.56k
                })
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
2695
2.25k
                {
2696
2.25k
                  const RuleSet& rule_set = this+_.second;
2697
2.25k
                  rule_set.closure (c, _.first, lookup_context);
2698
2.25k
                })
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
Line
Count
Source
2695
305
                {
2696
305
                  const RuleSet& rule_set = this+_.second;
2697
305
                  rule_set.closure (c, _.first, lookup_context);
2698
305
                })
2699
2.16k
    ;
2700
2701
2.16k
    c->pop_cur_done_glyphs ();
2702
2.16k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2669
3.34k
  {
2670
3.34k
    if (!(this+coverage).intersects (c->glyphs))
2671
1.44k
      return;
2672
2673
1.90k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2674
1.90k
    if (unlikely (!cur_active_glyphs)) return;
2675
1.86k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2676
1.86k
           *cur_active_glyphs);
2677
2678
1.86k
    const ClassDef &class_def = this+classDef;
2679
2680
1.86k
    hb_map_t cache;
2681
1.86k
    intersected_class_cache_t intersected_cache;
2682
1.86k
    struct ContextClosureLookupContext lookup_context = {
2683
1.86k
      {intersects_class, intersected_class_glyphs},
2684
1.86k
      ContextFormat::ClassBasedContext,
2685
1.86k
      &class_def,
2686
1.86k
      &cache,
2687
1.86k
      &intersected_cache
2688
1.86k
    };
2689
2690
1.86k
    + hb_enumerate (ruleSet)
2691
1.86k
    | hb_filter ([&] (unsigned _)
2692
1.86k
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
2693
1.86k
     hb_first)
2694
1.86k
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2695
1.86k
                {
2696
1.86k
                  const RuleSet& rule_set = this+_.second;
2697
1.86k
                  rule_set.closure (c, _.first, lookup_context);
2698
1.86k
                })
2699
1.86k
    ;
2700
2701
1.86k
    c->pop_cur_done_glyphs ();
2702
1.86k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
2669
485
  {
2670
485
    if (!(this+coverage).intersects (c->glyphs))
2671
189
      return;
2672
2673
296
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2674
296
    if (unlikely (!cur_active_glyphs)) return;
2675
296
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2676
296
           *cur_active_glyphs);
2677
2678
296
    const ClassDef &class_def = this+classDef;
2679
2680
296
    hb_map_t cache;
2681
296
    intersected_class_cache_t intersected_cache;
2682
296
    struct ContextClosureLookupContext lookup_context = {
2683
296
      {intersects_class, intersected_class_glyphs},
2684
296
      ContextFormat::ClassBasedContext,
2685
296
      &class_def,
2686
296
      &cache,
2687
296
      &intersected_cache
2688
296
    };
2689
2690
296
    + hb_enumerate (ruleSet)
2691
296
    | hb_filter ([&] (unsigned _)
2692
296
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
2693
296
     hb_first)
2694
296
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
2695
296
                {
2696
296
                  const RuleSet& rule_set = this+_.second;
2697
296
                  rule_set.closure (c, _.first, lookup_context);
2698
296
                })
2699
296
    ;
2700
2701
296
    c->pop_cur_done_glyphs ();
2702
296
  }
2703
2704
  void closure_lookups (hb_closure_lookups_context_t *c) const
2705
1.90k
  {
2706
1.90k
    if (!(this+coverage).intersects (c->glyphs))
2707
968
      return;
2708
2709
938
    const ClassDef &class_def = this+classDef;
2710
2711
938
    hb_map_t cache;
2712
938
    struct ContextClosureLookupContext lookup_context = {
2713
938
      {intersects_class, nullptr},
2714
938
      ContextFormat::ClassBasedContext,
2715
938
      &class_def,
2716
938
      &cache
2717
938
    };
2718
2719
938
    + hb_iter (ruleSet)
2720
938
    | hb_map (hb_add (this))
2721
938
    | hb_enumerate
2722
938
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2723
2.50k
    { 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
2723
2.25k
    { return class_def.intersects_class (c->glyphs, p.first); })
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
Line
Count
Source
2723
256
    { return class_def.intersects_class (c->glyphs, p.first); })
2724
938
    | hb_map (hb_second)
2725
938
    | hb_apply ([&] (const RuleSet & _)
2726
1.46k
    { _.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
2726
1.24k
    { _.closure_lookups (c, lookup_context); });
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
Line
Count
Source
2726
220
    { _.closure_lookups (c, lookup_context); });
2727
938
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2705
1.67k
  {
2706
1.67k
    if (!(this+coverage).intersects (c->glyphs))
2707
844
      return;
2708
2709
828
    const ClassDef &class_def = this+classDef;
2710
2711
828
    hb_map_t cache;
2712
828
    struct ContextClosureLookupContext lookup_context = {
2713
828
      {intersects_class, nullptr},
2714
828
      ContextFormat::ClassBasedContext,
2715
828
      &class_def,
2716
828
      &cache
2717
828
    };
2718
2719
828
    + hb_iter (ruleSet)
2720
828
    | hb_map (hb_add (this))
2721
828
    | hb_enumerate
2722
828
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2723
828
    { return class_def.intersects_class (c->glyphs, p.first); })
2724
828
    | hb_map (hb_second)
2725
828
    | hb_apply ([&] (const RuleSet & _)
2726
828
    { _.closure_lookups (c, lookup_context); });
2727
828
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
2705
234
  {
2706
234
    if (!(this+coverage).intersects (c->glyphs))
2707
124
      return;
2708
2709
110
    const ClassDef &class_def = this+classDef;
2710
2711
110
    hb_map_t cache;
2712
110
    struct ContextClosureLookupContext lookup_context = {
2713
110
      {intersects_class, nullptr},
2714
110
      ContextFormat::ClassBasedContext,
2715
110
      &class_def,
2716
110
      &cache
2717
110
    };
2718
2719
110
    + hb_iter (ruleSet)
2720
110
    | hb_map (hb_add (this))
2721
110
    | hb_enumerate
2722
110
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
2723
110
    { return class_def.intersects_class (c->glyphs, p.first); })
2724
110
    | hb_map (hb_second)
2725
110
    | hb_apply ([&] (const RuleSet & _)
2726
110
    { _.closure_lookups (c, lookup_context); });
2727
110
  }
2728
2729
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
2730
2731
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2732
0
  {
2733
0
    (this+coverage).collect_coverage (c->input);
2734
2735
0
    const ClassDef &class_def = this+classDef;
2736
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2737
0
      {collect_class},
2738
0
      &class_def
2739
0
    };
2740
2741
0
    + hb_iter (ruleSet)
2742
0
    | hb_map (hb_add (this))
2743
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
2744
0
    ;
2745
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
2746
2747
  bool would_apply (hb_would_apply_context_t *c) const
2748
2.81k
  {
2749
2.81k
    const ClassDef &class_def = this+classDef;
2750
2.81k
    unsigned int index = class_def.get_class (c->glyphs[0]);
2751
2.81k
    const RuleSet &rule_set = this+ruleSet[index];
2752
2.81k
    struct ContextApplyLookupContext lookup_context = {
2753
2.81k
      {match_class},
2754
2.81k
      &class_def
2755
2.81k
    };
2756
2.81k
    return rule_set.would_apply (c, lookup_context);
2757
2.81k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
2748
2.24k
  {
2749
2.24k
    const ClassDef &class_def = this+classDef;
2750
2.24k
    unsigned int index = class_def.get_class (c->glyphs[0]);
2751
2.24k
    const RuleSet &rule_set = this+ruleSet[index];
2752
2.24k
    struct ContextApplyLookupContext lookup_context = {
2753
2.24k
      {match_class},
2754
2.24k
      &class_def
2755
2.24k
    };
2756
2.24k
    return rule_set.would_apply (c, lookup_context);
2757
2.24k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
2748
568
  {
2749
568
    const ClassDef &class_def = this+classDef;
2750
568
    unsigned int index = class_def.get_class (c->glyphs[0]);
2751
568
    const RuleSet &rule_set = this+ruleSet[index];
2752
568
    struct ContextApplyLookupContext lookup_context = {
2753
568
      {match_class},
2754
568
      &class_def
2755
568
    };
2756
568
    return rule_set.would_apply (c, lookup_context);
2757
568
  }
2758
2759
12.5k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
2759
9.39k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
2759
3.14k
  const Coverage &get_coverage () const { return this+coverage; }
2760
2761
  unsigned cache_cost () const
2762
10.3k
  {
2763
10.3k
    return (this+classDef).cost ();
2764
10.3k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Line
Count
Source
2762
7.52k
  {
2763
7.52k
    return (this+classDef).cost ();
2764
7.52k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
Line
Count
Source
2762
2.85k
  {
2763
2.85k
    return (this+classDef).cost ();
2764
2.85k
  }
2765
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
2766
5.61k
  {
2767
5.61k
    return context_cache_func (c, op);
2768
5.61k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
2766
3.41k
  {
2767
3.41k
    return context_cache_func (c, op);
2768
3.41k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
2766
2.19k
  {
2767
2.19k
    return context_cache_func (c, op);
2768
2.19k
  }
2769
2770
  struct external_cache_t
2771
  {
2772
    hb_ot_layout_binary_cache_t coverage;
2773
  };
2774
  void *external_cache_create () const
2775
5.58k
  {
2776
5.58k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
2777
5.58k
    if (likely (cache))
2778
5.46k
    {
2779
5.46k
      cache->coverage.clear ();
2780
5.46k
    }
2781
5.58k
    return cache;
2782
5.58k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Line
Count
Source
2775
4.36k
  {
2776
4.36k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
2777
4.36k
    if (likely (cache))
2778
4.28k
    {
2779
4.28k
      cache->coverage.clear ();
2780
4.28k
    }
2781
4.36k
    return cache;
2782
4.36k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
Line
Count
Source
2775
1.22k
  {
2776
1.22k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
2777
1.22k
    if (likely (cache))
2778
1.17k
    {
2779
1.17k
      cache->coverage.clear ();
2780
1.17k
    }
2781
1.22k
    return cache;
2782
1.22k
  }
2783
568k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
2783
556k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
2783
12.1k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
2784
366k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
2784
354k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
2784
12.5k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
2785
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
2786
935k
  {
2787
935k
    TRACE_APPLY (this);
2788
935k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
2789
935k
    external_cache_t *cache = (external_cache_t *) external_cache;
2790
935k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
2791
#else
2792
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2793
#endif
2794
935k
    if (index == NOT_COVERED) return_trace (false);
2795
2796
401k
    const ClassDef &class_def = this+classDef;
2797
2798
401k
    struct ContextApplyLookupContext lookup_context = {
2799
401k
      {cached ? match_class_cached : match_class},
2800
401k
      &class_def
2801
401k
    };
2802
2803
401k
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
2804
401k
    const RuleSet &rule_set = this+ruleSet[index];
2805
401k
    return_trace (rule_set.apply (c, lookup_context));
2806
935k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
2786
910k
  {
2787
910k
    TRACE_APPLY (this);
2788
910k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
2789
910k
    external_cache_t *cache = (external_cache_t *) external_cache;
2790
910k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
2791
#else
2792
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2793
#endif
2794
910k
    if (index == NOT_COVERED) return_trace (false);
2795
2796
380k
    const ClassDef &class_def = this+classDef;
2797
2798
380k
    struct ContextApplyLookupContext lookup_context = {
2799
380k
      {cached ? match_class_cached : match_class},
2800
380k
      &class_def
2801
380k
    };
2802
2803
380k
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
2804
380k
    const RuleSet &rule_set = this+ruleSet[index];
2805
380k
    return_trace (rule_set.apply (c, lookup_context));
2806
910k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
2786
24.6k
  {
2787
24.6k
    TRACE_APPLY (this);
2788
24.6k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
2789
24.6k
    external_cache_t *cache = (external_cache_t *) external_cache;
2790
24.6k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
2791
#else
2792
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
2793
#endif
2794
24.6k
    if (index == NOT_COVERED) return_trace (false);
2795
2796
21.2k
    const ClassDef &class_def = this+classDef;
2797
2798
21.2k
    struct ContextApplyLookupContext lookup_context = {
2799
21.2k
      {cached ? match_class_cached : match_class},
2800
21.2k
      &class_def
2801
21.2k
    };
2802
2803
21.2k
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
2804
21.2k
    const RuleSet &rule_set = this+ruleSet[index];
2805
21.2k
    return_trace (rule_set.apply (c, lookup_context));
2806
24.6k
  }
2807
2808
  bool subset (hb_subset_context_t *c) const
2809
514
  {
2810
514
    TRACE_SUBSET (this);
2811
514
    auto *out = c->serializer->start_embed (*this);
2812
514
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2813
514
    out->format = format;
2814
514
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
2815
60
      return_trace (false);
2816
2817
454
    hb_map_t klass_map;
2818
454
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
2819
2820
454
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
2821
454
    hb_set_t retained_coverage_glyphs;
2822
454
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
2823
2824
454
    hb_set_t coverage_glyph_classes;
2825
454
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2826
2827
454
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2828
454
    bool ret = true;
2829
454
    int non_zero_index = -1, index = 0;
2830
454
    auto snapshot = c->serializer->snapshot();
2831
454
    for (const auto& _ : + hb_enumerate (ruleSet)
2832
454
       | hb_filter (klass_map, hb_first))
2833
496
    {
2834
496
      auto *o = out->ruleSet.serialize_append (c->serializer);
2835
496
      if (unlikely (!o))
2836
1
      {
2837
1
  ret = false;
2838
1
  break;
2839
1
      }
2840
2841
495
      if (coverage_glyph_classes.has (_.first) &&
2842
460
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
2843
197
  non_zero_index = index;
2844
197
        snapshot = c->serializer->snapshot();
2845
197
      }
2846
2847
495
      index++;
2848
495
    }
2849
2850
454
    if (!ret || non_zero_index == -1) return_trace (false);
2851
2852
    //prune empty trailing ruleSets
2853
157
    --index;
2854
184
    while (index > non_zero_index)
2855
27
    {
2856
27
      out->ruleSet.pop ();
2857
27
      index--;
2858
27
    }
2859
157
    c->serializer->revert (snapshot);
2860
2861
157
    return_trace (bool (out->ruleSet));
2862
454
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2809
414
  {
2810
414
    TRACE_SUBSET (this);
2811
414
    auto *out = c->serializer->start_embed (*this);
2812
414
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2813
414
    out->format = format;
2814
414
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
2815
50
      return_trace (false);
2816
2817
364
    hb_map_t klass_map;
2818
364
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
2819
2820
364
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
2821
364
    hb_set_t retained_coverage_glyphs;
2822
364
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
2823
2824
364
    hb_set_t coverage_glyph_classes;
2825
364
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2826
2827
364
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2828
364
    bool ret = true;
2829
364
    int non_zero_index = -1, index = 0;
2830
364
    auto snapshot = c->serializer->snapshot();
2831
364
    for (const auto& _ : + hb_enumerate (ruleSet)
2832
364
       | hb_filter (klass_map, hb_first))
2833
422
    {
2834
422
      auto *o = out->ruleSet.serialize_append (c->serializer);
2835
422
      if (unlikely (!o))
2836
1
      {
2837
1
  ret = false;
2838
1
  break;
2839
1
      }
2840
2841
421
      if (coverage_glyph_classes.has (_.first) &&
2842
386
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
2843
187
  non_zero_index = index;
2844
187
        snapshot = c->serializer->snapshot();
2845
187
      }
2846
2847
421
      index++;
2848
421
    }
2849
2850
364
    if (!ret || non_zero_index == -1) return_trace (false);
2851
2852
    //prune empty trailing ruleSets
2853
147
    --index;
2854
174
    while (index > non_zero_index)
2855
27
    {
2856
27
      out->ruleSet.pop ();
2857
27
      index--;
2858
27
    }
2859
147
    c->serializer->revert (snapshot);
2860
2861
147
    return_trace (bool (out->ruleSet));
2862
364
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
2809
100
  {
2810
100
    TRACE_SUBSET (this);
2811
100
    auto *out = c->serializer->start_embed (*this);
2812
100
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2813
100
    out->format = format;
2814
100
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
2815
10
      return_trace (false);
2816
2817
90
    hb_map_t klass_map;
2818
90
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
2819
2820
90
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
2821
90
    hb_set_t retained_coverage_glyphs;
2822
90
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
2823
2824
90
    hb_set_t coverage_glyph_classes;
2825
90
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
2826
2827
90
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
2828
90
    bool ret = true;
2829
90
    int non_zero_index = -1, index = 0;
2830
90
    auto snapshot = c->serializer->snapshot();
2831
90
    for (const auto& _ : + hb_enumerate (ruleSet)
2832
90
       | hb_filter (klass_map, hb_first))
2833
74
    {
2834
74
      auto *o = out->ruleSet.serialize_append (c->serializer);
2835
74
      if (unlikely (!o))
2836
0
      {
2837
0
  ret = false;
2838
0
  break;
2839
0
      }
2840
2841
74
      if (coverage_glyph_classes.has (_.first) &&
2842
74
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
2843
10
  non_zero_index = index;
2844
10
        snapshot = c->serializer->snapshot();
2845
10
      }
2846
2847
74
      index++;
2848
74
    }
2849
2850
90
    if (!ret || non_zero_index == -1) return_trace (false);
2851
2852
    //prune empty trailing ruleSets
2853
10
    --index;
2854
10
    while (index > non_zero_index)
2855
0
    {
2856
0
      out->ruleSet.pop ();
2857
0
      index--;
2858
0
    }
2859
10
    c->serializer->revert (snapshot);
2860
2861
10
    return_trace (bool (out->ruleSet));
2862
90
  }
2863
2864
  bool sanitize (hb_sanitize_context_t *c) const
2865
26.1k
  {
2866
26.1k
    TRACE_SANITIZE (this);
2867
26.1k
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2868
26.1k
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2865
20.5k
  {
2866
20.5k
    TRACE_SANITIZE (this);
2867
20.5k
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2868
20.5k
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
2865
5.57k
  {
2866
5.57k
    TRACE_SANITIZE (this);
2867
5.57k
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
2868
5.57k
  }
2869
2870
  protected:
2871
  HBUINT16  format;     /* Format identifier--format = 2 */
2872
  typename Types::template OffsetTo<Coverage>
2873
    coverage;   /* Offset to Coverage table--from
2874
           * beginning of table */
2875
  typename Types::template OffsetTo<ClassDef>
2876
    classDef;   /* Offset to glyph ClassDef table--from
2877
           * beginning of table */
2878
  Array16Of<typename Types::template OffsetTo<RuleSet>>
2879
    ruleSet;    /* Array of RuleSet tables
2880
           * ordered by class */
2881
  public:
2882
  DEFINE_SIZE_ARRAY (4 + 2 * Types::size, ruleSet);
2883
};
2884
2885
2886
struct ContextFormat3
2887
{
2888
  using RuleSet = OT::RuleSet<SmallTypes>;
2889
2890
  bool intersects (const hb_set_t *glyphs) const
2891
3.71k
  {
2892
3.71k
    if (!(this+coverageZ[0]).intersects (glyphs))
2893
1.06k
      return false;
2894
2895
2.64k
    struct ContextClosureLookupContext lookup_context = {
2896
2.64k
      {intersects_coverage, nullptr},
2897
2.64k
      ContextFormat::CoverageBasedContext,
2898
2.64k
      this
2899
2.64k
    };
2900
2.64k
    return context_intersects (glyphs,
2901
2.64k
             glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2902
2.64k
             lookup_context);
2903
3.71k
  }
2904
2905
  bool may_have_non_1to1 () const
2906
252
  { return true; }
2907
2908
  void closure (hb_closure_context_t *c) const
2909
6.95k
  {
2910
6.95k
    if (!(this+coverageZ[0]).intersects (c->glyphs))
2911
1.58k
      return;
2912
2913
5.36k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
2914
5.36k
    if (unlikely (!cur_active_glyphs)) return;
2915
5.36k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
2916
5.36k
           *cur_active_glyphs);
2917
2918
5.36k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2919
5.36k
    struct ContextClosureLookupContext lookup_context = {
2920
5.36k
      {intersects_coverage, intersected_coverage_glyphs},
2921
5.36k
      ContextFormat::CoverageBasedContext,
2922
5.36k
      this
2923
5.36k
    };
2924
5.36k
    context_closure_lookup (c,
2925
5.36k
          glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2926
5.36k
          lookupCount, lookupRecord,
2927
5.36k
          0, lookup_context);
2928
2929
5.36k
    c->pop_cur_done_glyphs ();
2930
5.36k
  }
2931
2932
  void closure_lookups (hb_closure_lookups_context_t *c) const
2933
1.06k
  {
2934
1.06k
    if (!intersects (c->glyphs))
2935
199
      return;
2936
865
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2937
865
    recurse_lookups (c, lookupCount, lookupRecord);
2938
865
  }
2939
2940
1
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
2941
2942
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
2943
0
  {
2944
0
    (this+coverageZ[0]).collect_coverage (c->input);
2945
2946
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2947
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
2948
0
      {collect_coverage},
2949
0
      this
2950
0
    };
2951
2952
0
    context_collect_glyphs_lookup (c,
2953
0
           glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2954
0
           lookupCount, lookupRecord,
2955
0
           lookup_context);
2956
0
  }
2957
2958
  bool would_apply (hb_would_apply_context_t *c) const
2959
1.86k
  {
2960
1.86k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2961
1.86k
    struct ContextApplyLookupContext lookup_context = {
2962
1.86k
      {match_coverage},
2963
1.86k
      this
2964
1.86k
    };
2965
1.86k
    return context_would_apply_lookup (c,
2966
1.86k
               glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
2967
1.86k
               lookupCount, lookupRecord,
2968
1.86k
               lookup_context);
2969
1.86k
  }
2970
2971
6.84k
  const Coverage &get_coverage () const { return this+coverageZ[0]; }
2972
2973
  bool apply (hb_ot_apply_context_t *c) const
2974
117k
  {
2975
117k
    TRACE_APPLY (this);
2976
117k
    unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
2977
117k
    if (index == NOT_COVERED) return_trace (false);
2978
2979
57.1k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
2980
57.1k
    struct ContextApplyLookupContext lookup_context = {
2981
57.1k
      {match_coverage},
2982
57.1k
      this
2983
57.1k
    };
2984
57.1k
    return_trace (context_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context));
2985
117k
  }
2986
2987
  bool subset (hb_subset_context_t *c) const
2988
795
  {
2989
795
    TRACE_SUBSET (this);
2990
795
    auto *out = c->serializer->start_embed (this);
2991
795
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
2992
2993
795
    out->format = format;
2994
795
    out->glyphCount = glyphCount;
2995
2996
795
    auto coverages = coverageZ.as_array (glyphCount);
2997
2998
795
    for (const Offset16To<Coverage>& offset : coverages)
2999
1.12k
    {
3000
      /* TODO(subset) This looks like should not be necessary to write this way. */
3001
1.12k
      auto *o = c->serializer->allocate_size<Offset16To<Coverage>> (Offset16To<Coverage>::static_size);
3002
1.12k
      if (unlikely (!o)) return_trace (false);
3003
1.12k
      if (!o->serialize_subset (c, offset, this)) return_trace (false);
3004
1.12k
    }
3005
3006
689
    const auto& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount));
3007
689
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3008
3009
3010
689
    unsigned count = serialize_lookuprecord_array (c->serializer, lookupRecord.as_array (lookupCount), lookup_map);
3011
689
    return_trace (c->serializer->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3012
795
  }
3013
3014
  bool sanitize (hb_sanitize_context_t *c) const
3015
5.73k
  {
3016
5.73k
    TRACE_SANITIZE (this);
3017
5.73k
    if (unlikely (!c->check_struct (this))) return_trace (false);
3018
5.73k
    hb_barrier ();
3019
5.73k
    unsigned int count = glyphCount;
3020
5.73k
    if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */
3021
5.71k
    if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false);
3022
31.9k
    for (unsigned int i = 0; i < count; i++)
3023
26.3k
      if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false);
3024
5.65k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
3025
5.65k
    return_trace (likely (c->check_array (lookupRecord, lookupCount)));
3026
5.69k
  }
3027
3028
  protected:
3029
  HBUINT16  format;     /* Format identifier--format = 3 */
3030
  HBUINT16  glyphCount;   /* Number of glyphs in the input glyph
3031
           * sequence */
3032
  HBUINT16  lookupCount;    /* Number of LookupRecords */
3033
  UnsizedArrayOf<Offset16To<Coverage>>
3034
    coverageZ;    /* Array of offsets to Coverage
3035
           * table in glyph sequence order */
3036
/*UnsizedArrayOf<LookupRecord>
3037
    lookupRecordX;*/  /* Array of LookupRecords--in
3038
           * design order */
3039
  public:
3040
  DEFINE_SIZE_ARRAY (6, coverageZ);
3041
};
3042
3043
struct Context
3044
{
3045
  template <typename context_t, typename ...Ts>
3046
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
3047
299k
  {
3048
299k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
299k
    TRACE_DISPATCH (this, u.format.v);
3050
299k
    switch (u.format.v) {
3051
31.5k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
39.3k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
20.7k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
9.96k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
10.4k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
187k
    default:return_trace (c->default_return_value ());
3059
299k
    }
3060
299k
  }
hb_sanitize_context_t::return_t OT::Context::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
3047
104k
  {
3048
104k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
104k
    TRACE_DISPATCH (this, u.format.v);
3050
104k
    switch (u.format.v) {
3051
10.1k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
20.5k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
5.73k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
4.43k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
5.57k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
58.0k
    default:return_trace (c->default_return_value ());
3059
104k
    }
3060
104k
  }
Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Context::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
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
Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Context::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: hb_subset_context_t::return_t OT::Context::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
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
OT::hb_accelerate_subtables_context_t::return_t OT::Context::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Line
Count
Source
3047
36.4k
  {
3048
36.4k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
36.4k
    TRACE_DISPATCH (this, u.format.v);
3050
36.4k
    switch (u.format.v) {
3051
4.63k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
7.52k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
1.48k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
1.45k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
2.85k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
18.5k
    default:return_trace (c->default_return_value ());
3059
36.4k
    }
3060
36.4k
  }
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
3047
558
  {
3048
558
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
558
    TRACE_DISPATCH (this, u.format.v);
3050
558
    switch (u.format.v) {
3051
96
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
21
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
252
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
189
    default:return_trace (c->default_return_value ());
3059
558
    }
3060
558
  }
OT::hb_closure_context_t::return_t OT::Context::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
3047
59.0k
  {
3048
59.0k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
59.0k
    TRACE_DISPATCH (this, u.format.v);
3050
59.0k
    switch (u.format.v) {
3051
4.74k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
3.34k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
6.95k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
798
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
485
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
42.7k
    default:return_trace (c->default_return_value ());
3059
59.0k
    }
3060
59.0k
  }
OT::hb_would_apply_context_t::return_t OT::Context::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Line
Count
Source
3047
16.8k
  {
3048
16.8k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
16.8k
    TRACE_DISPATCH (this, u.format.v);
3050
16.8k
    switch (u.format.v) {
3051
4.80k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
2.24k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
1.86k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
1.29k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
568
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
6.02k
    default:return_trace (c->default_return_value ());
3059
16.8k
    }
3060
16.8k
  }
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
OT::hb_intersects_context_t::return_t OT::Context::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
3047
53.1k
  {
3048
53.1k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
53.1k
    TRACE_DISPATCH (this, u.format.v);
3050
53.1k
    switch (u.format.v) {
3051
3.90k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
3.55k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
2.64k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
1.03k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
634
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
41.3k
    default:return_trace (c->default_return_value ());
3059
53.1k
    }
3060
53.1k
  }
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
3047
25.3k
  {
3048
25.3k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
25.3k
    TRACE_DISPATCH (this, u.format.v);
3050
25.3k
    switch (u.format.v) {
3051
1.50k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
1.67k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
1.06k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
552
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
234
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
20.3k
    default:return_trace (c->default_return_value ());
3059
25.3k
    }
3060
25.3k
  }
hb_subset_context_t::return_t OT::Context::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
Line
Count
Source
3047
3.37k
  {
3048
3.37k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
3.37k
    TRACE_DISPATCH (this, u.format.v);
3050
3.37k
    switch (u.format.v) {
3051
1.68k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
414
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
795
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
387
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
100
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
0
    default:return_trace (c->default_return_value ());
3059
3.37k
    }
3060
3.37k
  }
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
Line
Count
Source
3047
8
  {
3048
8
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
3049
8
    TRACE_DISPATCH (this, u.format.v);
3050
8
    switch (u.format.v) {
3051
1
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
3052
0
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
3053
1
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
3054
0
#ifndef HB_NO_BEYOND_64K
3055
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
3056
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
3057
0
#endif
3058
6
    default:return_trace (c->default_return_value ());
3059
8
    }
3060
8
  }
3061
3062
  protected:
3063
  union {
3064
  struct { HBUINT16 v; }  format;   /* Format identifier */
3065
  ContextFormat1_4<SmallTypes>  format1;
3066
  ContextFormat2_5<SmallTypes>  format2;
3067
  ContextFormat3    format3;
3068
#ifndef HB_NO_BEYOND_64K
3069
  ContextFormat1_4<MediumTypes> format4;
3070
  ContextFormat2_5<MediumTypes> format5;
3071
#endif
3072
  } u;
3073
};
3074
3075
3076
/* Chaining Contextual lookups */
3077
3078
struct ChainContextClosureLookupContext
3079
{
3080
  ContextClosureFuncs funcs;
3081
  ContextFormat context_format;
3082
  const void *intersects_data[3];
3083
  void *intersects_cache[3];
3084
  void *intersected_glyphs_cache;
3085
};
3086
3087
struct ChainContextCollectGlyphsLookupContext
3088
{
3089
  ContextCollectGlyphsFuncs funcs;
3090
  const void *collect_data[3];
3091
};
3092
3093
struct ChainContextApplyLookupContext
3094
{
3095
  ChainContextApplyFuncs funcs;
3096
  const void *match_data[3];
3097
};
3098
3099
template <typename HBUINT>
3100
static inline bool chain_context_intersects (const hb_set_t *glyphs,
3101
               unsigned int backtrackCount,
3102
               const HBUINT backtrack[],
3103
               unsigned int inputCount, /* Including the first glyph (not matched) */
3104
               const HBUINT input[], /* Array of input values--start with second glyph */
3105
               unsigned int lookaheadCount,
3106
               const HBUINT lookahead[],
3107
               ChainContextClosureLookupContext &lookup_context)
3108
227k
{
3109
227k
  return array_is_subset_of (glyphs,
3110
227k
           backtrackCount, backtrack,
3111
227k
           lookup_context.funcs.intersects,
3112
227k
           lookup_context.intersects_data[0],
3113
227k
           lookup_context.intersects_cache[0])
3114
210k
      && array_is_subset_of (glyphs,
3115
210k
           inputCount ? inputCount - 1 : 0, input,
3116
210k
           lookup_context.funcs.intersects,
3117
210k
           lookup_context.intersects_data[1],
3118
210k
           lookup_context.intersects_cache[1])
3119
202k
      && array_is_subset_of (glyphs,
3120
202k
           lookaheadCount, lookahead,
3121
202k
           lookup_context.funcs.intersects,
3122
202k
           lookup_context.intersects_data[2],
3123
202k
           lookup_context.intersects_cache[2]);
3124
227k
}
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&)
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&)
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
3108
46.7k
{
3109
46.7k
  return array_is_subset_of (glyphs,
3110
46.7k
           backtrackCount, backtrack,
3111
46.7k
           lookup_context.funcs.intersects,
3112
46.7k
           lookup_context.intersects_data[0],
3113
46.7k
           lookup_context.intersects_cache[0])
3114
40.7k
      && array_is_subset_of (glyphs,
3115
40.7k
           inputCount ? inputCount - 1 : 0, input,
3116
40.7k
           lookup_context.funcs.intersects,
3117
40.7k
           lookup_context.intersects_data[1],
3118
40.7k
           lookup_context.intersects_cache[1])
3119
36.7k
      && array_is_subset_of (glyphs,
3120
36.7k
           lookaheadCount, lookahead,
3121
36.7k
           lookup_context.funcs.intersects,
3122
36.7k
           lookup_context.intersects_data[2],
3123
36.7k
           lookup_context.intersects_cache[2]);
3124
46.7k
}
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&)
Line
Count
Source
3108
3.80k
{
3109
3.80k
  return array_is_subset_of (glyphs,
3110
3.80k
           backtrackCount, backtrack,
3111
3.80k
           lookup_context.funcs.intersects,
3112
3.80k
           lookup_context.intersects_data[0],
3113
3.80k
           lookup_context.intersects_cache[0])
3114
3.63k
      && array_is_subset_of (glyphs,
3115
3.63k
           inputCount ? inputCount - 1 : 0, input,
3116
3.63k
           lookup_context.funcs.intersects,
3117
3.63k
           lookup_context.intersects_data[1],
3118
3.63k
           lookup_context.intersects_cache[1])
3119
3.41k
      && array_is_subset_of (glyphs,
3120
3.41k
           lookaheadCount, lookahead,
3121
3.41k
           lookup_context.funcs.intersects,
3122
3.41k
           lookup_context.intersects_data[2],
3123
3.41k
           lookup_context.intersects_cache[2]);
3124
3.80k
}
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-serialize.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-serialize.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&)
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
3108
171k
{
3109
171k
  return array_is_subset_of (glyphs,
3110
171k
           backtrackCount, backtrack,
3111
171k
           lookup_context.funcs.intersects,
3112
171k
           lookup_context.intersects_data[0],
3113
171k
           lookup_context.intersects_cache[0])
3114
160k
      && array_is_subset_of (glyphs,
3115
160k
           inputCount ? inputCount - 1 : 0, input,
3116
160k
           lookup_context.funcs.intersects,
3117
160k
           lookup_context.intersects_data[1],
3118
160k
           lookup_context.intersects_cache[1])
3119
157k
      && array_is_subset_of (glyphs,
3120
157k
           lookaheadCount, lookahead,
3121
157k
           lookup_context.funcs.intersects,
3122
157k
           lookup_context.intersects_data[2],
3123
157k
           lookup_context.intersects_cache[2]);
3124
171k
}
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&)
Line
Count
Source
3108
5.50k
{
3109
5.50k
  return array_is_subset_of (glyphs,
3110
5.50k
           backtrackCount, backtrack,
3111
5.50k
           lookup_context.funcs.intersects,
3112
5.50k
           lookup_context.intersects_data[0],
3113
5.50k
           lookup_context.intersects_cache[0])
3114
5.20k
      && array_is_subset_of (glyphs,
3115
5.20k
           inputCount ? inputCount - 1 : 0, input,
3116
5.20k
           lookup_context.funcs.intersects,
3117
5.20k
           lookup_context.intersects_data[1],
3118
5.20k
           lookup_context.intersects_cache[1])
3119
4.92k
      && array_is_subset_of (glyphs,
3120
4.92k
           lookaheadCount, lookahead,
3121
4.92k
           lookup_context.funcs.intersects,
3122
4.92k
           lookup_context.intersects_data[2],
3123
4.92k
           lookup_context.intersects_cache[2]);
3124
5.50k
}
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&)
3125
3126
template <typename HBUINT>
3127
static inline void chain_context_closure_lookup (hb_closure_context_t *c,
3128
             unsigned int backtrackCount,
3129
             const HBUINT backtrack[],
3130
             unsigned int inputCount, /* Including the first glyph (not matched) */
3131
             const HBUINT input[], /* Array of input values--start with second glyph */
3132
             unsigned int lookaheadCount,
3133
             const HBUINT lookahead[],
3134
             unsigned int lookupCount,
3135
             const LookupRecord lookupRecord[],
3136
             unsigned value,
3137
             ChainContextClosureLookupContext &lookup_context)
3138
50.5k
{
3139
50.5k
  if (chain_context_intersects (c->glyphs,
3140
50.5k
        backtrackCount, backtrack,
3141
50.5k
        inputCount, input,
3142
50.5k
        lookaheadCount, lookahead,
3143
50.5k
        lookup_context))
3144
35.3k
    context_closure_recurse_lookups (c,
3145
35.3k
         inputCount, input,
3146
35.3k
         lookupCount, lookupRecord,
3147
35.3k
         value,
3148
35.3k
         lookup_context.context_format,
3149
35.3k
         lookup_context.intersects_data[1],
3150
35.3k
         lookup_context.funcs.intersected_glyphs,
3151
35.3k
         lookup_context.intersected_glyphs_cache);
3152
50.5k
}
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&)
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&)
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
3138
46.7k
{
3139
46.7k
  if (chain_context_intersects (c->glyphs,
3140
46.7k
        backtrackCount, backtrack,
3141
46.7k
        inputCount, input,
3142
46.7k
        lookaheadCount, lookahead,
3143
46.7k
        lookup_context))
3144
32.1k
    context_closure_recurse_lookups (c,
3145
32.1k
         inputCount, input,
3146
32.1k
         lookupCount, lookupRecord,
3147
32.1k
         value,
3148
32.1k
         lookup_context.context_format,
3149
32.1k
         lookup_context.intersects_data[1],
3150
32.1k
         lookup_context.funcs.intersected_glyphs,
3151
32.1k
         lookup_context.intersected_glyphs_cache);
3152
46.7k
}
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&)
Line
Count
Source
3138
3.80k
{
3139
3.80k
  if (chain_context_intersects (c->glyphs,
3140
3.80k
        backtrackCount, backtrack,
3141
3.80k
        inputCount, input,
3142
3.80k
        lookaheadCount, lookahead,
3143
3.80k
        lookup_context))
3144
3.17k
    context_closure_recurse_lookups (c,
3145
3.17k
         inputCount, input,
3146
3.17k
         lookupCount, lookupRecord,
3147
3.17k
         value,
3148
3.17k
         lookup_context.context_format,
3149
3.17k
         lookup_context.intersects_data[1],
3150
3.17k
         lookup_context.funcs.intersected_glyphs,
3151
3.17k
         lookup_context.intersected_glyphs_cache);
3152
3.80k
}
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-serialize.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&)
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&)
3153
3154
template <typename HBUINT>
3155
static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
3156
              unsigned int backtrackCount,
3157
              const HBUINT backtrack[],
3158
              unsigned int inputCount, /* Including the first glyph (not matched) */
3159
              const HBUINT input[], /* Array of input values--start with second glyph */
3160
              unsigned int lookaheadCount,
3161
              const HBUINT lookahead[],
3162
              unsigned int lookupCount,
3163
              const LookupRecord lookupRecord[],
3164
              ChainContextCollectGlyphsLookupContext &lookup_context)
3165
0
{
3166
0
  collect_array (c, c->before,
3167
0
     backtrackCount, backtrack,
3168
0
     lookup_context.funcs.collect, lookup_context.collect_data[0]);
3169
0
  collect_array (c, c->input,
3170
0
     inputCount ? inputCount - 1 : 0, input,
3171
0
     lookup_context.funcs.collect, lookup_context.collect_data[1]);
3172
0
  collect_array (c, c->after,
3173
0
     lookaheadCount, lookahead,
3174
0
     lookup_context.funcs.collect, lookup_context.collect_data[2]);
3175
0
  recurse_lookups (c,
3176
0
       lookupCount, lookupRecord);
3177
0
}
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-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-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-serialize.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&)
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&)
3178
3179
template <typename HBUINT>
3180
static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c,
3181
                 unsigned int backtrackCount,
3182
                 const HBUINT backtrack[] HB_UNUSED,
3183
                 unsigned int inputCount, /* Including the first glyph (not matched) */
3184
                 const HBUINT input[], /* Array of input values--start with second glyph */
3185
                 unsigned int lookaheadCount,
3186
                 const HBUINT lookahead[] HB_UNUSED,
3187
                 unsigned int lookupCount HB_UNUSED,
3188
                 const LookupRecord lookupRecord[] HB_UNUSED,
3189
                 const ChainContextApplyLookupContext &lookup_context)
3190
11.9k
{
3191
11.9k
  return (c->zero_context ? !backtrackCount && !lookaheadCount : true)
3192
11.0k
      && would_match_input (c,
3193
11.0k
          inputCount, input,
3194
11.0k
          lookup_context.funcs.match[1], lookup_context.match_data[1]);
3195
11.9k
}
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-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&)
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&)
Line
Count
Source
3190
10.1k
{
3191
10.1k
  return (c->zero_context ? !backtrackCount && !lookaheadCount : true)
3192
9.27k
      && would_match_input (c,
3193
9.27k
          inputCount, input,
3194
9.27k
          lookup_context.funcs.match[1], lookup_context.match_data[1]);
3195
10.1k
}
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&)
Line
Count
Source
3190
1.77k
{
3191
1.77k
  return (c->zero_context ? !backtrackCount && !lookaheadCount : true)
3192
1.77k
      && would_match_input (c,
3193
1.77k
          inputCount, input,
3194
1.77k
          lookup_context.funcs.match[1], lookup_context.match_data[1]);
3195
1.77k
}
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-serialize.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&)
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&)
3196
3197
template <typename HBUINT>
3198
static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
3199
                 unsigned int backtrackCount,
3200
                 const HBUINT backtrack[],
3201
                 unsigned int inputCount, /* Including the first glyph (not matched) */
3202
                 const HBUINT input[], /* Array of input values--start with second glyph */
3203
                 unsigned int lookaheadCount,
3204
                 const HBUINT lookahead[],
3205
                 unsigned int lookupCount,
3206
                 const LookupRecord lookupRecord[],
3207
                 const ChainContextApplyLookupContext &lookup_context)
3208
1.98M
{
3209
1.98M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3210
3211
1.98M
  unsigned start_index = c->buffer->out_len;
3212
1.98M
  unsigned end_index = c->buffer->idx;
3213
1.98M
  unsigned match_end = 0;
3214
1.98M
  bool ret = true;
3215
1.98M
  if (!(match_input (c,
3216
1.98M
         inputCount, input,
3217
1.98M
         lookup_context.funcs.match[1], lookup_context.match_data[1],
3218
1.98M
         &match_end) && (end_index = match_end)
3219
1.55M
       && match_lookahead (c,
3220
1.55M
         lookaheadCount, lookahead,
3221
1.55M
         lookup_context.funcs.match[2], lookup_context.match_data[2],
3222
1.55M
         match_end, &end_index)))
3223
586k
  {
3224
586k
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
3225
586k
    return false;
3226
586k
  }
3227
3228
1.39M
  if (!match_backtrack (c,
3229
1.39M
      backtrackCount, backtrack,
3230
1.39M
      lookup_context.funcs.match[0], lookup_context.match_data[0],
3231
1.39M
      &start_index))
3232
747k
  {
3233
747k
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
3234
747k
    return false;
3235
747k
  }
3236
3237
648k
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
3238
648k
  apply_lookup (c,
3239
648k
    inputCount,
3240
648k
    lookupCount, lookupRecord,
3241
648k
    match_end);
3242
3243
648k
  return ret;
3244
1.39M
}
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-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&)
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&)
Line
Count
Source
3208
1.64M
{
3209
1.64M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3210
3211
1.63M
  unsigned start_index = c->buffer->out_len;
3212
1.63M
  unsigned end_index = c->buffer->idx;
3213
1.63M
  unsigned match_end = 0;
3214
1.63M
  bool ret = true;
3215
1.63M
  if (!(match_input (c,
3216
1.63M
         inputCount, input,
3217
1.63M
         lookup_context.funcs.match[1], lookup_context.match_data[1],
3218
1.63M
         &match_end) && (end_index = match_end)
3219
1.30M
       && match_lookahead (c,
3220
1.30M
         lookaheadCount, lookahead,
3221
1.30M
         lookup_context.funcs.match[2], lookup_context.match_data[2],
3222
1.30M
         match_end, &end_index)))
3223
474k
  {
3224
474k
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
3225
474k
    return false;
3226
474k
  }
3227
3228
1.16M
  if (!match_backtrack (c,
3229
1.16M
      backtrackCount, backtrack,
3230
1.16M
      lookup_context.funcs.match[0], lookup_context.match_data[0],
3231
1.16M
      &start_index))
3232
649k
  {
3233
649k
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
3234
649k
    return false;
3235
649k
  }
3236
3237
515k
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
3238
515k
  apply_lookup (c,
3239
515k
    inputCount,
3240
515k
    lookupCount, lookupRecord,
3241
515k
    match_end);
3242
3243
515k
  return ret;
3244
1.16M
}
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&)
Line
Count
Source
3208
344k
{
3209
344k
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3210
3211
343k
  unsigned start_index = c->buffer->out_len;
3212
343k
  unsigned end_index = c->buffer->idx;
3213
343k
  unsigned match_end = 0;
3214
343k
  bool ret = true;
3215
343k
  if (!(match_input (c,
3216
343k
         inputCount, input,
3217
343k
         lookup_context.funcs.match[1], lookup_context.match_data[1],
3218
343k
         &match_end) && (end_index = match_end)
3219
247k
       && match_lookahead (c,
3220
247k
         lookaheadCount, lookahead,
3221
247k
         lookup_context.funcs.match[2], lookup_context.match_data[2],
3222
247k
         match_end, &end_index)))
3223
111k
  {
3224
111k
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
3225
111k
    return false;
3226
111k
  }
3227
3228
231k
  if (!match_backtrack (c,
3229
231k
      backtrackCount, backtrack,
3230
231k
      lookup_context.funcs.match[0], lookup_context.match_data[0],
3231
231k
      &start_index))
3232
98.1k
  {
3233
98.1k
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
3234
98.1k
    return false;
3235
98.1k
  }
3236
3237
133k
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
3238
133k
  apply_lookup (c,
3239
133k
    inputCount,
3240
133k
    lookupCount, lookupRecord,
3241
133k
    match_end);
3242
3243
133k
  return ret;
3244
231k
}
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-serialize.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&)
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&)
3245
3246
template <typename Types>
3247
struct ChainRule
3248
{
3249
  template <typename T>
3250
  friend struct ChainRuleSet;
3251
3252
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
3253
149k
  {
3254
149k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3255
149k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3256
149k
    return chain_context_intersects (glyphs,
3257
149k
             backtrack.len, backtrack.arrayZ,
3258
149k
             input.lenP1, input.arrayZ,
3259
149k
             lookahead.len, lookahead.arrayZ,
3260
149k
             lookup_context);
3261
149k
  }
OT::ChainRule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3253
144k
  {
3254
144k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3255
144k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3256
144k
    return chain_context_intersects (glyphs,
3257
144k
             backtrack.len, backtrack.arrayZ,
3258
144k
             input.lenP1, input.arrayZ,
3259
144k
             lookahead.len, lookahead.arrayZ,
3260
144k
             lookup_context);
3261
144k
  }
OT::ChainRule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3253
5.50k
  {
3254
5.50k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3255
5.50k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3256
5.50k
    return chain_context_intersects (glyphs,
3257
5.50k
             backtrack.len, backtrack.arrayZ,
3258
5.50k
             input.lenP1, input.arrayZ,
3259
5.50k
             lookahead.len, lookahead.arrayZ,
3260
5.50k
             lookup_context);
3261
5.50k
  }
3262
3263
  void closure (hb_closure_context_t *c, unsigned value,
3264
    ChainContextClosureLookupContext &lookup_context) const
3265
40.4k
  {
3266
40.4k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3267
3268
22.6k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3269
22.6k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3270
22.6k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3271
22.6k
    chain_context_closure_lookup (c,
3272
22.6k
          backtrack.len, backtrack.arrayZ,
3273
22.6k
          input.lenP1, input.arrayZ,
3274
22.6k
          lookahead.len, lookahead.arrayZ,
3275
22.6k
          lookup.len, lookup.arrayZ,
3276
22.6k
          value,
3277
22.6k
          lookup_context);
3278
22.6k
  }
OT::ChainRule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3265
36.6k
  {
3266
36.6k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3267
3268
18.8k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3269
18.8k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3270
18.8k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3271
18.8k
    chain_context_closure_lookup (c,
3272
18.8k
          backtrack.len, backtrack.arrayZ,
3273
18.8k
          input.lenP1, input.arrayZ,
3274
18.8k
          lookahead.len, lookahead.arrayZ,
3275
18.8k
          lookup.len, lookup.arrayZ,
3276
18.8k
          value,
3277
18.8k
          lookup_context);
3278
18.8k
  }
OT::ChainRule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3265
3.80k
  {
3266
3.80k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3267
3268
3.80k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3269
3.80k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3270
3.80k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3271
3.80k
    chain_context_closure_lookup (c,
3272
3.80k
          backtrack.len, backtrack.arrayZ,
3273
3.80k
          input.lenP1, input.arrayZ,
3274
3.80k
          lookahead.len, lookahead.arrayZ,
3275
3.80k
          lookup.len, lookup.arrayZ,
3276
3.80k
          value,
3277
3.80k
          lookup_context);
3278
3.80k
  }
3279
3280
  void closure_lookups (hb_closure_lookups_context_t *c,
3281
                        ChainContextClosureLookupContext &lookup_context) const
3282
144k
  {
3283
144k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3284
144k
    if (!intersects (c->glyphs, lookup_context)) return;
3285
3286
132k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3287
132k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3288
132k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3289
132k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
3290
132k
  }
OT::ChainRule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3282
140k
  {
3283
140k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3284
140k
    if (!intersects (c->glyphs, lookup_context)) return;
3285
3286
128k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3287
128k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3288
128k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3289
128k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
3290
128k
  }
OT::ChainRule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3282
4.51k
  {
3283
4.51k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3284
4.51k
    if (!intersects (c->glyphs, lookup_context)) return;
3285
3286
3.75k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3287
3.75k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3288
3.75k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3289
3.75k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
3290
3.75k
  }
3291
3292
  void collect_glyphs (hb_collect_glyphs_context_t *c,
3293
           ChainContextCollectGlyphsLookupContext &lookup_context) const
3294
0
  {
3295
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3296
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3297
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3298
0
    chain_context_collect_glyphs_lookup (c,
3299
0
           backtrack.len, backtrack.arrayZ,
3300
0
           input.lenP1, input.arrayZ,
3301
0
           lookahead.len, lookahead.arrayZ,
3302
0
           lookup.len, lookup.arrayZ,
3303
0
           lookup_context);
3304
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
3305
3306
  bool would_apply (hb_would_apply_context_t *c,
3307
        const ChainContextApplyLookupContext &lookup_context) const
3308
10.6k
  {
3309
10.6k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3310
10.6k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3311
10.6k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3312
10.6k
    return chain_context_would_apply_lookup (c,
3313
10.6k
               backtrack.len, backtrack.arrayZ,
3314
10.6k
               input.lenP1, input.arrayZ,
3315
10.6k
               lookahead.len, lookahead.arrayZ, lookup.len,
3316
10.6k
               lookup.arrayZ, lookup_context);
3317
10.6k
  }
OT::ChainRule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3308
8.83k
  {
3309
8.83k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3310
8.83k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3311
8.83k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3312
8.83k
    return chain_context_would_apply_lookup (c,
3313
8.83k
               backtrack.len, backtrack.arrayZ,
3314
8.83k
               input.lenP1, input.arrayZ,
3315
8.83k
               lookahead.len, lookahead.arrayZ, lookup.len,
3316
8.83k
               lookup.arrayZ, lookup_context);
3317
8.83k
  }
OT::ChainRule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3308
1.77k
  {
3309
1.77k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3310
1.77k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3311
1.77k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3312
1.77k
    return chain_context_would_apply_lookup (c,
3313
1.77k
               backtrack.len, backtrack.arrayZ,
3314
1.77k
               input.lenP1, input.arrayZ,
3315
1.77k
               lookahead.len, lookahead.arrayZ, lookup.len,
3316
1.77k
               lookup.arrayZ, lookup_context);
3317
1.77k
  }
3318
3319
  bool apply (hb_ot_apply_context_t *c,
3320
        const ChainContextApplyLookupContext &lookup_context) const
3321
1.85M
  {
3322
1.85M
    TRACE_APPLY (this);
3323
1.85M
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3324
1.85M
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3325
1.85M
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3326
1.85M
    return_trace (chain_context_apply_lookup (c,
3327
1.85M
                backtrack.len, backtrack.arrayZ,
3328
1.85M
                input.lenP1, input.arrayZ,
3329
1.85M
                lookahead.len, lookahead.arrayZ, lookup.len,
3330
1.85M
                lookup.arrayZ, lookup_context));
3331
1.85M
  }
OT::ChainRule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3321
1.51M
  {
3322
1.51M
    TRACE_APPLY (this);
3323
1.51M
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3324
1.51M
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3325
1.51M
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3326
1.51M
    return_trace (chain_context_apply_lookup (c,
3327
1.51M
                backtrack.len, backtrack.arrayZ,
3328
1.51M
                input.lenP1, input.arrayZ,
3329
1.51M
                lookahead.len, lookahead.arrayZ, lookup.len,
3330
1.51M
                lookup.arrayZ, lookup_context));
3331
1.51M
  }
OT::ChainRule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3321
344k
  {
3322
344k
    TRACE_APPLY (this);
3323
344k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3324
344k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3325
344k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3326
344k
    return_trace (chain_context_apply_lookup (c,
3327
344k
                backtrack.len, backtrack.arrayZ,
3328
344k
                input.lenP1, input.arrayZ,
3329
344k
                lookahead.len, lookahead.arrayZ, lookup.len,
3330
344k
                lookup.arrayZ, lookup_context));
3331
344k
  }
3332
3333
  template<typename Iterator,
3334
     hb_requires (hb_is_iterator (Iterator))>
3335
  void serialize_array (hb_serialize_context_t *c,
3336
      HBUINT16 len,
3337
      Iterator it) const
3338
118k
  {
3339
118k
    c->copy (len);
3340
118k
    for (const auto g : it)
3341
169M
      c->copy ((HBUINT16) g);
3342
118k
  }
_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
3338
117k
  {
3339
117k
    c->copy (len);
3340
117k
    for (const auto g : it)
3341
169M
      c->copy ((HBUINT16) g);
3342
117k
  }
_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_
Line
Count
Source
3338
1.48k
  {
3339
1.48k
    c->copy (len);
3340
1.48k
    for (const auto g : it)
3341
326
      c->copy ((HBUINT16) g);
3342
1.48k
  }
3343
3344
  bool serialize (hb_serialize_context_t *c,
3345
      const hb_map_t *lookup_map,
3346
      const hb_map_t *backtrack_map,
3347
      const hb_map_t *input_map = nullptr,
3348
      const hb_map_t *lookahead_map = nullptr) const
3349
39.6k
  {
3350
39.6k
    TRACE_SERIALIZE (this);
3351
3352
39.6k
    const hb_map_t *mapping = backtrack_map;
3353
39.6k
    serialize_array (c, backtrack.len, + backtrack.iter ()
3354
39.6k
               | hb_map (mapping));
3355
3356
39.6k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3357
39.6k
    if (input_map) mapping = input_map;
3358
39.6k
    serialize_array (c, input.lenP1, + input.iter ()
3359
39.6k
             | hb_map (mapping));
3360
3361
39.6k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3362
39.6k
    if (lookahead_map) mapping = lookahead_map;
3363
39.6k
    serialize_array (c, lookahead.len, + lookahead.iter ()
3364
39.6k
               | hb_map (mapping));
3365
3366
39.6k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3367
3368
39.6k
    HBUINT16* lookupCount = c->embed (&(lookup.len));
3369
39.6k
    if (!lookupCount) return_trace (false);
3370
3371
39.5k
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
3372
39.5k
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3373
39.6k
  }
Unexecuted instantiation: 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
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
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
3349
39.1k
  {
3350
39.1k
    TRACE_SERIALIZE (this);
3351
3352
39.1k
    const hb_map_t *mapping = backtrack_map;
3353
39.1k
    serialize_array (c, backtrack.len, + backtrack.iter ()
3354
39.1k
               | hb_map (mapping));
3355
3356
39.1k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3357
39.1k
    if (input_map) mapping = input_map;
3358
39.1k
    serialize_array (c, input.lenP1, + input.iter ()
3359
39.1k
             | hb_map (mapping));
3360
3361
39.1k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3362
39.1k
    if (lookahead_map) mapping = lookahead_map;
3363
39.1k
    serialize_array (c, lookahead.len, + lookahead.iter ()
3364
39.1k
               | hb_map (mapping));
3365
3366
39.1k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3367
3368
39.1k
    HBUINT16* lookupCount = c->embed (&(lookup.len));
3369
39.1k
    if (!lookupCount) return_trace (false);
3370
3371
39.0k
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
3372
39.0k
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3373
39.1k
  }
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
Line
Count
Source
3349
494
  {
3350
494
    TRACE_SERIALIZE (this);
3351
3352
494
    const hb_map_t *mapping = backtrack_map;
3353
494
    serialize_array (c, backtrack.len, + backtrack.iter ()
3354
494
               | hb_map (mapping));
3355
3356
494
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3357
494
    if (input_map) mapping = input_map;
3358
494
    serialize_array (c, input.lenP1, + input.iter ()
3359
494
             | hb_map (mapping));
3360
3361
494
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3362
494
    if (lookahead_map) mapping = lookahead_map;
3363
494
    serialize_array (c, lookahead.len, + lookahead.iter ()
3364
494
               | hb_map (mapping));
3365
3366
494
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3367
3368
494
    HBUINT16* lookupCount = c->embed (&(lookup.len));
3369
494
    if (!lookupCount) return_trace (false);
3370
3371
494
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
3372
494
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3373
494
  }
3374
3375
  bool subset (hb_subset_context_t *c,
3376
         const hb_map_t *lookup_map,
3377
         const hb_map_t *backtrack_map = nullptr,
3378
         const hb_map_t *input_map = nullptr,
3379
         const hb_map_t *lookahead_map = nullptr) const
3380
54.4k
  {
3381
54.4k
    TRACE_SUBSET (this);
3382
3383
54.4k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3384
54.4k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3385
3386
54.4k
    if (!backtrack_map)
3387
53.2k
    {
3388
53.2k
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3389
53.2k
      if (!hb_all (backtrack, glyphset) ||
3390
43.2k
    !hb_all (input, glyphset) ||
3391
39.7k
    !hb_all (lookahead, glyphset))
3392
14.3k
  return_trace (false);
3393
3394
38.9k
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
3395
38.9k
    }
3396
1.21k
    else
3397
1.21k
    {
3398
1.21k
      if (!hb_all (backtrack, backtrack_map) ||
3399
970
    !hb_all (input, input_map) ||
3400
865
    !hb_all (lookahead, lookahead_map))
3401
492
  return_trace (false);
3402
3403
724
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
3404
724
    }
3405
3406
54.4k
    return_trace (true);
3407
54.4k
  }
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
3380
53.2k
  {
3381
53.2k
    TRACE_SUBSET (this);
3382
3383
53.2k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3384
53.2k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3385
3386
53.2k
    if (!backtrack_map)
3387
52.0k
    {
3388
52.0k
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3389
52.0k
      if (!hb_all (backtrack, glyphset) ||
3390
42.2k
    !hb_all (input, glyphset) ||
3391
38.9k
    !hb_all (lookahead, glyphset))
3392
13.6k
  return_trace (false);
3393
3394
38.4k
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
3395
38.4k
    }
3396
1.21k
    else
3397
1.21k
    {
3398
1.21k
      if (!hb_all (backtrack, backtrack_map) ||
3399
970
    !hb_all (input, input_map) ||
3400
865
    !hb_all (lookahead, lookahead_map))
3401
492
  return_trace (false);
3402
3403
724
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
3404
724
    }
3405
3406
39.1k
    return_trace (true);
3407
53.2k
  }
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
Line
Count
Source
3380
1.24k
  {
3381
1.24k
    TRACE_SUBSET (this);
3382
3383
1.24k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3384
1.24k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3385
3386
1.24k
    if (!backtrack_map)
3387
1.24k
    {
3388
1.24k
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3389
1.24k
      if (!hb_all (backtrack, glyphset) ||
3390
1.04k
    !hb_all (input, glyphset) ||
3391
786
    !hb_all (lookahead, glyphset))
3392
748
  return_trace (false);
3393
3394
494
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
3395
494
    }
3396
0
    else
3397
0
    {
3398
0
      if (!hb_all (backtrack, backtrack_map) ||
3399
0
    !hb_all (input, input_map) ||
3400
0
    !hb_all (lookahead, lookahead_map))
3401
0
  return_trace (false);
3402
3403
0
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
3404
0
    }
3405
3406
494
    return_trace (true);
3407
1.24k
  }
3408
3409
  bool sanitize (hb_sanitize_context_t *c) const
3410
1.15M
  {
3411
1.15M
    TRACE_SANITIZE (this);
3412
    /* Hyper-optimized sanitized because this is really hot. */
3413
1.15M
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3414
1.15M
    hb_barrier ();
3415
1.15M
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3416
1.15M
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3417
1.15M
    hb_barrier ();
3418
1.15M
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3419
1.15M
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3420
1.15M
    hb_barrier ();
3421
1.15M
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3422
1.15M
    return_trace (likely (lookup.sanitize (c)));
3423
1.15M
  }
OT::ChainRule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3410
1.13M
  {
3411
1.13M
    TRACE_SANITIZE (this);
3412
    /* Hyper-optimized sanitized because this is really hot. */
3413
1.13M
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3414
1.13M
    hb_barrier ();
3415
1.13M
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3416
1.13M
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3417
1.13M
    hb_barrier ();
3418
1.13M
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3419
1.13M
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3420
1.13M
    hb_barrier ();
3421
1.13M
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3422
1.13M
    return_trace (likely (lookup.sanitize (c)));
3423
1.13M
  }
OT::ChainRule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3410
18.2k
  {
3411
18.2k
    TRACE_SANITIZE (this);
3412
    /* Hyper-optimized sanitized because this is really hot. */
3413
18.2k
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
3414
18.2k
    hb_barrier ();
3415
18.2k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
3416
18.2k
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
3417
18.2k
    hb_barrier ();
3418
18.2k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
3419
18.2k
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
3420
18.2k
    hb_barrier ();
3421
18.2k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
3422
18.2k
    return_trace (likely (lookup.sanitize (c)));
3423
18.2k
  }
3424
3425
  protected:
3426
  Array16Of<typename Types::HBUINT>
3427
    backtrack;    /* Array of backtracking values
3428
           * (to be matched before the input
3429
           * sequence) */
3430
  HeadlessArray16Of<typename Types::HBUINT>
3431
    inputX;     /* Array of input values (start with
3432
           * second glyph) */
3433
  Array16Of<typename Types::HBUINT>
3434
    lookaheadX;   /* Array of lookahead values's (to be
3435
           * matched after the input sequence) */
3436
  Array16Of<LookupRecord>
3437
    lookupX;    /* Array of LookupRecords--in
3438
           * design order) */
3439
  public:
3440
  DEFINE_SIZE_MIN (8);
3441
};
3442
3443
template <typename Types>
3444
struct ChainRuleSet
3445
{
3446
  using ChainRule = OT::ChainRule<Types>;
3447
3448
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
3449
4.42k
  {
3450
4.42k
    return
3451
4.42k
    + hb_iter (rule)
3452
4.42k
    | hb_map (hb_add (this))
3453
5.07k
    | 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
3453
4.08k
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
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
Line
Count
Source
3453
991
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
3454
4.42k
    | hb_any
3455
4.42k
    ;
3456
4.42k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3449
3.42k
  {
3450
3.42k
    return
3451
3.42k
    + hb_iter (rule)
3452
3.42k
    | hb_map (hb_add (this))
3453
3.42k
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
3454
3.42k
    | hb_any
3455
3.42k
    ;
3456
3.42k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3449
995
  {
3450
995
    return
3451
995
    + hb_iter (rule)
3452
995
    | hb_map (hb_add (this))
3453
995
    | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); })
3454
995
    | hb_any
3455
995
    ;
3456
995
  }
3457
  void closure (hb_closure_context_t *c, unsigned value, ChainContextClosureLookupContext &lookup_context) const
3458
4.70k
  {
3459
4.70k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3460
3461
4.66k
    return
3462
4.66k
    + hb_iter (rule)
3463
4.66k
    | hb_map (hb_add (this))
3464
40.4k
    | 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
3464
36.6k
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
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
Line
Count
Source
3464
3.80k
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
3465
4.70k
    ;
3466
4.70k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3458
4.10k
  {
3459
4.10k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3460
3461
4.06k
    return
3462
4.06k
    + hb_iter (rule)
3463
4.06k
    | hb_map (hb_add (this))
3464
4.06k
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
3465
4.10k
    ;
3466
4.10k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3458
598
  {
3459
598
    if (unlikely (c->lookup_limit_exceeded ())) return;
3460
3461
598
    return
3462
598
    + hb_iter (rule)
3463
598
    | hb_map (hb_add (this))
3464
598
    | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })
3465
598
    ;
3466
598
  }
3467
3468
  void closure_lookups (hb_closure_lookups_context_t *c,
3469
                        ChainContextClosureLookupContext &lookup_context) const
3470
3.66k
  {
3471
3.66k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3472
3473
3.66k
    + hb_iter (rule)
3474
3.66k
    | hb_map (hb_add (this))
3475
144k
    | 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
3475
140k
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
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
Line
Count
Source
3475
4.51k
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
3476
3.66k
    ;
3477
3.66k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3470
3.03k
  {
3471
3.03k
    if (unlikely (c->lookup_limit_exceeded ())) return;
3472
3473
3.03k
    + hb_iter (rule)
3474
3.03k
    | hb_map (hb_add (this))
3475
3.03k
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
3476
3.03k
    ;
3477
3.03k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Line
Count
Source
3470
630
  {
3471
630
    if (unlikely (c->lookup_limit_exceeded ())) return;
3472
3473
630
    + hb_iter (rule)
3474
630
    | hb_map (hb_add (this))
3475
630
    | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); })
3476
630
    ;
3477
630
  }
3478
3479
  void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const
3480
0
  {
3481
0
    return
3482
0
    + hb_iter (rule)
3483
0
    | hb_map (hb_add (this))
3484
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
3485
0
    ;
3486
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
3487
3488
  bool would_apply (hb_would_apply_context_t *c,
3489
        const ChainContextApplyLookupContext &lookup_context) const
3490
11.7k
  {
3491
11.7k
    return
3492
11.7k
    + hb_iter (rule)
3493
11.7k
    | hb_map (hb_add (this))
3494
11.7k
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
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
Line
Count
Source
3494
8.83k
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
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
Line
Count
Source
3494
1.77k
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
3495
11.7k
    | hb_any
3496
11.7k
    ;
3497
11.7k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3490
10.8k
  {
3491
10.8k
    return
3492
10.8k
    + hb_iter (rule)
3493
10.8k
    | hb_map (hb_add (this))
3494
10.8k
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
3495
10.8k
    | hb_any
3496
10.8k
    ;
3497
10.8k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3490
999
  {
3491
999
    return
3492
999
    + hb_iter (rule)
3493
999
    | hb_map (hb_add (this))
3494
999
    | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })
3495
999
    | hb_any
3496
999
    ;
3497
999
  }
3498
3499
  bool apply (hb_ot_apply_context_t *c,
3500
        const ChainContextApplyLookupContext &lookup_context) const
3501
1.69M
  {
3502
1.69M
    TRACE_APPLY (this);
3503
3504
1.69M
    unsigned num_rules = rule.len;
3505
3506
1.69M
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3507
1.69M
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3508
621k
#endif
3509
621k
    {
3510
629k
    slow:
3511
629k
      return_trace (
3512
621k
      + hb_iter (rule)
3513
621k
      | hb_map (hb_add (this))
3514
621k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3515
621k
      | hb_any
3516
621k
      )
3517
621k
      ;
3518
621k
    }
3519
3520
    /* This version is optimized for speed by matching the first & second
3521
     * components of the rule here, instead of calling into the matching code.
3522
     *
3523
     * Replicated from LigatureSet::apply(). */
3524
3525
    /* We use the iter_context instead of iter_input, to avoid skipping
3526
     * default-ignorables and such.
3527
     *
3528
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3529
     */
3530
1.07M
    auto &skippy_iter = c->iter_context;
3531
1.07M
    skippy_iter.reset (c->buffer->idx);
3532
1.07M
    skippy_iter.set_match_func (match_always, nullptr);
3533
1.07M
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3534
1.07M
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3535
1.07M
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3536
1.07M
    bool matched = skippy_iter.next ();
3537
1.07M
    if (likely (matched))
3538
918k
    {
3539
918k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3540
5.27k
      {
3541
  /* Can't use the fast path if eg. the next char is a default-ignorable
3542
   * or other skippable. */
3543
5.27k
        goto slow;
3544
5.27k
      }
3545
3546
913k
      first = &c->buffer->info[skippy_iter.idx];
3547
913k
      unsafe_to1 = skippy_iter.idx + 1;
3548
913k
    }
3549
155k
    else
3550
155k
    {
3551
      /* Failed to match a next glyph. Only try applying rules that have
3552
       * no further input and lookahead. */
3553
155k
      return_trace (
3554
155k
      + hb_iter (rule)
3555
155k
      | hb_map (hb_add (this))
3556
155k
      | hb_filter ([&] (const ChainRule &_)
3557
155k
       {
3558
155k
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
3559
155k
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
3560
155k
         return input.lenP1 <= 1 && lookahead.len == 0;
3561
155k
       })
3562
155k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3563
155k
      | hb_any
3564
155k
      )
3565
155k
      ;
3566
155k
    }
3567
913k
    matched = skippy_iter.next ();
3568
913k
    if (likely (matched))
3569
837k
    {
3570
837k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3571
3.35k
      {
3572
  /* Can't use the fast path if eg. the next char is a default-ignorable
3573
   * or other skippable. */
3574
3.35k
        goto slow;
3575
3.35k
      }
3576
3577
834k
      second = &c->buffer->info[skippy_iter.idx];
3578
834k
      unsafe_to2 = skippy_iter.idx + 1;
3579
834k
    }
3580
3581
909k
    auto match_input = lookup_context.funcs.match[1];
3582
909k
    auto match_lookahead = lookup_context.funcs.match[2];
3583
909k
    auto *input_data = lookup_context.match_data[1];
3584
909k
    auto *lookahead_data = lookup_context.match_data[2];
3585
3.16M
    for (unsigned int i = 0; i < num_rules; i++)
3586
2.66M
    {
3587
2.66M
      const auto &r = this+rule.arrayZ[i];
3588
3589
2.66M
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
3590
2.66M
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
3591
3592
2.66M
      unsigned lenP1 = input.lenP1;
3593
2.66M
      if (lenP1 > 1 ?
3594
2.07M
     (!match_input ||
3595
2.07M
      match_input (*first, input.arrayZ[0], input_data))
3596
2.66M
    :
3597
2.66M
     (!lookahead.len || !match_lookahead ||
3598
189k
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
3599
1.11M
      {
3600
1.11M
  lenP1 = hb_max (lenP1, 1u);
3601
1.11M
        if (!second ||
3602
982k
      (lenP1 > 2 ?
3603
161k
       (!match_input ||
3604
161k
        match_input (*second, input.arrayZ[1], input_data))
3605
982k
       :
3606
982k
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
3607
36.7k
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
3608
1.07M
  {
3609
1.07M
    if (r.apply (c, lookup_context))
3610
416k
    {
3611
416k
      if (unsafe_to != (unsigned) -1)
3612
190k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3613
416k
      return_trace (true);
3614
416k
    }
3615
1.07M
  }
3616
41.4k
  else
3617
41.4k
    unsafe_to = unsafe_to2;
3618
1.11M
      }
3619
1.55M
      else
3620
1.55M
      {
3621
1.55M
  if (unsafe_to == (unsigned) -1)
3622
673k
    unsafe_to = unsafe_to1;
3623
3624
1.55M
  if (lenP1 > 1)
3625
1.42M
  {
3626
    // Skip ahead to next possible first glyph match.
3627
3.08M
    for (; i + 1 < num_rules; i++)
3628
2.60M
    {
3629
2.60M
      const auto &r2 = this+rule.arrayZ[i + 1];
3630
2.60M
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
3631
2.60M
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3632
942k
        break;
3633
2.60M
    }
3634
1.42M
  }
3635
1.55M
      }
3636
2.66M
    }
3637
493k
    if (likely (unsafe_to != (unsigned) -1))
3638
488k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3639
3640
493k
    return_trace (false);
3641
909k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3501
1.53M
  {
3502
1.53M
    TRACE_APPLY (this);
3503
3504
1.53M
    unsigned num_rules = rule.len;
3505
3506
1.53M
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3507
1.53M
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3508
611k
#endif
3509
611k
    {
3510
615k
    slow:
3511
615k
      return_trace (
3512
611k
      + hb_iter (rule)
3513
611k
      | hb_map (hb_add (this))
3514
611k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3515
611k
      | hb_any
3516
611k
      )
3517
611k
      ;
3518
611k
    }
3519
3520
    /* This version is optimized for speed by matching the first & second
3521
     * components of the rule here, instead of calling into the matching code.
3522
     *
3523
     * Replicated from LigatureSet::apply(). */
3524
3525
    /* We use the iter_context instead of iter_input, to avoid skipping
3526
     * default-ignorables and such.
3527
     *
3528
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3529
     */
3530
922k
    auto &skippy_iter = c->iter_context;
3531
922k
    skippy_iter.reset (c->buffer->idx);
3532
922k
    skippy_iter.set_match_func (match_always, nullptr);
3533
922k
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3534
922k
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3535
922k
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3536
922k
    bool matched = skippy_iter.next ();
3537
922k
    if (likely (matched))
3538
789k
    {
3539
789k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3540
2.45k
      {
3541
  /* Can't use the fast path if eg. the next char is a default-ignorable
3542
   * or other skippable. */
3543
2.45k
        goto slow;
3544
2.45k
      }
3545
3546
786k
      first = &c->buffer->info[skippy_iter.idx];
3547
786k
      unsafe_to1 = skippy_iter.idx + 1;
3548
786k
    }
3549
133k
    else
3550
133k
    {
3551
      /* Failed to match a next glyph. Only try applying rules that have
3552
       * no further input and lookahead. */
3553
133k
      return_trace (
3554
133k
      + hb_iter (rule)
3555
133k
      | hb_map (hb_add (this))
3556
133k
      | hb_filter ([&] (const ChainRule &_)
3557
133k
       {
3558
133k
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
3559
133k
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
3560
133k
         return input.lenP1 <= 1 && lookahead.len == 0;
3561
133k
       })
3562
133k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3563
133k
      | hb_any
3564
133k
      )
3565
133k
      ;
3566
133k
    }
3567
786k
    matched = skippy_iter.next ();
3568
786k
    if (likely (matched))
3569
734k
    {
3570
734k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3571
1.44k
      {
3572
  /* Can't use the fast path if eg. the next char is a default-ignorable
3573
   * or other skippable. */
3574
1.44k
        goto slow;
3575
1.44k
      }
3576
3577
732k
      second = &c->buffer->info[skippy_iter.idx];
3578
732k
      unsafe_to2 = skippy_iter.idx + 1;
3579
732k
    }
3580
3581
785k
    auto match_input = lookup_context.funcs.match[1];
3582
785k
    auto match_lookahead = lookup_context.funcs.match[2];
3583
785k
    auto *input_data = lookup_context.match_data[1];
3584
785k
    auto *lookahead_data = lookup_context.match_data[2];
3585
2.74M
    for (unsigned int i = 0; i < num_rules; i++)
3586
2.26M
    {
3587
2.26M
      const auto &r = this+rule.arrayZ[i];
3588
3589
2.26M
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
3590
2.26M
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
3591
3592
2.26M
      unsigned lenP1 = input.lenP1;
3593
2.26M
      if (lenP1 > 1 ?
3594
1.88M
     (!match_input ||
3595
1.88M
      match_input (*first, input.arrayZ[0], input_data))
3596
2.26M
    :
3597
2.26M
     (!lookahead.len || !match_lookahead ||
3598
121k
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
3599
808k
      {
3600
808k
  lenP1 = hb_max (lenP1, 1u);
3601
808k
        if (!second ||
3602
743k
      (lenP1 > 2 ?
3603
71.4k
       (!match_input ||
3604
71.4k
        match_input (*second, input.arrayZ[1], input_data))
3605
743k
       :
3606
743k
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
3607
14.5k
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
3608
787k
  {
3609
787k
    if (r.apply (c, lookup_context))
3610
307k
    {
3611
307k
      if (unsafe_to != (unsigned) -1)
3612
161k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3613
307k
      return_trace (true);
3614
307k
    }
3615
787k
  }
3616
20.9k
  else
3617
20.9k
    unsafe_to = unsafe_to2;
3618
808k
      }
3619
1.45M
      else
3620
1.45M
      {
3621
1.45M
  if (unsafe_to == (unsigned) -1)
3622
631k
    unsafe_to = unsafe_to1;
3623
3624
1.45M
  if (lenP1 > 1)
3625
1.35M
  {
3626
    // Skip ahead to next possible first glyph match.
3627
3.00M
    for (; i + 1 < num_rules; i++)
3628
2.54M
    {
3629
2.54M
      const auto &r2 = this+rule.arrayZ[i + 1];
3630
2.54M
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
3631
2.54M
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3632
886k
        break;
3633
2.54M
    }
3634
1.35M
  }
3635
1.45M
      }
3636
2.26M
    }
3637
477k
    if (likely (unsafe_to != (unsigned) -1))
3638
473k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3639
3640
477k
    return_trace (false);
3641
785k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
3501
160k
  {
3502
160k
    TRACE_APPLY (this);
3503
3504
160k
    unsigned num_rules = rule.len;
3505
3506
160k
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3507
160k
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3508
9.21k
#endif
3509
9.21k
    {
3510
13.9k
    slow:
3511
13.9k
      return_trace (
3512
9.21k
      + hb_iter (rule)
3513
9.21k
      | hb_map (hb_add (this))
3514
9.21k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3515
9.21k
      | hb_any
3516
9.21k
      )
3517
9.21k
      ;
3518
9.21k
    }
3519
3520
    /* This version is optimized for speed by matching the first & second
3521
     * components of the rule here, instead of calling into the matching code.
3522
     *
3523
     * Replicated from LigatureSet::apply(). */
3524
3525
    /* We use the iter_context instead of iter_input, to avoid skipping
3526
     * default-ignorables and such.
3527
     *
3528
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3529
     */
3530
151k
    auto &skippy_iter = c->iter_context;
3531
151k
    skippy_iter.reset (c->buffer->idx);
3532
151k
    skippy_iter.set_match_func (match_always, nullptr);
3533
151k
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3534
151k
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3535
151k
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3536
151k
    bool matched = skippy_iter.next ();
3537
151k
    if (likely (matched))
3538
129k
    {
3539
129k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3540
2.82k
      {
3541
  /* Can't use the fast path if eg. the next char is a default-ignorable
3542
   * or other skippable. */
3543
2.82k
        goto slow;
3544
2.82k
      }
3545
3546
126k
      first = &c->buffer->info[skippy_iter.idx];
3547
126k
      unsafe_to1 = skippy_iter.idx + 1;
3548
126k
    }
3549
21.9k
    else
3550
21.9k
    {
3551
      /* Failed to match a next glyph. Only try applying rules that have
3552
       * no further input and lookahead. */
3553
21.9k
      return_trace (
3554
21.9k
      + hb_iter (rule)
3555
21.9k
      | hb_map (hb_add (this))
3556
21.9k
      | hb_filter ([&] (const ChainRule &_)
3557
21.9k
       {
3558
21.9k
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
3559
21.9k
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
3560
21.9k
         return input.lenP1 <= 1 && lookahead.len == 0;
3561
21.9k
       })
3562
21.9k
      | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
3563
21.9k
      | hb_any
3564
21.9k
      )
3565
21.9k
      ;
3566
21.9k
    }
3567
126k
    matched = skippy_iter.next ();
3568
126k
    if (likely (matched))
3569
103k
    {
3570
103k
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3571
1.91k
      {
3572
  /* Can't use the fast path if eg. the next char is a default-ignorable
3573
   * or other skippable. */
3574
1.91k
        goto slow;
3575
1.91k
      }
3576
3577
101k
      second = &c->buffer->info[skippy_iter.idx];
3578
101k
      unsafe_to2 = skippy_iter.idx + 1;
3579
101k
    }
3580
3581
124k
    auto match_input = lookup_context.funcs.match[1];
3582
124k
    auto match_lookahead = lookup_context.funcs.match[2];
3583
124k
    auto *input_data = lookup_context.match_data[1];
3584
124k
    auto *lookahead_data = lookup_context.match_data[2];
3585
419k
    for (unsigned int i = 0; i < num_rules; i++)
3586
403k
    {
3587
403k
      const auto &r = this+rule.arrayZ[i];
3588
3589
403k
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
3590
403k
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
3591
3592
403k
      unsigned lenP1 = input.lenP1;
3593
403k
      if (lenP1 > 1 ?
3594
187k
     (!match_input ||
3595
187k
      match_input (*first, input.arrayZ[0], input_data))
3596
403k
    :
3597
403k
     (!lookahead.len || !match_lookahead ||
3598
68.4k
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
3599
308k
      {
3600
308k
  lenP1 = hb_max (lenP1, 1u);
3601
308k
        if (!second ||
3602
239k
      (lenP1 > 2 ?
3603
90.3k
       (!match_input ||
3604
90.3k
        match_input (*second, input.arrayZ[1], input_data))
3605
239k
       :
3606
239k
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
3607
22.1k
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
3608
287k
  {
3609
287k
    if (r.apply (c, lookup_context))
3610
108k
    {
3611
108k
      if (unsafe_to != (unsigned) -1)
3612
29.2k
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3613
108k
      return_trace (true);
3614
108k
    }
3615
287k
  }
3616
20.5k
  else
3617
20.5k
    unsafe_to = unsafe_to2;
3618
308k
      }
3619
95.1k
      else
3620
95.1k
      {
3621
95.1k
  if (unsafe_to == (unsigned) -1)
3622
42.7k
    unsafe_to = unsafe_to1;
3623
3624
95.1k
  if (lenP1 > 1)
3625
70.3k
  {
3626
    // Skip ahead to next possible first glyph match.
3627
75.8k
    for (; i + 1 < num_rules; i++)
3628
61.9k
    {
3629
61.9k
      const auto &r2 = this+rule.arrayZ[i + 1];
3630
61.9k
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
3631
61.9k
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3632
56.3k
        break;
3633
61.9k
    }
3634
70.3k
  }
3635
95.1k
      }
3636
403k
    }
3637
15.8k
    if (likely (unsafe_to != (unsigned) -1))
3638
15.0k
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3639
3640
15.8k
    return_trace (false);
3641
124k
  }
3642
3643
  bool subset (hb_subset_context_t *c,
3644
         const hb_map_t *lookup_map,
3645
         const hb_map_t *backtrack_klass_map = nullptr,
3646
         const hb_map_t *input_klass_map = nullptr,
3647
         const hb_map_t *lookahead_klass_map = nullptr) const
3648
2.03k
  {
3649
2.03k
    TRACE_SUBSET (this);
3650
3651
2.03k
    auto snap = c->serializer->snapshot ();
3652
2.03k
    auto *out = c->serializer->start_embed (*this);
3653
2.03k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3654
3655
2.03k
    for (const Offset16To<ChainRule>& _ : rule)
3656
487k
    {
3657
487k
      if (!_) continue;
3658
115k
      auto o_snap = c->serializer->snapshot ();
3659
115k
      auto *o = out->rule.serialize_append (c->serializer);
3660
115k
      if (unlikely (!o)) continue;
3661
3662
54.4k
      if (!o->serialize_subset (c, _, this,
3663
54.4k
        lookup_map,
3664
54.4k
        backtrack_klass_map,
3665
54.4k
        input_klass_map,
3666
54.4k
        lookahead_klass_map))
3667
14.8k
      {
3668
14.8k
  out->rule.pop ();
3669
14.8k
  c->serializer->revert (o_snap);
3670
14.8k
      }
3671
54.4k
    }
3672
3673
2.03k
    bool ret = bool (out->rule);
3674
2.03k
    if (!ret) c->serializer->revert (snap);
3675
3676
2.03k
    return_trace (ret);
3677
2.03k
  }
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
3648
1.49k
  {
3649
1.49k
    TRACE_SUBSET (this);
3650
3651
1.49k
    auto snap = c->serializer->snapshot ();
3652
1.49k
    auto *out = c->serializer->start_embed (*this);
3653
1.49k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3654
3655
1.49k
    for (const Offset16To<ChainRule>& _ : rule)
3656
483k
    {
3657
483k
      if (!_) continue;
3658
114k
      auto o_snap = c->serializer->snapshot ();
3659
114k
      auto *o = out->rule.serialize_append (c->serializer);
3660
114k
      if (unlikely (!o)) continue;
3661
3662
53.2k
      if (!o->serialize_subset (c, _, this,
3663
53.2k
        lookup_map,
3664
53.2k
        backtrack_klass_map,
3665
53.2k
        input_klass_map,
3666
53.2k
        lookahead_klass_map))
3667
14.1k
      {
3668
14.1k
  out->rule.pop ();
3669
14.1k
  c->serializer->revert (o_snap);
3670
14.1k
      }
3671
53.2k
    }
3672
3673
1.49k
    bool ret = bool (out->rule);
3674
1.49k
    if (!ret) c->serializer->revert (snap);
3675
3676
1.49k
    return_trace (ret);
3677
1.49k
  }
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
Line
Count
Source
3648
536
  {
3649
536
    TRACE_SUBSET (this);
3650
3651
536
    auto snap = c->serializer->snapshot ();
3652
536
    auto *out = c->serializer->start_embed (*this);
3653
536
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3654
3655
536
    for (const Offset16To<ChainRule>& _ : rule)
3656
4.04k
    {
3657
4.04k
      if (!_) continue;
3658
1.24k
      auto o_snap = c->serializer->snapshot ();
3659
1.24k
      auto *o = out->rule.serialize_append (c->serializer);
3660
1.24k
      if (unlikely (!o)) continue;
3661
3662
1.24k
      if (!o->serialize_subset (c, _, this,
3663
1.24k
        lookup_map,
3664
1.24k
        backtrack_klass_map,
3665
1.24k
        input_klass_map,
3666
1.24k
        lookahead_klass_map))
3667
748
      {
3668
748
  out->rule.pop ();
3669
748
  c->serializer->revert (o_snap);
3670
748
      }
3671
1.24k
    }
3672
3673
536
    bool ret = bool (out->rule);
3674
536
    if (!ret) c->serializer->revert (snap);
3675
3676
536
    return_trace (ret);
3677
536
  }
3678
3679
  bool sanitize (hb_sanitize_context_t *c) const
3680
61.7k
  {
3681
61.7k
    TRACE_SANITIZE (this);
3682
61.7k
    return_trace (rule.sanitize (c, this));
3683
61.7k
  }
OT::ChainRuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3680
58.1k
  {
3681
58.1k
    TRACE_SANITIZE (this);
3682
58.1k
    return_trace (rule.sanitize (c, this));
3683
58.1k
  }
OT::ChainRuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3680
3.53k
  {
3681
3.53k
    TRACE_SANITIZE (this);
3682
3.53k
    return_trace (rule.sanitize (c, this));
3683
3.53k
  }
3684
3685
  protected:
3686
  Array16OfOffset16To<ChainRule>
3687
    rule;     /* Array of ChainRule tables
3688
           * ordered by preference */
3689
  public:
3690
  DEFINE_SIZE_ARRAY (2, rule);
3691
};
3692
3693
template <typename Types>
3694
struct ChainContextFormat1_4
3695
{
3696
  using ChainRuleSet = OT::ChainRuleSet<Types>;
3697
3698
  bool intersects (const hb_set_t *glyphs) const
3699
4.46k
  {
3700
4.46k
    struct ChainContextClosureLookupContext lookup_context = {
3701
4.46k
      {intersects_glyph, intersected_glyph},
3702
4.46k
      ContextFormat::SimpleContext,
3703
4.46k
      {nullptr, nullptr, nullptr}
3704
4.46k
    };
3705
3706
4.46k
    return
3707
4.46k
    + hb_zip (this+coverage, ruleSet)
3708
4.46k
    | hb_filter (*glyphs, hb_first)
3709
4.46k
    | hb_map (hb_second)
3710
4.46k
    | hb_map (hb_add (this))
3711
4.46k
    | 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
3711
1.62k
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
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
Line
Count
Source
3711
995
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
3712
4.46k
    | hb_any
3713
4.46k
    ;
3714
4.46k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3699
3.22k
  {
3700
3.22k
    struct ChainContextClosureLookupContext lookup_context = {
3701
3.22k
      {intersects_glyph, intersected_glyph},
3702
3.22k
      ContextFormat::SimpleContext,
3703
3.22k
      {nullptr, nullptr, nullptr}
3704
3.22k
    };
3705
3706
3.22k
    return
3707
3.22k
    + hb_zip (this+coverage, ruleSet)
3708
3.22k
    | hb_filter (*glyphs, hb_first)
3709
3.22k
    | hb_map (hb_second)
3710
3.22k
    | hb_map (hb_add (this))
3711
3.22k
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
3712
3.22k
    | hb_any
3713
3.22k
    ;
3714
3.22k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3699
1.24k
  {
3700
1.24k
    struct ChainContextClosureLookupContext lookup_context = {
3701
1.24k
      {intersects_glyph, intersected_glyph},
3702
1.24k
      ContextFormat::SimpleContext,
3703
1.24k
      {nullptr, nullptr, nullptr}
3704
1.24k
    };
3705
3706
1.24k
    return
3707
1.24k
    + hb_zip (this+coverage, ruleSet)
3708
1.24k
    | hb_filter (*glyphs, hb_first)
3709
1.24k
    | hb_map (hb_second)
3710
1.24k
    | hb_map (hb_add (this))
3711
1.24k
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
3712
1.24k
    | hb_any
3713
1.24k
    ;
3714
1.24k
  }
3715
3716
  bool may_have_non_1to1 () const
3717
58
  { return true; }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
3717
58
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
3718
3719
  void closure (hb_closure_context_t *c) const
3720
5.49k
  {
3721
5.49k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3722
5.49k
    if (unlikely (!cur_active_glyphs)) return;
3723
5.45k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3724
5.45k
           *cur_active_glyphs);
3725
3726
5.45k
    struct ChainContextClosureLookupContext lookup_context = {
3727
5.45k
      {intersects_glyph, intersected_glyph},
3728
5.45k
      ContextFormat::SimpleContext,
3729
5.45k
      {nullptr, nullptr, nullptr}
3730
5.45k
    };
3731
3732
5.45k
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3733
6.68k
    | hb_filter ([&] (hb_codepoint_t _) {
3734
6.68k
      return c->previous_parent_active_glyphs ().has (_);
3735
6.68k
    }, 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
3733
5.76k
    | hb_filter ([&] (hb_codepoint_t _) {
3734
5.76k
      return c->previous_parent_active_glyphs ().has (_);
3735
5.76k
    }, hb_first)
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3733
919
    | hb_filter ([&] (hb_codepoint_t _) {
3734
919
      return c->previous_parent_active_glyphs ().has (_);
3735
919
    }, hb_first)
3736
5.45k
    | 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
3736
2.74k
    | 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::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
Line
Count
Source
3736
598
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
3737
5.45k
    | 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
3737
2.74k
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
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
Line
Count
Source
3737
598
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
3738
5.45k
    ;
3739
3740
5.45k
    c->pop_cur_done_glyphs ();
3741
5.45k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3720
4.71k
  {
3721
4.71k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3722
4.71k
    if (unlikely (!cur_active_glyphs)) return;
3723
4.70k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3724
4.70k
           *cur_active_glyphs);
3725
3726
4.70k
    struct ChainContextClosureLookupContext lookup_context = {
3727
4.70k
      {intersects_glyph, intersected_glyph},
3728
4.70k
      ContextFormat::SimpleContext,
3729
4.70k
      {nullptr, nullptr, nullptr}
3730
4.70k
    };
3731
3732
4.70k
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3733
4.70k
    | hb_filter ([&] (hb_codepoint_t _) {
3734
4.70k
      return c->previous_parent_active_glyphs ().has (_);
3735
4.70k
    }, hb_first)
3736
4.70k
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
3737
4.70k
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
3738
4.70k
    ;
3739
3740
4.70k
    c->pop_cur_done_glyphs ();
3741
4.70k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3720
782
  {
3721
782
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3722
782
    if (unlikely (!cur_active_glyphs)) return;
3723
745
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3724
745
           *cur_active_glyphs);
3725
3726
745
    struct ChainContextClosureLookupContext lookup_context = {
3727
745
      {intersects_glyph, intersected_glyph},
3728
745
      ContextFormat::SimpleContext,
3729
745
      {nullptr, nullptr, nullptr}
3730
745
    };
3731
3732
745
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3733
745
    | hb_filter ([&] (hb_codepoint_t _) {
3734
745
      return c->previous_parent_active_glyphs ().has (_);
3735
745
    }, hb_first)
3736
745
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
3737
745
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
3738
745
    ;
3739
3740
745
    c->pop_cur_done_glyphs ();
3741
745
  }
3742
3743
  void closure_lookups (hb_closure_lookups_context_t *c) const
3744
1.72k
  {
3745
1.72k
    struct ChainContextClosureLookupContext lookup_context = {
3746
1.72k
      {intersects_glyph, nullptr},
3747
1.72k
      ContextFormat::SimpleContext,
3748
1.72k
      {nullptr, nullptr, nullptr}
3749
1.72k
    };
3750
3751
1.72k
    + hb_zip (this+coverage, ruleSet)
3752
1.72k
    | hb_filter (*c->glyphs, hb_first)
3753
1.72k
    | hb_map (hb_second)
3754
1.72k
    | hb_map (hb_add (this))
3755
1.72k
    | 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
3755
921
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
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
Line
Count
Source
3755
630
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
3756
1.72k
    ;
3757
1.72k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3744
1.07k
  {
3745
1.07k
    struct ChainContextClosureLookupContext lookup_context = {
3746
1.07k
      {intersects_glyph, nullptr},
3747
1.07k
      ContextFormat::SimpleContext,
3748
1.07k
      {nullptr, nullptr, nullptr}
3749
1.07k
    };
3750
3751
1.07k
    + hb_zip (this+coverage, ruleSet)
3752
1.07k
    | hb_filter (*c->glyphs, hb_first)
3753
1.07k
    | hb_map (hb_second)
3754
1.07k
    | hb_map (hb_add (this))
3755
1.07k
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
3756
1.07k
    ;
3757
1.07k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3744
650
  {
3745
650
    struct ChainContextClosureLookupContext lookup_context = {
3746
650
      {intersects_glyph, nullptr},
3747
650
      ContextFormat::SimpleContext,
3748
650
      {nullptr, nullptr, nullptr}
3749
650
    };
3750
3751
650
    + hb_zip (this+coverage, ruleSet)
3752
650
    | hb_filter (*c->glyphs, hb_first)
3753
650
    | hb_map (hb_second)
3754
650
    | hb_map (hb_add (this))
3755
650
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
3756
650
    ;
3757
650
  }
3758
3759
3
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Line
Count
Source
3759
3
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
3760
3761
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3762
0
  {
3763
0
    (this+coverage).collect_coverage (c->input);
3764
3765
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
3766
0
      {collect_glyph},
3767
0
      {nullptr, nullptr, nullptr}
3768
0
    };
3769
3770
0
    + hb_iter (ruleSet)
3771
0
    | hb_map (hb_add (this))
3772
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
3773
0
    ;
3774
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
3775
3776
  bool would_apply (hb_would_apply_context_t *c) const
3777
9.71k
  {
3778
9.71k
    const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
3779
9.71k
    struct ChainContextApplyLookupContext lookup_context = {
3780
9.71k
      {{match_glyph, match_glyph, match_glyph}},
3781
9.71k
      {nullptr, nullptr, nullptr}
3782
9.71k
    };
3783
9.71k
    return rule_set.would_apply (c, lookup_context);
3784
9.71k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
3777
8.71k
  {
3778
8.71k
    const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
3779
8.71k
    struct ChainContextApplyLookupContext lookup_context = {
3780
8.71k
      {{match_glyph, match_glyph, match_glyph}},
3781
8.71k
      {nullptr, nullptr, nullptr}
3782
8.71k
    };
3783
8.71k
    return rule_set.would_apply (c, lookup_context);
3784
8.71k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
3777
999
  {
3778
999
    const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
3779
999
    struct ChainContextApplyLookupContext lookup_context = {
3780
999
      {{match_glyph, match_glyph, match_glyph}},
3781
999
      {nullptr, nullptr, nullptr}
3782
999
    };
3783
999
    return rule_set.would_apply (c, lookup_context);
3784
999
  }
3785
3786
10.7k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3786
8.01k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
3786
2.71k
  const Coverage &get_coverage () const { return this+coverage; }
3787
3788
  bool apply (hb_ot_apply_context_t *c) const
3789
1.49M
  {
3790
1.49M
    TRACE_APPLY (this);
3791
1.49M
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3792
1.49M
    if (index == NOT_COVERED) return_trace (false);
3793
3794
1.43M
    const ChainRuleSet &rule_set = this+ruleSet[index];
3795
1.43M
    struct ChainContextApplyLookupContext lookup_context = {
3796
1.43M
      {{match_glyph, match_glyph, match_glyph}},
3797
1.43M
      {nullptr, nullptr, nullptr}
3798
1.43M
    };
3799
1.43M
    return_trace (rule_set.apply (c, lookup_context));
3800
1.49M
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
3789
1.33M
  {
3790
1.33M
    TRACE_APPLY (this);
3791
1.33M
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3792
1.33M
    if (index == NOT_COVERED) return_trace (false);
3793
3794
1.27M
    const ChainRuleSet &rule_set = this+ruleSet[index];
3795
1.27M
    struct ChainContextApplyLookupContext lookup_context = {
3796
1.27M
      {{match_glyph, match_glyph, match_glyph}},
3797
1.27M
      {nullptr, nullptr, nullptr}
3798
1.27M
    };
3799
1.27M
    return_trace (rule_set.apply (c, lookup_context));
3800
1.33M
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
3789
161k
  {
3790
161k
    TRACE_APPLY (this);
3791
161k
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3792
161k
    if (index == NOT_COVERED) return_trace (false);
3793
3794
160k
    const ChainRuleSet &rule_set = this+ruleSet[index];
3795
160k
    struct ChainContextApplyLookupContext lookup_context = {
3796
160k
      {{match_glyph, match_glyph, match_glyph}},
3797
160k
      {nullptr, nullptr, nullptr}
3798
160k
    };
3799
160k
    return_trace (rule_set.apply (c, lookup_context));
3800
161k
  }
3801
3802
  bool subset (hb_subset_context_t *c) const
3803
1.20k
  {
3804
1.20k
    TRACE_SUBSET (this);
3805
1.20k
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3806
1.20k
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3807
3808
1.20k
    auto *out = c->serializer->start_embed (*this);
3809
1.20k
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3810
1.20k
    out->format = format;
3811
3812
1.20k
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3813
1.20k
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3814
1.20k
    + hb_zip (this+coverage, ruleSet)
3815
1.20k
    | hb_filter (glyphset, hb_first)
3816
1.20k
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3817
1.20k
    | hb_map (hb_first)
3818
1.20k
    | hb_map (glyph_map)
3819
1.20k
    | hb_sink (new_coverage)
3820
1.20k
    ;
3821
3822
1.20k
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3823
1.20k
    return_trace (bool (new_coverage));
3824
1.20k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
3803
672
  {
3804
672
    TRACE_SUBSET (this);
3805
672
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3806
672
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3807
3808
672
    auto *out = c->serializer->start_embed (*this);
3809
672
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3810
672
    out->format = format;
3811
3812
672
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3813
672
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3814
672
    + hb_zip (this+coverage, ruleSet)
3815
672
    | hb_filter (glyphset, hb_first)
3816
672
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3817
672
    | hb_map (hb_first)
3818
672
    | hb_map (glyph_map)
3819
672
    | hb_sink (new_coverage)
3820
672
    ;
3821
3822
672
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3823
672
    return_trace (bool (new_coverage));
3824
672
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
3803
528
  {
3804
528
    TRACE_SUBSET (this);
3805
528
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3806
528
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3807
3808
528
    auto *out = c->serializer->start_embed (*this);
3809
528
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3810
528
    out->format = format;
3811
3812
528
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3813
528
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3814
528
    + hb_zip (this+coverage, ruleSet)
3815
528
    | hb_filter (glyphset, hb_first)
3816
528
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3817
528
    | hb_map (hb_first)
3818
528
    | hb_map (glyph_map)
3819
528
    | hb_sink (new_coverage)
3820
528
    ;
3821
3822
528
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3823
528
    return_trace (bool (new_coverage));
3824
528
  }
3825
3826
  bool sanitize (hb_sanitize_context_t *c) const
3827
18.0k
  {
3828
18.0k
    TRACE_SANITIZE (this);
3829
18.0k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3830
18.0k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3827
13.3k
  {
3828
13.3k
    TRACE_SANITIZE (this);
3829
13.3k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3830
13.3k
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3827
4.76k
  {
3828
4.76k
    TRACE_SANITIZE (this);
3829
4.76k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3830
4.76k
  }
3831
3832
  protected:
3833
  HBUINT16  format;     /* Format identifier--format = 1 */
3834
  typename Types::template OffsetTo<Coverage>
3835
    coverage;   /* Offset to Coverage table--from
3836
           * beginning of table */
3837
  Array16Of<typename Types::template OffsetTo<ChainRuleSet>>
3838
    ruleSet;    /* Array of ChainRuleSet tables
3839
           * ordered by Coverage Index */
3840
  public:
3841
  DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet);
3842
};
3843
3844
template <typename Types>
3845
struct ChainContextFormat2_5
3846
{
3847
  using ChainRuleSet = OT::ChainRuleSet<SmallTypes>;
3848
3849
  bool intersects (const hb_set_t *glyphs) const
3850
3.84k
  {
3851
3.84k
    if (!(this+coverage).intersects (glyphs))
3852
1.22k
      return false;
3853
3854
2.62k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3855
2.62k
    const ClassDef &input_class_def = this+inputClassDef;
3856
2.62k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3857
3858
2.62k
    hb_map_t caches[3] = {};
3859
2.62k
    struct ChainContextClosureLookupContext lookup_context = {
3860
2.62k
      {intersects_class, nullptr},
3861
2.62k
      ContextFormat::ClassBasedContext,
3862
2.62k
      {&backtrack_class_def,
3863
2.62k
       &input_class_def,
3864
2.62k
       &lookahead_class_def},
3865
2.62k
      {&caches[0], &caches[1], &caches[2]}
3866
2.62k
    };
3867
3868
2.62k
    hb_set_t retained_coverage_glyphs;
3869
2.62k
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3870
3871
2.62k
    hb_set_t coverage_glyph_classes;
3872
2.62k
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3873
3874
2.62k
    return
3875
2.62k
    + hb_iter (ruleSet)
3876
2.62k
    | hb_map (hb_add (this))
3877
2.62k
    | hb_enumerate
3878
2.62k
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
3879
70.7k
        { return input_class_def.intersects_class (glyphs, p.first) &&
3880
2.90k
           coverage_glyph_classes.has (p.first) &&
3881
1.80k
           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
3879
69.7k
        { return input_class_def.intersects_class (glyphs, p.first) &&
3880
2.33k
           coverage_glyph_classes.has (p.first) &&
3881
1.27k
           p.second.intersects (glyphs, lookup_context); })
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
Line
Count
Source
3879
1.01k
        { return input_class_def.intersects_class (glyphs, p.first) &&
3880
566
           coverage_glyph_classes.has (p.first) &&
3881
528
           p.second.intersects (glyphs, lookup_context); })
3882
2.62k
    | hb_any
3883
3.84k
    ;
3884
3.84k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3850
2.99k
  {
3851
2.99k
    if (!(this+coverage).intersects (glyphs))
3852
1.00k
      return false;
3853
3854
1.98k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3855
1.98k
    const ClassDef &input_class_def = this+inputClassDef;
3856
1.98k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3857
3858
1.98k
    hb_map_t caches[3] = {};
3859
1.98k
    struct ChainContextClosureLookupContext lookup_context = {
3860
1.98k
      {intersects_class, nullptr},
3861
1.98k
      ContextFormat::ClassBasedContext,
3862
1.98k
      {&backtrack_class_def,
3863
1.98k
       &input_class_def,
3864
1.98k
       &lookahead_class_def},
3865
1.98k
      {&caches[0], &caches[1], &caches[2]}
3866
1.98k
    };
3867
3868
1.98k
    hb_set_t retained_coverage_glyphs;
3869
1.98k
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3870
3871
1.98k
    hb_set_t coverage_glyph_classes;
3872
1.98k
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3873
3874
1.98k
    return
3875
1.98k
    + hb_iter (ruleSet)
3876
1.98k
    | hb_map (hb_add (this))
3877
1.98k
    | hb_enumerate
3878
1.98k
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
3879
1.98k
        { return input_class_def.intersects_class (glyphs, p.first) &&
3880
1.98k
           coverage_glyph_classes.has (p.first) &&
3881
1.98k
           p.second.intersects (glyphs, lookup_context); })
3882
1.98k
    | hb_any
3883
2.99k
    ;
3884
2.99k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
Line
Count
Source
3850
859
  {
3851
859
    if (!(this+coverage).intersects (glyphs))
3852
226
      return false;
3853
3854
633
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3855
633
    const ClassDef &input_class_def = this+inputClassDef;
3856
633
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3857
3858
633
    hb_map_t caches[3] = {};
3859
633
    struct ChainContextClosureLookupContext lookup_context = {
3860
633
      {intersects_class, nullptr},
3861
633
      ContextFormat::ClassBasedContext,
3862
633
      {&backtrack_class_def,
3863
633
       &input_class_def,
3864
633
       &lookahead_class_def},
3865
633
      {&caches[0], &caches[1], &caches[2]}
3866
633
    };
3867
3868
633
    hb_set_t retained_coverage_glyphs;
3869
633
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3870
3871
633
    hb_set_t coverage_glyph_classes;
3872
633
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3873
3874
633
    return
3875
633
    + hb_iter (ruleSet)
3876
633
    | hb_map (hb_add (this))
3877
633
    | hb_enumerate
3878
633
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
3879
633
        { return input_class_def.intersects_class (glyphs, p.first) &&
3880
633
           coverage_glyph_classes.has (p.first) &&
3881
633
           p.second.intersects (glyphs, lookup_context); })
3882
633
    | hb_any
3883
859
    ;
3884
859
  }
3885
3886
  bool may_have_non_1to1 () const
3887
13
  { return true; }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Line
Count
Source
3887
13
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
3888
3889
  void closure (hb_closure_context_t *c) const
3890
2.26k
  {
3891
2.26k
    if (!(this+coverage).intersects (c->glyphs))
3892
964
      return;
3893
3894
1.29k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3895
1.29k
    if (unlikely (!cur_active_glyphs)) return;
3896
1.25k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3897
1.25k
           *cur_active_glyphs);
3898
3899
1.25k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3900
1.25k
    const ClassDef &input_class_def = this+inputClassDef;
3901
1.25k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3902
3903
1.25k
    hb_map_t caches[3] = {};
3904
1.25k
    intersected_class_cache_t intersected_cache;
3905
1.25k
    struct ChainContextClosureLookupContext lookup_context = {
3906
1.25k
      {intersects_class, intersected_class_glyphs},
3907
1.25k
      ContextFormat::ClassBasedContext,
3908
1.25k
      {&backtrack_class_def,
3909
1.25k
       &input_class_def,
3910
1.25k
       &lookahead_class_def},
3911
1.25k
      {&caches[0], &caches[1], &caches[2]},
3912
1.25k
      &intersected_cache
3913
1.25k
    };
3914
3915
1.25k
    + hb_enumerate (ruleSet)
3916
1.25k
    | hb_filter ([&] (unsigned _)
3917
71.7k
    { 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
3917
71.0k
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3917
719
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
3918
1.25k
     hb_first)
3919
1.25k
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
3920
1.35k
                {
3921
1.35k
                  const ChainRuleSet& chainrule_set = this+_.second;
3922
1.35k
                  chainrule_set.closure (c, _.first, lookup_context);
3923
1.35k
                })
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
3920
966
                {
3921
966
                  const ChainRuleSet& chainrule_set = this+_.second;
3922
966
                  chainrule_set.closure (c, _.first, lookup_context);
3923
966
                })
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
Line
Count
Source
3920
392
                {
3921
392
                  const ChainRuleSet& chainrule_set = this+_.second;
3922
392
                  chainrule_set.closure (c, _.first, lookup_context);
3923
392
                })
3924
1.25k
    ;
3925
3926
1.25k
    c->pop_cur_done_glyphs ();
3927
1.25k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3890
1.85k
  {
3891
1.85k
    if (!(this+coverage).intersects (c->glyphs))
3892
865
      return;
3893
3894
993
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3895
993
    if (unlikely (!cur_active_glyphs)) return;
3896
953
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3897
953
           *cur_active_glyphs);
3898
3899
953
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3900
953
    const ClassDef &input_class_def = this+inputClassDef;
3901
953
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3902
3903
953
    hb_map_t caches[3] = {};
3904
953
    intersected_class_cache_t intersected_cache;
3905
953
    struct ChainContextClosureLookupContext lookup_context = {
3906
953
      {intersects_class, intersected_class_glyphs},
3907
953
      ContextFormat::ClassBasedContext,
3908
953
      {&backtrack_class_def,
3909
953
       &input_class_def,
3910
953
       &lookahead_class_def},
3911
953
      {&caches[0], &caches[1], &caches[2]},
3912
953
      &intersected_cache
3913
953
    };
3914
3915
953
    + hb_enumerate (ruleSet)
3916
953
    | hb_filter ([&] (unsigned _)
3917
953
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
3918
953
     hb_first)
3919
953
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
3920
953
                {
3921
953
                  const ChainRuleSet& chainrule_set = this+_.second;
3922
953
                  chainrule_set.closure (c, _.first, lookup_context);
3923
953
                })
3924
953
    ;
3925
3926
953
    c->pop_cur_done_glyphs ();
3927
953
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
Line
Count
Source
3890
405
  {
3891
405
    if (!(this+coverage).intersects (c->glyphs))
3892
99
      return;
3893
3894
306
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3895
306
    if (unlikely (!cur_active_glyphs)) return;
3896
306
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3897
306
           *cur_active_glyphs);
3898
3899
306
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3900
306
    const ClassDef &input_class_def = this+inputClassDef;
3901
306
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3902
3903
306
    hb_map_t caches[3] = {};
3904
306
    intersected_class_cache_t intersected_cache;
3905
306
    struct ChainContextClosureLookupContext lookup_context = {
3906
306
      {intersects_class, intersected_class_glyphs},
3907
306
      ContextFormat::ClassBasedContext,
3908
306
      {&backtrack_class_def,
3909
306
       &input_class_def,
3910
306
       &lookahead_class_def},
3911
306
      {&caches[0], &caches[1], &caches[2]},
3912
306
      &intersected_cache
3913
306
    };
3914
3915
306
    + hb_enumerate (ruleSet)
3916
306
    | hb_filter ([&] (unsigned _)
3917
306
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
3918
306
     hb_first)
3919
306
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
3920
306
                {
3921
306
                  const ChainRuleSet& chainrule_set = this+_.second;
3922
306
                  chainrule_set.closure (c, _.first, lookup_context);
3923
306
                })
3924
306
    ;
3925
3926
306
    c->pop_cur_done_glyphs ();
3927
306
  }
3928
3929
  void closure_lookups (hb_closure_lookups_context_t *c) const
3930
1.34k
  {
3931
1.34k
    if (!(this+coverage).intersects (c->glyphs))
3932
208
      return;
3933
3934
1.13k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3935
1.13k
    const ClassDef &input_class_def = this+inputClassDef;
3936
1.13k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3937
3938
1.13k
    hb_map_t caches[3] = {};
3939
1.13k
    struct ChainContextClosureLookupContext lookup_context = {
3940
1.13k
      {intersects_class, nullptr},
3941
1.13k
      ContextFormat::ClassBasedContext,
3942
1.13k
      {&backtrack_class_def,
3943
1.13k
       &input_class_def,
3944
1.13k
       &lookahead_class_def},
3945
1.13k
      {&caches[0], &caches[1], &caches[2]}
3946
1.13k
    };
3947
3948
1.13k
    + hb_iter (ruleSet)
3949
1.13k
    | hb_map (hb_add (this))
3950
1.13k
    | hb_enumerate
3951
1.13k
    | hb_filter([&] (unsigned klass)
3952
6.19k
    { 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
3952
5.40k
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Line
Count
Source
3952
786
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
3953
1.13k
    | hb_map (hb_second)
3954
1.13k
    | hb_apply ([&] (const ChainRuleSet &_)
3955
2.11k
    { _.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
3955
1.52k
    { _.closure_lookups (c, lookup_context); })
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
Line
Count
Source
3955
586
    { _.closure_lookups (c, lookup_context); })
3956
1.13k
    ;
3957
1.13k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3930
954
  {
3931
954
    if (!(this+coverage).intersects (c->glyphs))
3932
120
      return;
3933
3934
834
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3935
834
    const ClassDef &input_class_def = this+inputClassDef;
3936
834
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3937
3938
834
    hb_map_t caches[3] = {};
3939
834
    struct ChainContextClosureLookupContext lookup_context = {
3940
834
      {intersects_class, nullptr},
3941
834
      ContextFormat::ClassBasedContext,
3942
834
      {&backtrack_class_def,
3943
834
       &input_class_def,
3944
834
       &lookahead_class_def},
3945
834
      {&caches[0], &caches[1], &caches[2]}
3946
834
    };
3947
3948
834
    + hb_iter (ruleSet)
3949
834
    | hb_map (hb_add (this))
3950
834
    | hb_enumerate
3951
834
    | hb_filter([&] (unsigned klass)
3952
834
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
3953
834
    | hb_map (hb_second)
3954
834
    | hb_apply ([&] (const ChainRuleSet &_)
3955
834
    { _.closure_lookups (c, lookup_context); })
3956
834
    ;
3957
834
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Line
Count
Source
3930
390
  {
3931
390
    if (!(this+coverage).intersects (c->glyphs))
3932
88
      return;
3933
3934
302
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3935
302
    const ClassDef &input_class_def = this+inputClassDef;
3936
302
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3937
3938
302
    hb_map_t caches[3] = {};
3939
302
    struct ChainContextClosureLookupContext lookup_context = {
3940
302
      {intersects_class, nullptr},
3941
302
      ContextFormat::ClassBasedContext,
3942
302
      {&backtrack_class_def,
3943
302
       &input_class_def,
3944
302
       &lookahead_class_def},
3945
302
      {&caches[0], &caches[1], &caches[2]}
3946
302
    };
3947
3948
302
    + hb_iter (ruleSet)
3949
302
    | hb_map (hb_add (this))
3950
302
    | hb_enumerate
3951
302
    | hb_filter([&] (unsigned klass)
3952
302
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
3953
302
    | hb_map (hb_second)
3954
302
    | hb_apply ([&] (const ChainRuleSet &_)
3955
302
    { _.closure_lookups (c, lookup_context); })
3956
302
    ;
3957
302
  }
3958
3959
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
3960
3961
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3962
0
  {
3963
0
    (this+coverage).collect_coverage (c->input);
3964
3965
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3966
0
    const ClassDef &input_class_def = this+inputClassDef;
3967
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3968
3969
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
3970
0
      {collect_class},
3971
0
      {&backtrack_class_def,
3972
0
       &input_class_def,
3973
0
       &lookahead_class_def}
3974
0
    };
3975
3976
0
    + hb_iter (ruleSet)
3977
0
    | hb_map (hb_add (this))
3978
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
3979
0
    ;
3980
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
3981
3982
  bool would_apply (hb_would_apply_context_t *c) const
3983
2.08k
  {
3984
2.08k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3985
2.08k
    const ClassDef &input_class_def = this+inputClassDef;
3986
2.08k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3987
3988
2.08k
    unsigned int index = input_class_def.get_class (c->glyphs[0]);
3989
2.08k
    const ChainRuleSet &rule_set = this+ruleSet[index];
3990
2.08k
    struct ChainContextApplyLookupContext lookup_context = {
3991
2.08k
      {{match_class, match_class, match_class}},
3992
2.08k
      {&backtrack_class_def,
3993
2.08k
       &input_class_def,
3994
2.08k
       &lookahead_class_def}
3995
2.08k
    };
3996
2.08k
    return rule_set.would_apply (c, lookup_context);
3997
2.08k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
3983
1.33k
  {
3984
1.33k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3985
1.33k
    const ClassDef &input_class_def = this+inputClassDef;
3986
1.33k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3987
3988
1.33k
    unsigned int index = input_class_def.get_class (c->glyphs[0]);
3989
1.33k
    const ChainRuleSet &rule_set = this+ruleSet[index];
3990
1.33k
    struct ChainContextApplyLookupContext lookup_context = {
3991
1.33k
      {{match_class, match_class, match_class}},
3992
1.33k
      {&backtrack_class_def,
3993
1.33k
       &input_class_def,
3994
1.33k
       &lookahead_class_def}
3995
1.33k
    };
3996
1.33k
    return rule_set.would_apply (c, lookup_context);
3997
1.33k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
Line
Count
Source
3983
759
  {
3984
759
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
3985
759
    const ClassDef &input_class_def = this+inputClassDef;
3986
759
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
3987
3988
759
    unsigned int index = input_class_def.get_class (c->glyphs[0]);
3989
759
    const ChainRuleSet &rule_set = this+ruleSet[index];
3990
759
    struct ChainContextApplyLookupContext lookup_context = {
3991
759
      {{match_class, match_class, match_class}},
3992
759
      {&backtrack_class_def,
3993
759
       &input_class_def,
3994
759
       &lookahead_class_def}
3995
759
    };
3996
759
    return rule_set.would_apply (c, lookup_context);
3997
759
  }
3998
3999
14.5k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3999
8.92k
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
3999
5.67k
  const Coverage &get_coverage () const { return this+coverage; }
4000
4001
  unsigned cache_cost () const
4002
13.3k
  {
4003
13.3k
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
4004
13.3k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Line
Count
Source
4002
7.96k
  {
4003
7.96k
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
4004
7.96k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
Line
Count
Source
4002
5.36k
  {
4003
5.36k
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
4004
5.36k
  }
4005
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
4006
4.56k
  {
4007
4.56k
    return context_cache_func (c, op);
4008
4.56k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
4006
3.46k
  {
4007
3.46k
    return context_cache_func (c, op);
4008
3.46k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
4006
1.09k
  {
4007
1.09k
    return context_cache_func (c, op);
4008
1.09k
  }
4009
4010
  struct external_cache_t
4011
  {
4012
    hb_ot_layout_binary_cache_t coverage;
4013
  };
4014
  void *external_cache_create () const
4015
6.50k
  {
4016
6.50k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
4017
6.50k
    if (likely (cache))
4018
6.34k
    {
4019
6.34k
      cache->coverage.clear ();
4020
6.34k
    }
4021
6.50k
    return cache;
4022
6.50k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Line
Count
Source
4015
4.95k
  {
4016
4.95k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
4017
4.95k
    if (likely (cache))
4018
4.83k
    {
4019
4.83k
      cache->coverage.clear ();
4020
4.83k
    }
4021
4.95k
    return cache;
4022
4.95k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
Line
Count
Source
4015
1.54k
  {
4016
1.54k
    external_cache_t *cache = (external_cache_t *) hb_malloc (sizeof (external_cache_t));
4017
1.54k
    if (likely (cache))
4018
1.50k
    {
4019
1.50k
      cache->coverage.clear ();
4020
1.50k
    }
4021
1.54k
    return cache;
4022
1.54k
  }
4023
248k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
4023
240k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
4023
7.54k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
4024
154k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
4024
92.6k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Line
Count
Source
4024
62.1k
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
4025
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
4026
402k
  {
4027
402k
    TRACE_APPLY (this);
4028
402k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4029
402k
    external_cache_t *cache = (external_cache_t *) external_cache;
4030
402k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
4031
#else
4032
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
4033
#endif
4034
402k
    if (index == NOT_COVERED) return_trace (false);
4035
4036
258k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
4037
258k
    const ClassDef &input_class_def = this+inputClassDef;
4038
258k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
4039
4040
    /* match_class_caches1 is slightly faster. Use it for lookahead,
4041
     * which is typically longer. */
4042
258k
    struct ChainContextApplyLookupContext lookup_context = {
4043
258k
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
4044
258k
        cached ? match_class_cached2 : match_class,
4045
258k
        cached ? match_class_cached1 : match_class}},
4046
258k
      {&backtrack_class_def,
4047
258k
       &input_class_def,
4048
258k
       &lookahead_class_def}
4049
258k
    };
4050
4051
258k
    index = cached
4052
258k
         ? get_class_cached2 (input_class_def, c->buffer->cur())
4053
258k
          : input_class_def.get_class (c->buffer->cur().codepoint);
4054
258k
    const ChainRuleSet &rule_set = this+ruleSet[index];
4055
258k
    return_trace (rule_set.apply (c, lookup_context));
4056
402k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
4026
333k
  {
4027
333k
    TRACE_APPLY (this);
4028
333k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4029
333k
    external_cache_t *cache = (external_cache_t *) external_cache;
4030
333k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
4031
#else
4032
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
4033
#endif
4034
333k
    if (index == NOT_COVERED) return_trace (false);
4035
4036
233k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
4037
233k
    const ClassDef &input_class_def = this+inputClassDef;
4038
233k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
4039
4040
    /* match_class_caches1 is slightly faster. Use it for lookahead,
4041
     * which is typically longer. */
4042
233k
    struct ChainContextApplyLookupContext lookup_context = {
4043
233k
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
4044
233k
        cached ? match_class_cached2 : match_class,
4045
233k
        cached ? match_class_cached1 : match_class}},
4046
233k
      {&backtrack_class_def,
4047
233k
       &input_class_def,
4048
233k
       &lookahead_class_def}
4049
233k
    };
4050
4051
233k
    index = cached
4052
233k
         ? get_class_cached2 (input_class_def, c->buffer->cur())
4053
233k
          : input_class_def.get_class (c->buffer->cur().codepoint);
4054
233k
    const ChainRuleSet &rule_set = this+ruleSet[index];
4055
233k
    return_trace (rule_set.apply (c, lookup_context));
4056
333k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
4026
69.6k
  {
4027
69.6k
    TRACE_APPLY (this);
4028
69.6k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4029
69.6k
    external_cache_t *cache = (external_cache_t *) external_cache;
4030
69.6k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
4031
#else
4032
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
4033
#endif
4034
69.6k
    if (index == NOT_COVERED) return_trace (false);
4035
4036
25.0k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
4037
25.0k
    const ClassDef &input_class_def = this+inputClassDef;
4038
25.0k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
4039
4040
    /* match_class_caches1 is slightly faster. Use it for lookahead,
4041
     * which is typically longer. */
4042
25.0k
    struct ChainContextApplyLookupContext lookup_context = {
4043
25.0k
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
4044
25.0k
        cached ? match_class_cached2 : match_class,
4045
25.0k
        cached ? match_class_cached1 : match_class}},
4046
25.0k
      {&backtrack_class_def,
4047
25.0k
       &input_class_def,
4048
25.0k
       &lookahead_class_def}
4049
25.0k
    };
4050
4051
25.0k
    index = cached
4052
25.0k
         ? get_class_cached2 (input_class_def, c->buffer->cur())
4053
25.0k
          : input_class_def.get_class (c->buffer->cur().codepoint);
4054
25.0k
    const ChainRuleSet &rule_set = this+ruleSet[index];
4055
25.0k
    return_trace (rule_set.apply (c, lookup_context));
4056
69.6k
  }
4057
4058
  bool subset (hb_subset_context_t *c) const
4059
713
  {
4060
713
    TRACE_SUBSET (this);
4061
713
    auto *out = c->serializer->start_embed (*this);
4062
713
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4063
713
    out->format = format;
4064
713
    out->coverage.serialize_subset (c, coverage, this);
4065
4066
713
    hb_map_t backtrack_klass_map;
4067
713
    hb_map_t input_klass_map;
4068
713
    hb_map_t lookahead_klass_map;
4069
4070
713
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
4071
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
4072
713
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
4073
713
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
4074
4075
713
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
4076
713
               input_klass_map,
4077
713
               lookahead_klass_map)))
4078
6
      return_trace (false);
4079
4080
707
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
4081
707
    hb_set_t retained_coverage_glyphs;
4082
707
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
4083
4084
707
    hb_set_t coverage_glyph_classes;
4085
707
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
4086
4087
707
    int non_zero_index = -1, index = 0;
4088
707
    bool ret = true;
4089
707
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4090
707
    auto last_non_zero = c->serializer->snapshot ();
4091
707
    for (const auto& _ : + hb_enumerate (ruleSet)
4092
707
       | hb_filter (input_klass_map, hb_first))
4093
939
    {
4094
939
      auto *o = out->ruleSet.serialize_append (c->serializer);
4095
939
      if (unlikely (!o))
4096
0
      {
4097
0
  ret = false;
4098
0
  break;
4099
0
      }
4100
939
      if (coverage_glyph_classes.has (_.first) &&
4101
673
          o->serialize_subset (c, _.second, this,
4102
673
             lookup_map,
4103
673
             &backtrack_klass_map,
4104
673
             &input_klass_map,
4105
673
             &lookahead_klass_map))
4106
352
      {
4107
352
        last_non_zero = c->serializer->snapshot ();
4108
352
  non_zero_index = index;
4109
352
      }
4110
4111
939
      index++;
4112
939
    }
4113
4114
707
    if (!ret || non_zero_index == -1) return_trace (false);
4115
4116
    // prune empty trailing ruleSets
4117
352
    if (index > non_zero_index) {
4118
352
      c->serializer->revert (last_non_zero);
4119
352
      out->ruleSet.len = non_zero_index + 1;
4120
352
    }
4121
4122
352
    return_trace (bool (out->ruleSet));
4123
707
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
4059
467
  {
4060
467
    TRACE_SUBSET (this);
4061
467
    auto *out = c->serializer->start_embed (*this);
4062
467
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4063
467
    out->format = format;
4064
467
    out->coverage.serialize_subset (c, coverage, this);
4065
4066
467
    hb_map_t backtrack_klass_map;
4067
467
    hb_map_t input_klass_map;
4068
467
    hb_map_t lookahead_klass_map;
4069
4070
467
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
4071
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
4072
467
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
4073
467
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
4074
4075
467
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
4076
467
               input_klass_map,
4077
467
               lookahead_klass_map)))
4078
6
      return_trace (false);
4079
4080
461
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
4081
461
    hb_set_t retained_coverage_glyphs;
4082
461
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
4083
4084
461
    hb_set_t coverage_glyph_classes;
4085
461
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
4086
4087
461
    int non_zero_index = -1, index = 0;
4088
461
    bool ret = true;
4089
461
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4090
461
    auto last_non_zero = c->serializer->snapshot ();
4091
461
    for (const auto& _ : + hb_enumerate (ruleSet)
4092
461
       | hb_filter (input_klass_map, hb_first))
4093
717
    {
4094
717
      auto *o = out->ruleSet.serialize_append (c->serializer);
4095
717
      if (unlikely (!o))
4096
0
      {
4097
0
  ret = false;
4098
0
  break;
4099
0
      }
4100
717
      if (coverage_glyph_classes.has (_.first) &&
4101
451
          o->serialize_subset (c, _.second, this,
4102
451
             lookup_map,
4103
451
             &backtrack_klass_map,
4104
451
             &input_klass_map,
4105
451
             &lookahead_klass_map))
4106
344
      {
4107
344
        last_non_zero = c->serializer->snapshot ();
4108
344
  non_zero_index = index;
4109
344
      }
4110
4111
717
      index++;
4112
717
    }
4113
4114
461
    if (!ret || non_zero_index == -1) return_trace (false);
4115
4116
    // prune empty trailing ruleSets
4117
344
    if (index > non_zero_index) {
4118
344
      c->serializer->revert (last_non_zero);
4119
344
      out->ruleSet.len = non_zero_index + 1;
4120
344
    }
4121
4122
344
    return_trace (bool (out->ruleSet));
4123
461
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
Line
Count
Source
4059
246
  {
4060
246
    TRACE_SUBSET (this);
4061
246
    auto *out = c->serializer->start_embed (*this);
4062
246
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4063
246
    out->format = format;
4064
246
    out->coverage.serialize_subset (c, coverage, this);
4065
4066
246
    hb_map_t backtrack_klass_map;
4067
246
    hb_map_t input_klass_map;
4068
246
    hb_map_t lookahead_klass_map;
4069
4070
246
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
4071
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
4072
246
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
4073
246
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
4074
4075
246
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
4076
246
               input_klass_map,
4077
246
               lookahead_klass_map)))
4078
0
      return_trace (false);
4079
4080
246
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
4081
246
    hb_set_t retained_coverage_glyphs;
4082
246
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
4083
4084
246
    hb_set_t coverage_glyph_classes;
4085
246
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
4086
4087
246
    int non_zero_index = -1, index = 0;
4088
246
    bool ret = true;
4089
246
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4090
246
    auto last_non_zero = c->serializer->snapshot ();
4091
246
    for (const auto& _ : + hb_enumerate (ruleSet)
4092
246
       | hb_filter (input_klass_map, hb_first))
4093
222
    {
4094
222
      auto *o = out->ruleSet.serialize_append (c->serializer);
4095
222
      if (unlikely (!o))
4096
0
      {
4097
0
  ret = false;
4098
0
  break;
4099
0
      }
4100
222
      if (coverage_glyph_classes.has (_.first) &&
4101
222
          o->serialize_subset (c, _.second, this,
4102
222
             lookup_map,
4103
222
             &backtrack_klass_map,
4104
222
             &input_klass_map,
4105
222
             &lookahead_klass_map))
4106
8
      {
4107
8
        last_non_zero = c->serializer->snapshot ();
4108
8
  non_zero_index = index;
4109
8
      }
4110
4111
222
      index++;
4112
222
    }
4113
4114
246
    if (!ret || non_zero_index == -1) return_trace (false);
4115
4116
    // prune empty trailing ruleSets
4117
8
    if (index > non_zero_index) {
4118
8
      c->serializer->revert (last_non_zero);
4119
8
      out->ruleSet.len = non_zero_index + 1;
4120
8
    }
4121
4122
8
    return_trace (bool (out->ruleSet));
4123
246
  }
4124
4125
  bool sanitize (hb_sanitize_context_t *c) const
4126
26.3k
  {
4127
26.3k
    TRACE_SANITIZE (this);
4128
26.3k
    return_trace (coverage.sanitize (c, this) &&
4129
26.3k
      backtrackClassDef.sanitize (c, this) &&
4130
26.3k
      inputClassDef.sanitize (c, this) &&
4131
26.3k
      lookaheadClassDef.sanitize (c, this) &&
4132
26.3k
      ruleSet.sanitize (c, this));
4133
26.3k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4126
16.9k
  {
4127
16.9k
    TRACE_SANITIZE (this);
4128
16.9k
    return_trace (coverage.sanitize (c, this) &&
4129
16.9k
      backtrackClassDef.sanitize (c, this) &&
4130
16.9k
      inputClassDef.sanitize (c, this) &&
4131
16.9k
      lookaheadClassDef.sanitize (c, this) &&
4132
16.9k
      ruleSet.sanitize (c, this));
4133
16.9k
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4126
9.41k
  {
4127
9.41k
    TRACE_SANITIZE (this);
4128
9.41k
    return_trace (coverage.sanitize (c, this) &&
4129
9.41k
      backtrackClassDef.sanitize (c, this) &&
4130
9.41k
      inputClassDef.sanitize (c, this) &&
4131
9.41k
      lookaheadClassDef.sanitize (c, this) &&
4132
9.41k
      ruleSet.sanitize (c, this));
4133
9.41k
  }
4134
4135
  protected:
4136
  HBUINT16  format;     /* Format identifier--format = 2 */
4137
  typename Types::template OffsetTo<Coverage>
4138
    coverage;   /* Offset to Coverage table--from
4139
           * beginning of table */
4140
  typename Types::template OffsetTo<ClassDef>
4141
    backtrackClassDef;  /* Offset to glyph ClassDef table
4142
           * containing backtrack sequence
4143
           * data--from beginning of table */
4144
  typename Types::template OffsetTo<ClassDef>
4145
    inputClassDef;    /* Offset to glyph ClassDef
4146
           * table containing input sequence
4147
           * data--from beginning of table */
4148
  typename Types::template OffsetTo<ClassDef>
4149
    lookaheadClassDef;  /* Offset to glyph ClassDef table
4150
           * containing lookahead sequence
4151
           * data--from beginning of table */
4152
  Array16Of<typename Types::template OffsetTo<ChainRuleSet>>
4153
    ruleSet;    /* Array of ChainRuleSet tables
4154
           * ordered by class */
4155
  public:
4156
  DEFINE_SIZE_ARRAY (4 + 4 * Types::size, ruleSet);
4157
};
4158
4159
struct ChainContextFormat3
4160
{
4161
  using RuleSet = OT::RuleSet<SmallTypes>;
4162
4163
  bool intersects (const hb_set_t *glyphs) const
4164
42.7k
  {
4165
42.7k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4166
4167
42.7k
    if (!(this+input[0]).intersects (glyphs))
4168
15.9k
      return false;
4169
4170
26.7k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4171
26.7k
    struct ChainContextClosureLookupContext lookup_context = {
4172
26.7k
      {intersects_coverage, nullptr},
4173
26.7k
      ContextFormat::CoverageBasedContext,
4174
26.7k
      {this, this, this}
4175
26.7k
    };
4176
26.7k
    return chain_context_intersects (glyphs,
4177
26.7k
             backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4178
26.7k
             input.len, (const HBUINT16 *) input.arrayZ + 1,
4179
26.7k
             lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4180
26.7k
             lookup_context);
4181
42.7k
  }
4182
4183
  bool may_have_non_1to1 () const
4184
337
  { return true; }
4185
4186
  void closure (hb_closure_context_t *c) const
4187
47.5k
  {
4188
47.5k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4189
4190
47.5k
    if (!(this+input[0]).intersects (c->glyphs))
4191
19.5k
      return;
4192
4193
27.9k
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
4194
27.9k
    if (unlikely (!cur_active_glyphs))
4195
3
      return;
4196
27.9k
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
4197
27.9k
           *cur_active_glyphs);
4198
4199
27.9k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4200
27.9k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4201
27.9k
    struct ChainContextClosureLookupContext lookup_context = {
4202
27.9k
      {intersects_coverage, intersected_coverage_glyphs},
4203
27.9k
      ContextFormat::CoverageBasedContext,
4204
27.9k
      {this, this, this}
4205
27.9k
    };
4206
27.9k
    chain_context_closure_lookup (c,
4207
27.9k
          backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4208
27.9k
          input.len, (const HBUINT16 *) input.arrayZ + 1,
4209
27.9k
          lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4210
27.9k
          lookup.len, lookup.arrayZ,
4211
27.9k
          0, lookup_context);
4212
4213
27.9k
    c->pop_cur_done_glyphs ();
4214
27.9k
  }
4215
4216
  void closure_lookups (hb_closure_lookups_context_t *c) const
4217
11.3k
  {
4218
11.3k
    if (!intersects (c->glyphs))
4219
2.25k
      return;
4220
4221
9.12k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4222
9.12k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4223
9.12k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4224
9.12k
    recurse_lookups (c, lookup.len, lookup.arrayZ);
4225
9.12k
  }
4226
4227
3
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
4228
4229
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
4230
0
  {
4231
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4232
4233
0
    (this+input[0]).collect_coverage (c->input);
4234
4235
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4236
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4237
4238
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
4239
0
      {collect_coverage},
4240
0
      {this, this, this}
4241
0
    };
4242
0
    chain_context_collect_glyphs_lookup (c,
4243
0
           backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4244
0
           input.len, (const HBUINT16 *) input.arrayZ + 1,
4245
0
           lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4246
0
           lookup.len, lookup.arrayZ,
4247
0
           lookup_context);
4248
0
  }
4249
4250
  bool would_apply (hb_would_apply_context_t *c) const
4251
1.31k
  {
4252
1.31k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4253
1.31k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4254
1.31k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4255
1.31k
    struct ChainContextApplyLookupContext lookup_context = {
4256
1.31k
      {{match_coverage, match_coverage, match_coverage}},
4257
1.31k
      {this, this, this}
4258
1.31k
    };
4259
1.31k
    return chain_context_would_apply_lookup (c,
4260
1.31k
               backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4261
1.31k
               input.len, (const HBUINT16 *) input.arrayZ + 1,
4262
1.31k
               lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4263
1.31k
               lookup.len, lookup.arrayZ, lookup_context);
4264
1.31k
  }
4265
4266
  const Coverage &get_coverage () const
4267
30.2k
  {
4268
30.2k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4269
30.2k
    return this+input[0];
4270
30.2k
  }
4271
4272
  bool apply (hb_ot_apply_context_t *c) const
4273
181k
  {
4274
181k
    TRACE_APPLY (this);
4275
181k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4276
4277
181k
    unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
4278
181k
    if (index == NOT_COVERED) return_trace (false);
4279
4280
129k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4281
129k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4282
129k
    struct ChainContextApplyLookupContext lookup_context = {
4283
129k
      {{match_coverage, match_coverage, match_coverage}},
4284
129k
      {this, this, this}
4285
129k
    };
4286
129k
    return_trace (chain_context_apply_lookup (c,
4287
181k
                backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
4288
181k
                input.len, (const HBUINT16 *) input.arrayZ + 1,
4289
181k
                lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
4290
181k
                lookup.len, lookup.arrayZ, lookup_context));
4291
181k
  }
4292
4293
  template<typename Iterator,
4294
     hb_requires (hb_is_iterator (Iterator))>
4295
  bool serialize_coverage_offsets (hb_subset_context_t *c, Iterator it, const void* base) const
4296
28.5k
  {
4297
28.5k
    TRACE_SERIALIZE (this);
4298
28.5k
    auto *out = c->serializer->start_embed<Array16OfOffset16To<Coverage>> ();
4299
4300
28.5k
    if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size)))
4301
596
      return_trace (false);
4302
4303
27.9k
    for (auto& offset : it) {
4304
23.2k
      auto *o = out->serialize_append (c->serializer);
4305
23.2k
      if (unlikely (!o) || !o->serialize_subset (c, offset, base))
4306
99
        return_trace (false);
4307
23.2k
    }
4308
4309
27.9k
    return_trace (true);
4310
27.9k
  }
Unexecuted instantiation: _ZNK2OT19ChainContextFormat326serialize_coverage_offsetsI10hb_array_tIKNS_8OffsetToINS_6Layout6Common8CoverageENS_7NumTypeILb1EtLj2EEEvLb1EEEETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSD_6item_tEEE5valueEvE4typeELPv0EEEbP19hb_subset_context_tSD_PKv
_ZNK2OT19ChainContextFormat326serialize_coverage_offsetsI10hb_array_tIKNS_8OffsetToINS_6Layout6Common8CoverageENS_7NumTypeILb1EtLj2EEEvLb1EEEETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSD_6item_tEEE5valueEvE4typeELPv0EEEbP19hb_subset_context_tSD_PKv
Line
Count
Source
4296
28.5k
  {
4297
28.5k
    TRACE_SERIALIZE (this);
4298
28.5k
    auto *out = c->serializer->start_embed<Array16OfOffset16To<Coverage>> ();
4299
4300
28.5k
    if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size)))
4301
596
      return_trace (false);
4302
4303
27.9k
    for (auto& offset : it) {
4304
23.2k
      auto *o = out->serialize_append (c->serializer);
4305
23.2k
      if (unlikely (!o) || !o->serialize_subset (c, offset, base))
4306
99
        return_trace (false);
4307
23.2k
    }
4308
4309
27.8k
    return_trace (true);
4310
27.9k
  }
4311
4312
  bool subset (hb_subset_context_t *c) const
4313
9.53k
  {
4314
9.53k
    TRACE_SUBSET (this);
4315
4316
9.53k
    if (unlikely (!c->serializer->embed (this->format))) return_trace (false);
4317
4318
9.53k
    if (!serialize_coverage_offsets (c, backtrack.iter (), this))
4319
26
      return_trace (false);
4320
4321
9.51k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4322
9.51k
    if (!serialize_coverage_offsets (c, input.iter (), this))
4323
25
      return_trace (false);
4324
4325
9.48k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4326
9.48k
    if (!serialize_coverage_offsets (c, lookahead.iter (), this))
4327
644
      return_trace (false);
4328
4329
8.84k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4330
8.84k
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4331
4332
8.84k
    HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookup.len);
4333
8.84k
    if (!lookupCount) return_trace (false);
4334
4335
8.67k
    unsigned count = serialize_lookuprecord_array (c->serializer, lookup.as_array (), lookup_map);
4336
8.67k
    return_trace (c->serializer->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
4337
8.84k
  }
4338
4339
  bool sanitize (hb_sanitize_context_t *c) const
4340
48.9k
  {
4341
48.9k
    TRACE_SANITIZE (this);
4342
48.9k
    if (unlikely (!backtrack.sanitize (c, this))) return_trace (false);
4343
48.8k
    hb_barrier ();
4344
48.8k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4345
48.8k
    if (unlikely (!input.sanitize (c, this))) return_trace (false);
4346
48.8k
    hb_barrier ();
4347
48.8k
    if (unlikely (!input.len)) return_trace (false); /* To be consistent with Context. */
4348
48.8k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4349
48.8k
    if (unlikely (!lookahead.sanitize (c, this))) return_trace (false);
4350
48.7k
    hb_barrier ();
4351
48.7k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4352
48.7k
    return_trace (likely (lookup.sanitize (c)));
4353
48.8k
  }
4354
4355
  protected:
4356
  HBUINT16  format;     /* Format identifier--format = 3 */
4357
  Array16OfOffset16To<Coverage>
4358
    backtrack;    /* Array of coverage tables
4359
           * in backtracking sequence, in  glyph
4360
           * sequence order */
4361
  Array16OfOffset16To<Coverage>
4362
    inputX    ; /* Array of coverage
4363
           * tables in input sequence, in glyph
4364
           * sequence order */
4365
  Array16OfOffset16To<Coverage>
4366
    lookaheadX;   /* Array of coverage tables
4367
           * in lookahead sequence, in glyph
4368
           * sequence order */
4369
  Array16Of<LookupRecord>
4370
    lookupX;    /* Array of LookupRecords--in
4371
           * design order) */
4372
  public:
4373
  DEFINE_SIZE_MIN (10);
4374
};
4375
4376
struct ChainContext
4377
{
4378
  template <typename context_t, typename ...Ts>
4379
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4380
525k
  {
4381
525k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
524k
    TRACE_DISPATCH (this, u.format.v);
4383
524k
    switch (u.format.v) {
4384
35.0k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
32.5k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
152k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
10.9k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
17.4k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
276k
    default:return_trace (c->default_return_value ());
4392
524k
    }
4393
524k
  }
hb_sanitize_context_t::return_t OT::ChainContext::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4380
193k
  {
4381
193k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
193k
    TRACE_DISPATCH (this, u.format.v);
4383
193k
    switch (u.format.v) {
4384
13.3k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
16.9k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
48.9k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
4.76k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
9.41k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
99.5k
    default:return_trace (c->default_return_value ());
4392
193k
    }
4393
193k
  }
Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::ChainContext::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
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
Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: hb_subset_context_t::return_t OT::ChainContext::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
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
OT::hb_accelerate_subtables_context_t::return_t OT::ChainContext::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Line
Count
Source
4380
52.9k
  {
4381
52.9k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
52.9k
    TRACE_DISPATCH (this, u.format.v);
4383
52.9k
    switch (u.format.v) {
4384
3.30k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
7.96k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
2.30k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
1.97k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
5.36k
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
32.0k
    default:return_trace (c->default_return_value ());
4392
52.9k
    }
4393
52.9k
  }
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
4380
581
  {
4381
581
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
581
    TRACE_DISPATCH (this, u.format.v);
4383
581
    switch (u.format.v) {
4384
58
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
13
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
337
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
173
    default:return_trace (c->default_return_value ());
4392
581
    }
4393
581
  }
OT::hb_closure_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Line
Count
Source
4380
95.9k
  {
4381
95.9k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
95.9k
    TRACE_DISPATCH (this, u.format.v);
4383
95.9k
    switch (u.format.v) {
4384
4.71k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
1.85k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
47.5k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
782
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
405
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
40.6k
    default:return_trace (c->default_return_value ());
4392
95.9k
    }
4393
95.9k
  }
OT::hb_would_apply_context_t::return_t OT::ChainContext::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Line
Count
Source
4380
22.5k
  {
4381
22.5k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
22.5k
    TRACE_DISPATCH (this, u.format.v);
4383
22.5k
    switch (u.format.v) {
4384
8.71k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
1.33k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
1.31k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
999
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
759
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
9.45k
    default:return_trace (c->default_return_value ());
4392
22.5k
    }
4393
22.5k
  }
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
OT::hb_intersects_context_t::return_t OT::ChainContext::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const
Line
Count
Source
4380
104k
  {
4381
104k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
104k
    TRACE_DISPATCH (this, u.format.v);
4383
104k
    switch (u.format.v) {
4384
3.22k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
2.99k
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
31.3k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
1.24k
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
859
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
64.5k
    default:return_trace (c->default_return_value ());
4392
104k
    }
4393
104k
  }
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
4380
44.2k
  {
4381
44.2k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
44.2k
    TRACE_DISPATCH (this, u.format.v);
4383
44.2k
    switch (u.format.v) {
4384
1.07k
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
954
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
11.3k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
650
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
390
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
29.7k
    default:return_trace (c->default_return_value ());
4392
44.2k
    }
4393
44.2k
  }
hb_subset_context_t::return_t OT::ChainContext::dispatch<hb_subset_context_t>(hb_subset_context_t*) const
Line
Count
Source
4380
11.4k
  {
4381
11.4k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
11.4k
    TRACE_DISPATCH (this, u.format.v);
4383
11.4k
    switch (u.format.v) {
4384
672
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
467
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
9.53k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
528
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
246
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
0
    default:return_trace (c->default_return_value ());
4392
11.4k
    }
4393
11.4k
  }
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
Line
Count
Source
4380
26
  {
4381
26
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4382
26
    TRACE_DISPATCH (this, u.format.v);
4383
26
    switch (u.format.v) {
4384
3
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4385
0
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4386
3
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4387
0
#ifndef HB_NO_BEYOND_64K
4388
0
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4389
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4390
0
#endif
4391
20
    default:return_trace (c->default_return_value ());
4392
26
    }
4393
26
  }
4394
4395
  protected:
4396
  union {
4397
  struct { HBUINT16 v; }    format; /* Format identifier */
4398
  ChainContextFormat1_4<SmallTypes> format1;
4399
  ChainContextFormat2_5<SmallTypes> format2;
4400
  ChainContextFormat3     format3;
4401
#ifndef HB_NO_BEYOND_64K
4402
  ChainContextFormat1_4<MediumTypes>  format4;
4403
  ChainContextFormat2_5<MediumTypes>  format5;
4404
#endif
4405
  } u;
4406
};
4407
4408
4409
template <typename T>
4410
struct ExtensionFormat1
4411
{
4412
74.7k
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
4412
55.4k
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
4412
19.3k
  unsigned int get_type () const { return extensionLookupType; }
4413
4414
  template <typename X>
4415
  const X& get_subtable () const
4416
49.7k
  { 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
4416
37.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
4416
12.5k
  { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }
4417
4418
  template <typename context_t, typename ...Ts>
4419
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4420
49.7k
  {
4421
49.7k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
49.7k
    TRACE_DISPATCH (this, format);
4423
49.7k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
49.7k
  }
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
4420
22.1k
  {
4421
22.1k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
22.1k
    TRACE_DISPATCH (this, format);
4423
22.1k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
22.1k
  }
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
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
4420
9.49k
  {
4421
9.49k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
9.48k
    TRACE_DISPATCH (this, format);
4423
9.48k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
9.49k
  }
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
Line
Count
Source
4420
1.14k
  {
4421
1.14k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
1.14k
    TRACE_DISPATCH (this, format);
4423
1.14k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
1.14k
  }
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
Line
Count
Source
4420
10
  {
4421
10
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
10
    TRACE_DISPATCH (this, format);
4423
10
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
10
  }
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
4420
4.55k
  {
4421
4.55k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
4.55k
    TRACE_DISPATCH (this, format);
4423
4.55k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
4.55k
  }
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
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
Line
Count
Source
4420
1.69k
  {
4421
1.69k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
1.69k
    TRACE_DISPATCH (this, format);
4423
1.69k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
1.69k
  }
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
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
4420
1.16k
  {
4421
1.16k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
1.16k
    TRACE_DISPATCH (this, format);
4423
1.16k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
1.16k
  }
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
4420
375
  {
4421
375
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
375
    TRACE_DISPATCH (this, format);
4423
375
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
375
  }
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
4420
358
  {
4421
358
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
358
    TRACE_DISPATCH (this, format);
4423
358
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
358
  }
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
4420
8.81k
  {
4421
8.81k
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
8.81k
    TRACE_DISPATCH (this, format);
4423
8.81k
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
8.81k
  }
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
4420
9
  {
4421
9
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
4422
9
    TRACE_DISPATCH (this, format);
4423
9
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
4424
9
  }
4425
4426
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
4427
  { dispatch (c); }
4428
4429
  /* This is called from may_dispatch() above with hb_sanitize_context_t. */
4430
  bool sanitize (hb_sanitize_context_t *c) const
4431
31.6k
  {
4432
31.6k
    TRACE_SANITIZE (this);
4433
31.6k
    return_trace (c->check_struct (this) &&
4434
31.6k
      hb_barrier () &&
4435
31.6k
      extensionLookupType != T::SubTable::Extension);
4436
31.6k
  }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4431
22.1k
  {
4432
22.1k
    TRACE_SANITIZE (this);
4433
22.1k
    return_trace (c->check_struct (this) &&
4434
22.1k
      hb_barrier () &&
4435
22.1k
      extensionLookupType != T::SubTable::Extension);
4436
22.1k
  }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4431
9.49k
  {
4432
9.49k
    TRACE_SANITIZE (this);
4433
9.49k
    return_trace (c->check_struct (this) &&
4434
9.49k
      hb_barrier () &&
4435
9.49k
      extensionLookupType != T::SubTable::Extension);
4436
9.49k
  }
4437
4438
  bool subset (hb_subset_context_t *c) const
4439
134
  {
4440
134
    TRACE_SUBSET (this);
4441
4442
134
    auto *out = c->serializer->start_embed (this);
4443
134
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4444
4445
134
    out->format = format;
4446
134
    out->extensionLookupType = extensionLookupType;
4447
4448
134
    const auto& src_offset =
4449
134
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4450
134
    auto& dest_offset =
4451
134
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4452
4453
134
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4454
134
  }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::subset(hb_subset_context_t*) const
Line
Count
Source
4439
126
  {
4440
126
    TRACE_SUBSET (this);
4441
4442
126
    auto *out = c->serializer->start_embed (this);
4443
126
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4444
4445
126
    out->format = format;
4446
126
    out->extensionLookupType = extensionLookupType;
4447
4448
126
    const auto& src_offset =
4449
126
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4450
126
    auto& dest_offset =
4451
126
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4452
4453
126
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4454
126
  }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::subset(hb_subset_context_t*) const
Line
Count
Source
4439
8
  {
4440
8
    TRACE_SUBSET (this);
4441
4442
8
    auto *out = c->serializer->start_embed (this);
4443
8
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4444
4445
8
    out->format = format;
4446
8
    out->extensionLookupType = extensionLookupType;
4447
4448
8
    const auto& src_offset =
4449
8
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
4450
8
    auto& dest_offset =
4451
8
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
4452
4453
8
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
4454
8
  }
4455
4456
  protected:
4457
  HBUINT16  format;     /* Format identifier. Set to 1. */
4458
  HBUINT16  extensionLookupType;  /* Lookup type of subtable referenced
4459
           * by ExtensionOffset (i.e. the
4460
           * extension subtable). */
4461
  Offset32  extensionOffset;  /* Offset to the extension subtable,
4462
           * of lookup type subtable. */
4463
  public:
4464
  DEFINE_SIZE_STATIC (8);
4465
};
4466
4467
template <typename T>
4468
struct Extension
4469
{
4470
  unsigned int get_type () const
4471
53.0k
  {
4472
53.0k
    switch (u.format.v) {
4473
24.9k
    case 1: hb_barrier (); return u.format1.get_type ();
4474
28.1k
    default:return 0;
4475
53.0k
    }
4476
53.0k
  }
OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
4471
30.7k
  {
4472
30.7k
    switch (u.format.v) {
4473
18.2k
    case 1: hb_barrier (); return u.format1.get_type ();
4474
12.5k
    default:return 0;
4475
30.7k
    }
4476
30.7k
  }
OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
4471
22.3k
  {
4472
22.3k
    switch (u.format.v) {
4473
6.70k
    case 1: hb_barrier (); return u.format1.get_type ();
4474
15.5k
    default:return 0;
4475
22.3k
    }
4476
22.3k
  }
4477
  template <typename X>
4478
  const X& get_subtable () const
4479
  {
4480
    switch (u.format.v) {
4481
    case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> ();
4482
    default:return Null (typename T::SubTable);
4483
    }
4484
  }
4485
4486
  // Specialization of dispatch for subset. dispatch() normally just
4487
  // dispatches to the sub table this points too, but for subset
4488
  // we need to run subset on this subtable too.
4489
  template <typename ...Ts>
4490
  typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const
4491
134
  {
4492
134
    switch (u.format.v) {
4493
134
    case 1: hb_barrier (); return u.format1.subset (c);
4494
0
    default: return c->default_return_value ();
4495
134
    }
4496
134
  }
bool OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<>(hb_subset_context_t*) const
Line
Count
Source
4491
126
  {
4492
126
    switch (u.format.v) {
4493
126
    case 1: hb_barrier (); return u.format1.subset (c);
4494
0
    default: return c->default_return_value ();
4495
126
    }
4496
126
  }
bool OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<>(hb_subset_context_t*) const
Line
Count
Source
4491
8
  {
4492
8
    switch (u.format.v) {
4493
8
    case 1: hb_barrier (); return u.format1.subset (c);
4494
0
    default: return c->default_return_value ();
4495
8
    }
4496
8
  }
4497
4498
  template <typename context_t, typename ...Ts>
4499
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4500
239k
  {
4501
239k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
239k
    TRACE_DISPATCH (this, u.format.v);
4503
239k
    switch (u.format.v) {
4504
49.7k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
189k
    default:return_trace (c->default_return_value ());
4506
239k
    }
4507
239k
  }
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
4500
112k
  {
4501
112k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
112k
    TRACE_DISPATCH (this, u.format.v);
4503
112k
    switch (u.format.v) {
4504
22.1k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
89.9k
    default:return_trace (c->default_return_value ());
4506
112k
    }
4507
112k
  }
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
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
4500
101k
  {
4501
101k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
101k
    TRACE_DISPATCH (this, u.format.v);
4503
101k
    switch (u.format.v) {
4504
9.49k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
92.3k
    default:return_trace (c->default_return_value ());
4506
101k
    }
4507
101k
  }
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
Line
Count
Source
4500
2.42k
  {
4501
2.42k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
2.42k
    TRACE_DISPATCH (this, u.format.v);
4503
2.42k
    switch (u.format.v) {
4504
1.14k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
1.28k
    default:return_trace (c->default_return_value ());
4506
2.42k
    }
4507
2.42k
  }
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
Line
Count
Source
4500
29
  {
4501
29
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
29
    TRACE_DISPATCH (this, u.format.v);
4503
29
    switch (u.format.v) {
4504
10
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
19
    default:return_trace (c->default_return_value ());
4506
29
    }
4507
29
  }
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
4500
4.98k
  {
4501
4.98k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
4.98k
    TRACE_DISPATCH (this, u.format.v);
4503
4.98k
    switch (u.format.v) {
4504
4.55k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
424
    default:return_trace (c->default_return_value ());
4506
4.98k
    }
4507
4.98k
  }
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
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
Line
Count
Source
4500
5.88k
  {
4501
5.88k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
5.88k
    TRACE_DISPATCH (this, u.format.v);
4503
5.88k
    switch (u.format.v) {
4504
1.69k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
4.18k
    default:return_trace (c->default_return_value ());
4506
5.88k
    }
4507
5.88k
  }
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
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
4500
1.94k
  {
4501
1.94k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
1.94k
    TRACE_DISPATCH (this, u.format.v);
4503
1.94k
    switch (u.format.v) {
4504
1.16k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
775
    default:return_trace (c->default_return_value ());
4506
1.94k
    }
4507
1.94k
  }
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
4500
375
  {
4501
375
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
375
    TRACE_DISPATCH (this, u.format.v);
4503
375
    switch (u.format.v) {
4504
375
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
0
    default:return_trace (c->default_return_value ());
4506
375
    }
4507
375
  }
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
4500
363
  {
4501
363
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
363
    TRACE_DISPATCH (this, u.format.v);
4503
363
    switch (u.format.v) {
4504
358
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
5
    default:return_trace (c->default_return_value ());
4506
363
    }
4507
363
  }
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
4500
9.16k
  {
4501
9.16k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
9.16k
    TRACE_DISPATCH (this, u.format.v);
4503
9.16k
    switch (u.format.v) {
4504
8.81k
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
354
    default:return_trace (c->default_return_value ());
4506
9.16k
    }
4507
9.16k
  }
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
4500
9
  {
4501
9
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4502
9
    TRACE_DISPATCH (this, u.format.v);
4503
9
    switch (u.format.v) {
4504
9
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
4505
0
    default:return_trace (c->default_return_value ());
4506
9
    }
4507
9
  }
4508
4509
  protected:
4510
  union {
4511
  struct { HBUINT16 v; }  format;   /* Format identifier */
4512
  ExtensionFormat1<T> format1;
4513
  } u;
4514
};
4515
4516
4517
/*
4518
 * GSUB/GPOS Common
4519
 */
4520
4521
struct hb_ot_layout_lookup_accelerator_t
4522
{
4523
  template <typename TLookup>
4524
  static hb_ot_layout_lookup_accelerator_t *create (const TLookup &lookup)
4525
67.2k
  {
4526
67.2k
    unsigned count = lookup.get_subtable_count ();
4527
4528
67.2k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
4529
67.2k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
4530
67.2k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
4531
4532
    /* The following is a calloc because when we are collecting subtables,
4533
     * some of them might be invalid and hence not collect; as a result,
4534
     * we might not fill in all the count entries of the subtables array.
4535
     * Zeroing it allows the set digest to gatekeep it without having to
4536
     * initialize it further. */
4537
67.2k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
4538
67.2k
    if (unlikely (!thiz))
4539
1.09k
      return nullptr;
4540
4541
66.1k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
4542
66.1k
    lookup.dispatch (&c_accelerate_subtables);
4543
4544
66.1k
    thiz->digest.init ();
4545
66.1k
    for (auto& subtable : hb_iter (thiz->subtables, count))
4546
1.33M
      thiz->digest.union_ (subtable.digest);
4547
4548
66.1k
    thiz->count = count;
4549
4550
66.1k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4551
66.1k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
4552
4553
1.40M
    for (unsigned i = 0; i < count; i++)
4554
1.33M
      if (i != thiz->subtable_cache_user_idx)
4555
1.33M
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
4556
66.1k
#endif
4557
4558
66.1k
    return thiz;
4559
67.2k
  }
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&)
Line
Count
Source
4525
19.4k
  {
4526
19.4k
    unsigned count = lookup.get_subtable_count ();
4527
4528
19.4k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
4529
19.4k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
4530
19.4k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
4531
4532
    /* The following is a calloc because when we are collecting subtables,
4533
     * some of them might be invalid and hence not collect; as a result,
4534
     * we might not fill in all the count entries of the subtables array.
4535
     * Zeroing it allows the set digest to gatekeep it without having to
4536
     * initialize it further. */
4537
19.4k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
4538
19.4k
    if (unlikely (!thiz))
4539
472
      return nullptr;
4540
4541
19.0k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
4542
19.0k
    lookup.dispatch (&c_accelerate_subtables);
4543
4544
19.0k
    thiz->digest.init ();
4545
19.0k
    for (auto& subtable : hb_iter (thiz->subtables, count))
4546
405k
      thiz->digest.union_ (subtable.digest);
4547
4548
19.0k
    thiz->count = count;
4549
4550
19.0k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4551
19.0k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
4552
4553
424k
    for (unsigned i = 0; i < count; i++)
4554
405k
      if (i != thiz->subtable_cache_user_idx)
4555
404k
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
4556
19.0k
#endif
4557
4558
19.0k
    return thiz;
4559
19.4k
  }
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&)
Line
Count
Source
4525
47.7k
  {
4526
47.7k
    unsigned count = lookup.get_subtable_count ();
4527
4528
47.7k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
4529
47.7k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
4530
47.7k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
4531
4532
    /* The following is a calloc because when we are collecting subtables,
4533
     * some of them might be invalid and hence not collect; as a result,
4534
     * we might not fill in all the count entries of the subtables array.
4535
     * Zeroing it allows the set digest to gatekeep it without having to
4536
     * initialize it further. */
4537
47.7k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
4538
47.7k
    if (unlikely (!thiz))
4539
620
      return nullptr;
4540
4541
47.1k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
4542
47.1k
    lookup.dispatch (&c_accelerate_subtables);
4543
4544
47.1k
    thiz->digest.init ();
4545
47.1k
    for (auto& subtable : hb_iter (thiz->subtables, count))
4546
931k
      thiz->digest.union_ (subtable.digest);
4547
4548
47.1k
    thiz->count = count;
4549
4550
47.1k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4551
47.1k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
4552
4553
978k
    for (unsigned i = 0; i < count; i++)
4554
931k
      if (i != thiz->subtable_cache_user_idx)
4555
929k
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
4556
47.1k
#endif
4557
4558
47.1k
    return thiz;
4559
47.7k
  }
4560
4561
  void fini ()
4562
66.1k
  {
4563
66.1k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4564
1.40M
    for (unsigned i = 0; i < count; i++)
4565
1.33M
      hb_free (subtables[i].external_cache);
4566
66.1k
#endif
4567
66.1k
  }
4568
4569
  bool may_have (hb_codepoint_t g) const
4570
1.19M
  { return digest.may_have (g); }
4571
4572
#ifndef HB_OPTIMIZE_SIZE
4573
  HB_ALWAYS_INLINE
4574
#endif
4575
  bool apply (hb_ot_apply_context_t *c, bool use_cache) const
4576
28.9M
  {
4577
28.9M
    c->lookup_accel = this;
4578
28.9M
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4579
28.9M
    if (use_cache)
4580
988k
    {
4581
988k
      return
4582
988k
      + hb_iter (hb_iter (subtables, count))
4583
7.19M
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply_cached (c); })
4584
988k
      | hb_any
4585
988k
      ;
4586
988k
    }
4587
27.9M
    else
4588
27.9M
#endif
4589
27.9M
    {
4590
27.9M
      return
4591
27.9M
      + hb_iter (hb_iter (subtables, count))
4592
138M
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply (c); })
4593
27.9M
      | hb_any
4594
27.9M
      ;
4595
27.9M
    }
4596
0
    return false;
4597
28.9M
  }
4598
4599
  bool cache_enter (hb_ot_apply_context_t *c) const
4600
67.4k
  {
4601
67.4k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4602
67.4k
    return subtable_cache_user_idx != (unsigned) -1 &&
4603
5.38k
     subtables[subtable_cache_user_idx].cache_enter (c);
4604
#else
4605
    return false;
4606
#endif
4607
67.4k
  }
4608
  void cache_leave (hb_ot_apply_context_t *c) const
4609
4.78k
  {
4610
4.78k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4611
4.78k
    subtables[subtable_cache_user_idx].cache_leave (c);
4612
4.78k
#endif
4613
4.78k
  }
4614
4615
4616
  hb_set_digest_t digest;
4617
  private:
4618
  unsigned count = 0; /* Number of subtables in the array. */
4619
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4620
  unsigned subtable_cache_user_idx = (unsigned) -1;
4621
#endif
4622
  hb_accelerate_subtables_context_t::hb_applicable_t subtables[HB_VAR_ARRAY];
4623
};
4624
4625
template <typename Types>
4626
struct GSUBGPOSVersion1_2
4627
{
4628
  friend struct GSUBGPOS;
4629
4630
  protected:
4631
  FixedVersion<>version;  /* Version of the GSUB/GPOS table--initially set
4632
         * to 0x00010000u */
4633
  typename Types:: template OffsetTo<ScriptList>
4634
    scriptList; /* ScriptList table */
4635
  typename Types::template OffsetTo<FeatureList>
4636
    featureList;  /* FeatureList table */
4637
  typename Types::template OffsetTo<LookupList<Types>>
4638
    lookupList; /* LookupList table */
4639
  Offset32To<FeatureVariations>
4640
    featureVars;  /* Offset to Feature Variations
4641
           table--from beginning of table
4642
         * (may be NULL).  Introduced
4643
         * in version 0x00010001. */
4644
  public:
4645
  DEFINE_SIZE_MIN (4 + 3 * Types::size);
4646
4647
  size_t get_size () const
4648
4.67k
  {
4649
4.67k
    return min_size +
4650
4.67k
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0);
4651
4.67k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::get_size() const
Line
Count
Source
4648
4.66k
  {
4649
4.66k
    return min_size +
4650
4.66k
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0);
4651
4.66k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::get_size() const
Line
Count
Source
4648
8
  {
4649
8
    return min_size +
4650
8
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0);
4651
8
  }
4652
4653
  const typename Types::template OffsetTo<LookupList<Types>>* get_lookup_list_offset () const
4654
9.33k
  {
4655
9.33k
    return &lookupList;
4656
9.33k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::get_lookup_list_offset() const
Line
Count
Source
4654
9.31k
  {
4655
9.31k
    return &lookupList;
4656
9.31k
  }
OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::get_lookup_list_offset() const
Line
Count
Source
4654
16
  {
4655
16
    return &lookupList;
4656
16
  }
4657
4658
  template <typename TLookup>
4659
  bool sanitize (hb_sanitize_context_t *c) const
4660
56.3k
  {
4661
56.3k
    TRACE_SANITIZE (this);
4662
56.3k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4663
56.3k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4664
56.3k
        featureList.sanitize (c, this) &&
4665
56.3k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4666
14.4k
      return_trace (false);
4667
4668
41.8k
#ifndef HB_NO_VAR
4669
41.8k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4670
1.21k
      return_trace (false);
4671
40.6k
#endif
4672
4673
41.8k
    return_trace (true);
4674
41.8k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4660
33.0k
  {
4661
33.0k
    TRACE_SANITIZE (this);
4662
33.0k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4663
33.0k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4664
33.0k
        featureList.sanitize (c, this) &&
4665
33.0k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4666
7.55k
      return_trace (false);
4667
4668
25.4k
#ifndef HB_NO_VAR
4669
25.4k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4670
573
      return_trace (false);
4671
24.9k
#endif
4672
4673
24.9k
    return_trace (true);
4674
25.4k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4660
669
  {
4661
669
    TRACE_SANITIZE (this);
4662
669
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4663
669
    if (unlikely (!(scriptList.sanitize (c, this) &&
4664
669
        featureList.sanitize (c, this) &&
4665
669
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4666
355
      return_trace (false);
4667
4668
314
#ifndef HB_NO_VAR
4669
314
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4670
69
      return_trace (false);
4671
245
#endif
4672
4673
245
    return_trace (true);
4674
314
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4660
21.8k
  {
4661
21.8k
    TRACE_SANITIZE (this);
4662
21.8k
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4663
21.8k
    if (unlikely (!(scriptList.sanitize (c, this) &&
4664
21.8k
        featureList.sanitize (c, this) &&
4665
21.8k
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4666
6.18k
      return_trace (false);
4667
4668
15.6k
#ifndef HB_NO_VAR
4669
15.6k
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4670
462
      return_trace (false);
4671
15.2k
#endif
4672
4673
15.2k
    return_trace (true);
4674
15.6k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4660
745
  {
4661
745
    TRACE_SANITIZE (this);
4662
745
    typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList;
4663
745
    if (unlikely (!(scriptList.sanitize (c, this) &&
4664
745
        featureList.sanitize (c, this) &&
4665
745
        reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
4666
356
      return_trace (false);
4667
4668
389
#ifndef HB_NO_VAR
4669
389
    if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this))))
4670
108
      return_trace (false);
4671
281
#endif
4672
4673
281
    return_trace (true);
4674
389
  }
4675
4676
  template <typename TLookup>
4677
  bool subset (hb_subset_layout_context_t *c) const
4678
20.2k
  {
4679
20.2k
    TRACE_SUBSET (this);
4680
4681
20.2k
    auto *out = c->subset_context->serializer->start_embed (this);
4682
20.2k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4683
4684
20.2k
    out->version = version;
4685
4686
20.2k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4687
20.2k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4688
20.2k
  .serialize_subset (c->subset_context,
4689
20.2k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4690
20.2k
         this,
4691
20.2k
         c);
4692
4693
20.2k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4694
20.2k
  .serialize_subset (c->subset_context,
4695
20.2k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4696
20.2k
         this,
4697
20.2k
         c);
4698
4699
20.2k
    out->scriptList.serialize_subset (c->subset_context,
4700
20.2k
              scriptList,
4701
20.2k
              this,
4702
20.2k
              c);
4703
4704
20.2k
#ifndef HB_NO_VAR
4705
20.2k
    if (version.to_int () >= 0x00010001u)
4706
499
    {
4707
499
      auto snapshot = c->subset_context->serializer->snapshot ();
4708
499
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4709
42
        return_trace (false);
4710
4711
      // if all axes are pinned all feature vars are dropped.
4712
457
      bool ret = !c->subset_context->plan->all_axes_pinned
4713
451
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4714
457
      if (!ret && version.major == 1)
4715
171
      {
4716
171
        c->subset_context->serializer->revert (snapshot);
4717
171
  out->version.major = 1;
4718
171
  out->version.minor = 0;
4719
171
      }
4720
457
    }
4721
20.2k
#endif
4722
4723
20.2k
    return_trace (true);
4724
20.2k
  }
Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4678
7.84k
  {
4679
7.84k
    TRACE_SUBSET (this);
4680
4681
7.84k
    auto *out = c->subset_context->serializer->start_embed (this);
4682
7.84k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4683
4684
7.84k
    out->version = version;
4685
4686
7.84k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4687
7.84k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4688
7.84k
  .serialize_subset (c->subset_context,
4689
7.84k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4690
7.84k
         this,
4691
7.84k
         c);
4692
4693
7.84k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4694
7.84k
  .serialize_subset (c->subset_context,
4695
7.84k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4696
7.84k
         this,
4697
7.84k
         c);
4698
4699
7.84k
    out->scriptList.serialize_subset (c->subset_context,
4700
7.84k
              scriptList,
4701
7.84k
              this,
4702
7.84k
              c);
4703
4704
7.84k
#ifndef HB_NO_VAR
4705
7.84k
    if (version.to_int () >= 0x00010001u)
4706
25
    {
4707
25
      auto snapshot = c->subset_context->serializer->snapshot ();
4708
25
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4709
1
        return_trace (false);
4710
4711
      // if all axes are pinned all feature vars are dropped.
4712
24
      bool ret = !c->subset_context->plan->all_axes_pinned
4713
22
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4714
24
      if (!ret && version.major == 1)
4715
24
      {
4716
24
        c->subset_context->serializer->revert (snapshot);
4717
24
  out->version.major = 1;
4718
24
  out->version.minor = 0;
4719
24
      }
4720
24
    }
4721
7.84k
#endif
4722
4723
7.84k
    return_trace (true);
4724
7.84k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4678
93
  {
4679
93
    TRACE_SUBSET (this);
4680
4681
93
    auto *out = c->subset_context->serializer->start_embed (this);
4682
93
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4683
4684
93
    out->version = version;
4685
4686
93
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4687
93
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4688
93
  .serialize_subset (c->subset_context,
4689
93
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4690
93
         this,
4691
93
         c);
4692
4693
93
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4694
93
  .serialize_subset (c->subset_context,
4695
93
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4696
93
         this,
4697
93
         c);
4698
4699
93
    out->scriptList.serialize_subset (c->subset_context,
4700
93
              scriptList,
4701
93
              this,
4702
93
              c);
4703
4704
93
#ifndef HB_NO_VAR
4705
93
    if (version.to_int () >= 0x00010001u)
4706
93
    {
4707
93
      auto snapshot = c->subset_context->serializer->snapshot ();
4708
93
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4709
2
        return_trace (false);
4710
4711
      // if all axes are pinned all feature vars are dropped.
4712
91
      bool ret = !c->subset_context->plan->all_axes_pinned
4713
88
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4714
91
      if (!ret && version.major == 1)
4715
0
      {
4716
0
        c->subset_context->serializer->revert (snapshot);
4717
0
  out->version.major = 1;
4718
0
  out->version.minor = 0;
4719
0
      }
4720
91
    }
4721
91
#endif
4722
4723
91
    return_trace (true);
4724
93
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4678
12.2k
  {
4679
12.2k
    TRACE_SUBSET (this);
4680
4681
12.2k
    auto *out = c->subset_context->serializer->start_embed (this);
4682
12.2k
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4683
4684
12.2k
    out->version = version;
4685
4686
12.2k
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4687
12.2k
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4688
12.2k
  .serialize_subset (c->subset_context,
4689
12.2k
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4690
12.2k
         this,
4691
12.2k
         c);
4692
4693
12.2k
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4694
12.2k
  .serialize_subset (c->subset_context,
4695
12.2k
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4696
12.2k
         this,
4697
12.2k
         c);
4698
4699
12.2k
    out->scriptList.serialize_subset (c->subset_context,
4700
12.2k
              scriptList,
4701
12.2k
              this,
4702
12.2k
              c);
4703
4704
12.2k
#ifndef HB_NO_VAR
4705
12.2k
    if (version.to_int () >= 0x00010001u)
4706
310
    {
4707
310
      auto snapshot = c->subset_context->serializer->snapshot ();
4708
310
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4709
35
        return_trace (false);
4710
4711
      // if all axes are pinned all feature vars are dropped.
4712
275
      bool ret = !c->subset_context->plan->all_axes_pinned
4713
274
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4714
275
      if (!ret && version.major == 1)
4715
147
      {
4716
147
        c->subset_context->serializer->revert (snapshot);
4717
147
  out->version.major = 1;
4718
147
  out->version.minor = 0;
4719
147
      }
4720
275
    }
4721
12.2k
#endif
4722
4723
12.2k
    return_trace (true);
4724
12.2k
  }
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4678
71
  {
4679
71
    TRACE_SUBSET (this);
4680
4681
71
    auto *out = c->subset_context->serializer->start_embed (this);
4682
71
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
4683
4684
71
    out->version = version;
4685
4686
71
    typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
4687
71
    reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
4688
71
  .serialize_subset (c->subset_context,
4689
71
         reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
4690
71
         this,
4691
71
         c);
4692
4693
71
    reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
4694
71
  .serialize_subset (c->subset_context,
4695
71
         reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
4696
71
         this,
4697
71
         c);
4698
4699
71
    out->scriptList.serialize_subset (c->subset_context,
4700
71
              scriptList,
4701
71
              this,
4702
71
              c);
4703
4704
71
#ifndef HB_NO_VAR
4705
71
    if (version.to_int () >= 0x00010001u)
4706
71
    {
4707
71
      auto snapshot = c->subset_context->serializer->snapshot ();
4708
71
      if (!c->subset_context->serializer->extend_min (&out->featureVars))
4709
4
        return_trace (false);
4710
4711
      // if all axes are pinned all feature vars are dropped.
4712
67
      bool ret = !c->subset_context->plan->all_axes_pinned
4713
67
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
4714
67
      if (!ret && version.major == 1)
4715
0
      {
4716
0
        c->subset_context->serializer->revert (snapshot);
4717
0
  out->version.major = 1;
4718
0
  out->version.minor = 0;
4719
0
      }
4720
67
    }
4721
67
#endif
4722
4723
67
    return_trace (true);
4724
71
  }
4725
};
4726
4727
struct GSUBGPOS
4728
{
4729
  size_t get_size () const
4730
5.09k
  {
4731
5.09k
    switch (u.version.major) {
4732
4.66k
    case 1: hb_barrier (); return u.version1.get_size ();
4733
0
#ifndef HB_NO_BEYOND_64K
4734
8
    case 2: hb_barrier (); return u.version2.get_size ();
4735
0
#endif
4736
424
    default: return u.version.static_size;
4737
5.09k
    }
4738
5.09k
  }
4739
4740
  template <typename TLookup>
4741
  bool sanitize (hb_sanitize_context_t *c) const
4742
65.0k
  {
4743
65.0k
    TRACE_SANITIZE (this);
4744
65.0k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4745
65.0k
    hb_barrier ();
4746
65.0k
    switch (u.version.major) {
4747
54.8k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4748
0
#ifndef HB_NO_BEYOND_64K
4749
1.41k
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4750
0
#endif
4751
8.71k
    default: return_trace (true);
4752
65.0k
    }
4753
65.0k
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4742
36.0k
  {
4743
36.0k
    TRACE_SANITIZE (this);
4744
36.0k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4745
36.0k
    hb_barrier ();
4746
36.0k
    switch (u.version.major) {
4747
33.0k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4748
0
#ifndef HB_NO_BEYOND_64K
4749
669
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4750
0
#endif
4751
2.34k
    default: return_trace (true);
4752
36.0k
    }
4753
36.0k
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
4742
29.0k
  {
4743
29.0k
    TRACE_SANITIZE (this);
4744
29.0k
    if (unlikely (!u.version.sanitize (c))) return_trace (false);
4745
28.9k
    hb_barrier ();
4746
28.9k
    switch (u.version.major) {
4747
21.8k
    case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
4748
0
#ifndef HB_NO_BEYOND_64K
4749
745
    case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
4750
0
#endif
4751
6.37k
    default: return_trace (true);
4752
28.9k
    }
4753
28.9k
  }
4754
4755
  template <typename TLookup>
4756
  bool subset (hb_subset_layout_context_t *c) const
4757
24.1k
  {
4758
24.1k
    switch (u.version.major) {
4759
20.0k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4760
0
#ifndef HB_NO_BEYOND_64K
4761
164
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4762
0
#endif
4763
3.88k
    default: return false;
4764
24.1k
    }
4765
24.1k
  }
bool OT::GSUBGPOS::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4757
11.1k
  {
4758
11.1k
    switch (u.version.major) {
4759
7.84k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4760
0
#ifndef HB_NO_BEYOND_64K
4761
93
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4762
0
#endif
4763
3.21k
    default: return false;
4764
11.1k
    }
4765
11.1k
  }
bool OT::GSUBGPOS::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
Line
Count
Source
4757
12.9k
  {
4758
12.9k
    switch (u.version.major) {
4759
12.2k
    case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
4760
0
#ifndef HB_NO_BEYOND_64K
4761
71
    case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
4762
0
#endif
4763
668
    default: return false;
4764
12.9k
    }
4765
12.9k
  }
4766
4767
  const ScriptList &get_script_list () const
4768
2.62M
  {
4769
2.62M
    switch (u.version.major) {
4770
1.58M
    case 1: hb_barrier (); return this+u.version1.scriptList;
4771
0
#ifndef HB_NO_BEYOND_64K
4772
98.6k
    case 2: hb_barrier (); return this+u.version2.scriptList;
4773
0
#endif
4774
942k
    default: return Null (ScriptList);
4775
2.62M
    }
4776
2.62M
  }
4777
  const FeatureList &get_feature_list () const
4778
2.64M
  {
4779
2.64M
    switch (u.version.major) {
4780
2.26M
    case 1: hb_barrier (); return this+u.version1.featureList;
4781
0
#ifndef HB_NO_BEYOND_64K
4782
12.6k
    case 2: hb_barrier (); return this+u.version2.featureList;
4783
0
#endif
4784
373k
    default: return Null (FeatureList);
4785
2.64M
    }
4786
2.64M
  }
4787
  unsigned int get_lookup_count () const
4788
267k
  {
4789
267k
    switch (u.version.major) {
4790
67.9k
    case 1: hb_barrier (); return (this+u.version1.lookupList).len;
4791
0
#ifndef HB_NO_BEYOND_64K
4792
1.03k
    case 2: hb_barrier (); return (this+u.version2.lookupList).len;
4793
0
#endif
4794
198k
    default: return 0;
4795
267k
    }
4796
267k
  }
4797
  const Lookup& get_lookup (unsigned int i) const
4798
20.4M
  {
4799
20.4M
    switch (u.version.major) {
4800
18.2M
    case 1: hb_barrier (); return (this+u.version1.lookupList)[i];
4801
0
#ifndef HB_NO_BEYOND_64K
4802
2.14M
    case 2: hb_barrier (); return (this+u.version2.lookupList)[i];
4803
0
#endif
4804
0
    default: return Null (Lookup);
4805
20.4M
    }
4806
20.4M
  }
4807
  const FeatureVariations &get_feature_variations () const
4808
478k
  {
4809
478k
    switch (u.version.major) {
4810
85.8k
    case 1: hb_barrier (); return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations));
4811
0
#ifndef HB_NO_BEYOND_64K
4812
1.33k
    case 2: hb_barrier (); return this+u.version2.featureVars;
4813
0
#endif
4814
390k
    default: return Null (FeatureVariations);
4815
478k
    }
4816
478k
  }
4817
4818
183k
  bool has_data () const { return u.version.to_int (); }
4819
  unsigned int get_script_count () const
4820
224k
  { return get_script_list ().len; }
4821
  const Tag& get_script_tag (unsigned int i) const
4822
497k
  { return get_script_list ().get_tag (i); }
4823
  unsigned int get_script_tags (unsigned int start_offset,
4824
        unsigned int *script_count /* IN/OUT */,
4825
        hb_tag_t     *script_tags /* OUT */) const
4826
74.8k
  { return get_script_list ().get_tags (start_offset, script_count, script_tags); }
4827
  const Script& get_script (unsigned int i) const
4828
1.40M
  { return get_script_list ()[i]; }
4829
  bool find_script_index (hb_tag_t tag, unsigned int *index) const
4830
427k
  { return get_script_list ().find_index (tag, index); }
4831
4832
  unsigned int get_feature_count () const
4833
263k
  { return get_feature_list ().len; }
4834
  hb_tag_t get_feature_tag (unsigned int i) const
4835
1.49M
  { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : get_feature_list ().get_tag (i); }
4836
  unsigned int get_feature_tags (unsigned int start_offset,
4837
         unsigned int *feature_count /* IN/OUT */,
4838
         hb_tag_t     *feature_tags /* OUT */) const
4839
74.8k
  { return get_feature_list ().get_tags (start_offset, feature_count, feature_tags); }
4840
  const Feature& get_feature (unsigned int i) const
4841
1.00M
  { return get_feature_list ()[i]; }
4842
  bool find_feature_index (hb_tag_t tag, unsigned int *index) const
4843
0
  { return get_feature_list ().find_index (tag, index); }
4844
4845
  bool find_variations_index (const int *coords, unsigned int num_coords,
4846
            unsigned int *index,
4847
            ItemVarStoreInstancer *instancer) const
4848
324k
  {
4849
#ifdef HB_NO_VAR
4850
    *index = FeatureVariations::NOT_FOUND_INDEX;
4851
    return false;
4852
#endif
4853
324k
    return get_feature_variations ().find_index (coords, num_coords, index, instancer);
4854
324k
  }
4855
  const Feature& get_feature_variation (unsigned int feature_index,
4856
          unsigned int variations_index) const
4857
236k
  {
4858
236k
#ifndef HB_NO_VAR
4859
236k
    if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
4860
762
  u.version.to_int () >= 0x00010001u)
4861
762
    {
4862
762
      const Feature *feature = get_feature_variations ().find_substitute (variations_index,
4863
762
                    feature_index);
4864
762
      if (feature)
4865
585
  return *feature;
4866
762
    }
4867
235k
#endif
4868
235k
    return get_feature (feature_index);
4869
236k
  }
4870
4871
  void feature_variation_collect_lookups (const hb_set_t *feature_indexes,
4872
            const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map,
4873
            hb_set_t       *lookup_indexes /* OUT */) const
4874
72.9k
  {
4875
72.9k
#ifndef HB_NO_VAR
4876
72.9k
    get_feature_variations ().collect_lookups (feature_indexes, feature_record_cond_idx_map, lookup_indexes);
4877
72.9k
#endif
4878
72.9k
  }
4879
4880
#ifndef HB_NO_VAR
4881
  void collect_feature_substitutes_with_variations (hb_collect_feature_substitutes_with_var_context_t *c) const
4882
4.69k
  { get_feature_variations ().collect_feature_substitutes_with_variations (c); }
4883
#endif
4884
4885
  template <typename TLookup>
4886
  void closure_lookups (hb_face_t      *face,
4887
      const hb_set_t *glyphs,
4888
      hb_set_t       *lookup_indexes /* IN/OUT */) const
4889
75.1k
  {
4890
75.1k
    hb_set_t visited_lookups, inactive_lookups;
4891
75.1k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4892
4893
75.1k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4894
4895
75.1k
    for (unsigned lookup_index : *lookup_indexes)
4896
1.81M
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4897
4898
75.1k
    hb_set_union (lookup_indexes, &visited_lookups);
4899
75.1k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4900
75.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
4889
37.5k
  {
4890
37.5k
    hb_set_t visited_lookups, inactive_lookups;
4891
37.5k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4892
4893
37.5k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4894
4895
37.5k
    for (unsigned lookup_index : *lookup_indexes)
4896
504k
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4897
4898
37.5k
    hb_set_union (lookup_indexes, &visited_lookups);
4899
37.5k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4900
37.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
4889
37.5k
  {
4890
37.5k
    hb_set_t visited_lookups, inactive_lookups;
4891
37.5k
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
4892
4893
37.5k
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
4894
4895
37.5k
    for (unsigned lookup_index : *lookup_indexes)
4896
1.31M
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
4897
4898
37.5k
    hb_set_union (lookup_indexes, &visited_lookups);
4899
37.5k
    hb_set_subtract (lookup_indexes, &inactive_lookups);
4900
37.5k
  }
4901
4902
  void prune_langsys (const hb_map_t *duplicate_feature_map,
4903
                      const hb_set_t *layout_scripts,
4904
                      hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map,
4905
                      hb_set_t       *new_feature_indexes /* OUT */) const
4906
75.1k
  {
4907
75.1k
    hb_prune_langsys_context_t c (this, script_langsys_map, duplicate_feature_map, new_feature_indexes);
4908
4909
75.1k
    unsigned count = get_script_count ();
4910
573k
    for (unsigned script_index = 0; script_index < count; script_index++)
4911
497k
    {
4912
497k
      const Tag& tag = get_script_tag (script_index);
4913
497k
      if (!layout_scripts->has (tag)) continue;
4914
497k
      const Script& s = get_script (script_index);
4915
497k
      s.prune_langsys (&c, script_index);
4916
497k
    }
4917
75.1k
  }
4918
4919
  void prune_features (const hb_map_t *lookup_indices, /* IN */
4920
           const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map, /* IN */
4921
           const hb_hashmap_t<unsigned, const Feature*> *feature_substitutes_map, /* IN */
4922
           hb_set_t       *feature_indices /* IN/OUT */) const
4923
75.1k
  {
4924
75.1k
#ifndef HB_NO_VAR
4925
    // This is the set of feature indices which have alternate versions defined
4926
    // if the FeatureVariation's table and the alternate version(s) intersect the
4927
    // set of lookup indices.
4928
75.1k
    hb_set_t alternate_feature_indices;
4929
75.1k
    get_feature_variations ().closure_features (lookup_indices, feature_record_cond_idx_map, &alternate_feature_indices);
4930
75.1k
    if (unlikely (alternate_feature_indices.in_error()))
4931
3
    {
4932
3
      feature_indices->err ();
4933
3
      return;
4934
3
    }
4935
75.1k
#endif
4936
4937
75.1k
    for (unsigned i : hb_iter (feature_indices))
4938
332k
    {
4939
332k
      hb_tag_t tag =  get_feature_tag (i);
4940
332k
      if (tag == HB_TAG ('p', 'r', 'e', 'f'))
4941
        // Note: Never ever drop feature 'pref', even if it's empty.
4942
        // HarfBuzz chooses shaper for Khmer based on presence of this
4943
        // feature. See thread at:
4944
  // http://lists.freedesktop.org/archives/harfbuzz/2012-November/002660.html
4945
40
        continue;
4946
4947
4948
332k
      const Feature *f = &(get_feature (i));
4949
332k
      const Feature** p = nullptr;
4950
332k
      if (feature_substitutes_map->has (i, &p))
4951
0
        f = *p;
4952
4953
332k
      if (!f->featureParams.is_null () &&
4954
6.95k
          tag == HB_TAG ('s', 'i', 'z', 'e'))
4955
0
        continue;
4956
4957
332k
      if (!f->intersects_lookup_indexes (lookup_indices)
4958
310k
#ifndef HB_NO_VAR
4959
310k
          && !alternate_feature_indices.has (i)
4960
332k
#endif
4961
332k
    )
4962
310k
  feature_indices->del (i);
4963
332k
    }
4964
75.1k
  }
4965
4966
  void collect_name_ids (const hb_map_t *feature_index_map,
4967
                         hb_set_t *nameids_to_retain /* OUT */) const
4968
75.1k
  {
4969
75.1k
    unsigned count = get_feature_count ();
4970
168k
    for (unsigned i = 0 ; i < count; i++)
4971
93.3k
    {
4972
93.3k
      if (!feature_index_map->has (i)) continue;
4973
19.5k
      hb_tag_t tag = get_feature_tag (i);
4974
19.5k
      get_feature (i).collect_name_ids (tag, nameids_to_retain);
4975
19.5k
    }
4976
75.1k
  }
4977
4978
  template <typename T>
4979
  struct accelerator_t
4980
  {
4981
    accelerator_t (hb_face_t *face)
4982
114k
    {
4983
114k
      hb_sanitize_context_t sc;
4984
114k
      sc.lazy_some_gpos = true;
4985
114k
      this->table = sc.reference_table<T> (face);
4986
4987
114k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4988
0
      {
4989
0
  hb_blob_destroy (this->table.get_blob ());
4990
0
  this->table = hb_blob_get_empty ();
4991
0
      }
4992
4993
114k
      this->lookup_count = table->get_lookup_count ();
4994
4995
114k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4996
114k
      if (unlikely (!this->accels))
4997
1.18k
      {
4998
1.18k
  this->lookup_count = 0;
4999
1.18k
  this->table.destroy ();
5000
1.18k
  this->table = hb_blob_get_empty ();
5001
1.18k
      }
5002
114k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::accelerator_t(hb_face_t*)
Line
Count
Source
4982
57.2k
    {
4983
57.2k
      hb_sanitize_context_t sc;
4984
57.2k
      sc.lazy_some_gpos = true;
4985
57.2k
      this->table = sc.reference_table<T> (face);
4986
4987
57.2k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4988
0
      {
4989
0
  hb_blob_destroy (this->table.get_blob ());
4990
0
  this->table = hb_blob_get_empty ();
4991
0
      }
4992
4993
57.2k
      this->lookup_count = table->get_lookup_count ();
4994
4995
57.2k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4996
57.2k
      if (unlikely (!this->accels))
4997
616
      {
4998
616
  this->lookup_count = 0;
4999
616
  this->table.destroy ();
5000
616
  this->table = hb_blob_get_empty ();
5001
616
      }
5002
57.2k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::accelerator_t(hb_face_t*)
Line
Count
Source
4982
56.8k
    {
4983
56.8k
      hb_sanitize_context_t sc;
4984
56.8k
      sc.lazy_some_gpos = true;
4985
56.8k
      this->table = sc.reference_table<T> (face);
4986
4987
56.8k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
4988
0
      {
4989
0
  hb_blob_destroy (this->table.get_blob ());
4990
0
  this->table = hb_blob_get_empty ();
4991
0
      }
4992
4993
56.8k
      this->lookup_count = table->get_lookup_count ();
4994
4995
56.8k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
4996
56.8k
      if (unlikely (!this->accels))
4997
572
      {
4998
572
  this->lookup_count = 0;
4999
572
  this->table.destroy ();
5000
572
  this->table = hb_blob_get_empty ();
5001
572
      }
5002
56.8k
    }
5003
    ~accelerator_t ()
5004
114k
    {
5005
290k
      for (unsigned int i = 0; i < this->lookup_count; i++)
5006
176k
      {
5007
176k
  auto *accel = this->accels[i].get_relaxed ();
5008
176k
  if (accel)
5009
64.6k
    accel->fini ();
5010
176k
  hb_free (accel);
5011
176k
      }
5012
114k
      hb_free (this->accels);
5013
114k
      this->table.destroy ();
5014
114k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::~accelerator_t()
Line
Count
Source
5004
57.2k
    {
5005
182k
      for (unsigned int i = 0; i < this->lookup_count; i++)
5006
124k
      {
5007
124k
  auto *accel = this->accels[i].get_relaxed ();
5008
124k
  if (accel)
5009
45.5k
    accel->fini ();
5010
124k
  hb_free (accel);
5011
124k
      }
5012
57.2k
      hb_free (this->accels);
5013
57.2k
      this->table.destroy ();
5014
57.2k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::~accelerator_t()
Line
Count
Source
5004
56.8k
    {
5005
108k
      for (unsigned int i = 0; i < this->lookup_count; i++)
5006
51.8k
      {
5007
51.8k
  auto *accel = this->accels[i].get_relaxed ();
5008
51.8k
  if (accel)
5009
19.0k
    accel->fini ();
5010
51.8k
  hb_free (accel);
5011
51.8k
      }
5012
56.8k
      hb_free (this->accels);
5013
56.8k
      this->table.destroy ();
5014
56.8k
    }
5015
5016
107k
    hb_blob_t *get_blob () const { return table.get_blob (); }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_blob() const
Line
Count
Source
5016
96.6k
    hb_blob_t *get_blob () const { return table.get_blob (); }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_blob() const
Line
Count
Source
5016
10.9k
    hb_blob_t *get_blob () const { return table.get_blob (); }
5017
5018
    hb_ot_layout_lookup_accelerator_t *get_accel (unsigned lookup_index) const
5019
12.4M
    {
5020
12.4M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
5021
5022
8.29M
    retry:
5023
8.29M
      auto *accel = accels[lookup_index].get_acquire ();
5024
8.29M
      if (unlikely (!accel))
5025
65.6k
      {
5026
65.6k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
5027
65.6k
  if (unlikely (!accel))
5028
1.06k
    return nullptr;
5029
5030
64.6k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
5031
0
  {
5032
0
    accel->fini ();
5033
0
    hb_free (accel);
5034
0
    goto retry;
5035
0
  }
5036
64.6k
      }
5037
5038
8.29M
      return accel;
5039
8.29M
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_accel(unsigned int) const
Line
Count
Source
5019
5.64M
    {
5020
5.64M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
5021
5022
3.48M
    retry:
5023
3.48M
      auto *accel = accels[lookup_index].get_acquire ();
5024
3.48M
      if (unlikely (!accel))
5025
19.4k
      {
5026
19.4k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
5027
19.4k
  if (unlikely (!accel))
5028
472
    return nullptr;
5029
5030
19.0k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
5031
0
  {
5032
0
    accel->fini ();
5033
0
    hb_free (accel);
5034
0
    goto retry;
5035
0
  }
5036
19.0k
      }
5037
5038
3.48M
      return accel;
5039
3.48M
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_accel(unsigned int) const
Line
Count
Source
5019
6.78M
    {
5020
6.78M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
5021
5022
4.81M
    retry:
5023
4.81M
      auto *accel = accels[lookup_index].get_acquire ();
5024
4.81M
      if (unlikely (!accel))
5025
46.1k
      {
5026
46.1k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
5027
46.1k
  if (unlikely (!accel))
5028
592
    return nullptr;
5029
5030
45.5k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
5031
0
  {
5032
0
    accel->fini ();
5033
0
    hb_free (accel);
5034
0
    goto retry;
5035
0
  }
5036
45.5k
      }
5037
5038
4.81M
      return accel;
5039
4.81M
    }
5040
5041
    hb_blob_ptr_t<T> table;
5042
    unsigned int lookup_count;
5043
    hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *accels;
5044
  };
5045
5046
  protected:
5047
  union {
5048
  FixedVersion<>      version;  /* Version identifier */
5049
  GSUBGPOSVersion1_2<SmallTypes>  version1;
5050
#ifndef HB_NO_BEYOND_64K
5051
  GSUBGPOSVersion1_2<MediumTypes> version2;
5052
#endif
5053
  } u;
5054
  public:
5055
  DEFINE_SIZE_MIN (4);
5056
};
5057
5058
5059
} /* namespace OT */
5060
5061
5062
#endif /* HB_OT_LAYOUT_GSUBGPOS_HH */