Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/workdir/UnpackedTarball/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
#include "hb-depend-data.hh"
40
41
42
namespace OT {
43
44
45
struct hb_intersects_context_t :
46
       hb_dispatch_context_t<hb_intersects_context_t, bool>
47
{
48
  template <typename T>
49
0
  return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
50
0
  static return_t default_return_value () { return false; }
51
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
52
53
  const hb_set_t *glyphs;
54
55
  hb_intersects_context_t (const hb_set_t *glyphs_) :
56
0
                            glyphs (glyphs_) {}
57
};
58
59
struct hb_have_non_1to1_context_t :
60
       hb_dispatch_context_t<hb_have_non_1to1_context_t, bool>
61
{
62
  template <typename T>
63
0
  return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
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&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
64
0
  static return_t default_return_value () { return false; }
65
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
66
};
67
68
struct hb_closure_context_t :
69
       hb_dispatch_context_t<hb_closure_context_t>
70
{
71
  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);
72
  template <typename T>
73
0
  return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::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_closure_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_closure_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_closure_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_closure_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_closure_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_closure_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_closure_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_closure_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_closure_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_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
74
0
  static return_t default_return_value () { return hb_empty_t (); }
75
  void recurse (unsigned lookup_index, hb_set_t *covered_seq_indicies, unsigned seq_index, unsigned end_index)
76
0
  {
77
0
    if (unlikely (nesting_level_left == 0 || !recurse_func))
78
0
      return;
79
80
0
    nesting_level_left--;
81
0
    recurse_func (this, lookup_index, covered_seq_indicies, seq_index, end_index);
82
0
    nesting_level_left++;
83
0
  }
84
85
  void reset_lookup_visit_count ()
86
0
  { lookup_count = 0; }
87
88
  bool lookup_limit_exceeded ()
89
0
  { return lookup_count > HB_MAX_LOOKUP_VISIT_COUNT; }
90
91
  bool should_visit_lookup (unsigned int lookup_index)
92
0
  {
93
0
    if (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT)
94
0
      return false;
95
96
0
    if (is_lookup_done (lookup_index))
97
0
      return false;
98
99
0
    return true;
100
0
  }
101
102
  bool is_lookup_done (unsigned int lookup_index)
103
0
  {
104
0
    if (unlikely (done_lookups_glyph_count->in_error () ||
105
0
      done_lookups_glyph_set->in_error ()))
106
0
      return true;
107
108
    /* Have we visited this lookup with the current set of glyphs? */
109
0
    unsigned pop = glyphs->get_population ();
110
0
    if (unlikely (pop == HB_MAP_VALUE_INVALID)) // Avoid sentinel interference.
111
0
      pop--;
112
0
    if (done_lookups_glyph_count->get (lookup_index) != pop)
113
0
    {
114
0
      done_lookups_glyph_count->set (lookup_index, pop);
115
116
0
      if (!done_lookups_glyph_set->has (lookup_index))
117
0
      {
118
0
  if (unlikely (!done_lookups_glyph_set->set (lookup_index, hb::unique_ptr<hb_set_t> {hb_set_create ()})))
119
0
    return true;
120
0
      }
121
122
0
      done_lookups_glyph_set->get (lookup_index)->clear ();
123
0
    }
124
125
0
    hb_set_t *covered_glyph_set = done_lookups_glyph_set->get (lookup_index);
126
0
    if (unlikely (covered_glyph_set->in_error ()))
127
0
      return true;
128
0
    if (parent_active_glyphs ().is_subset (*covered_glyph_set))
129
0
      return true;
130
131
0
    covered_glyph_set->union_ (parent_active_glyphs ());
132
0
    return false;
133
0
  }
134
135
0
  const hb_set_t& previous_parent_active_glyphs () {
136
0
    if (active_glyphs_stack.length <= 1)
137
0
      return *glyphs;
138
139
0
    return active_glyphs_stack[active_glyphs_stack.length - 2];
140
0
  }
141
142
  const hb_set_t& parent_active_glyphs ()
143
0
  {
144
0
    if (!active_glyphs_stack)
145
0
      return *glyphs;
146
147
0
    return active_glyphs_stack.tail ();
148
0
  }
149
150
  hb_set_t* push_cur_active_glyphs ()
151
0
  {
152
0
    hb_set_t *s = active_glyphs_stack.push ();
153
0
    if (unlikely (active_glyphs_stack.in_error ()))
154
0
      return nullptr;
155
0
    return s;
156
0
  }
157
158
  bool pop_cur_done_glyphs ()
159
0
  {
160
0
    if (!active_glyphs_stack)
161
0
      return false;
162
163
0
    active_glyphs_stack.pop ();
164
0
    return true;
165
0
  }
166
167
  hb_face_t *face;
168
  hb_set_t *glyphs;
169
  hb_set_t output[1];
170
  hb_vector_t<hb_set_t> active_glyphs_stack;
171
  recurse_func_t recurse_func = nullptr;
172
  unsigned int nesting_level_left;
173
174
  hb_closure_context_t (hb_face_t *face_,
175
      hb_set_t *glyphs_,
176
      hb_map_t *done_lookups_glyph_count_,
177
      hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set_,
178
      unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
179
0
        face (face_),
180
0
        glyphs (glyphs_),
181
0
        nesting_level_left (nesting_level_left_),
182
0
        done_lookups_glyph_count (done_lookups_glyph_count_),
183
0
        done_lookups_glyph_set (done_lookups_glyph_set_)
184
0
  {}
185
186
0
  ~hb_closure_context_t () { flush (); }
187
188
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
189
190
  void flush ()
191
0
  {
192
0
    output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID);  /* Remove invalid glyphs. */
193
0
    glyphs->union_ (*output);
194
0
    output->clear ();
195
0
    active_glyphs_stack.pop ();
196
0
    active_glyphs_stack.reset ();
197
0
  }
198
199
  private:
200
  hb_map_t *done_lookups_glyph_count;
201
  hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set;
202
  unsigned int lookup_count = 0;
203
};
204
205
206
207
struct hb_closure_lookups_context_t :
208
       hb_dispatch_context_t<hb_closure_lookups_context_t>
209
{
210
  typedef return_t (*recurse_func_t) (hb_closure_lookups_context_t *c, unsigned lookup_index);
211
  template <typename T>
212
0
  return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: 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&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
213
0
  static return_t default_return_value () { return hb_empty_t (); }
214
  void recurse (unsigned lookup_index)
215
0
  {
216
0
    if (unlikely (nesting_level_left == 0 || !recurse_func))
217
0
      return;
218
219
    /* Return if new lookup was recursed to before. */
220
0
    if (lookup_limit_exceeded ()
221
0
        || visited_lookups->in_error ()
222
0
        || visited_lookups->has (lookup_index))
223
      // Don't increment lookup count here, that will be done in the call to closure_lookups()
224
      // made by recurse_func.
225
0
      return;
226
227
0
    nesting_level_left--;
228
0
    recurse_func (this, lookup_index);
229
0
    nesting_level_left++;
230
0
  }
231
232
  void set_lookup_visited (unsigned lookup_index)
233
0
  { visited_lookups->add (lookup_index); }
234
235
  void set_lookup_inactive (unsigned lookup_index)
236
0
  { inactive_lookups->add (lookup_index); }
237
238
  bool lookup_limit_exceeded ()
239
0
  {
240
0
    bool ret = lookup_count > HB_MAX_LOOKUP_VISIT_COUNT;
241
0
    if (ret)
242
0
      DEBUG_MSG (SUBSET, nullptr, "lookup visit count limit exceeded in lookup closure!");
243
0
    return ret; }
244
245
  bool is_lookup_visited (unsigned lookup_index)
246
0
  {
247
0
    if (unlikely (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT))
248
0
    {
249
0
      DEBUG_MSG (SUBSET, nullptr, "total visited lookup count %u exceeds max limit, lookup %u is dropped.",
250
0
                 lookup_count, lookup_index);
251
0
      return true;
252
0
    }
253
254
0
    if (unlikely (visited_lookups->in_error ()))
255
0
      return true;
256
257
0
    return visited_lookups->has (lookup_index);
258
0
  }
259
260
  hb_face_t *face;
261
  const hb_set_t *glyphs;
262
  recurse_func_t recurse_func;
263
  unsigned int nesting_level_left;
264
265
  hb_closure_lookups_context_t (hb_face_t *face_,
266
        const hb_set_t *glyphs_,
267
        hb_set_t *visited_lookups_,
268
        hb_set_t *inactive_lookups_,
269
        unsigned nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
270
0
        face (face_),
271
0
        glyphs (glyphs_),
272
0
        recurse_func (nullptr),
273
0
        nesting_level_left (nesting_level_left_),
274
0
        visited_lookups (visited_lookups_),
275
0
        inactive_lookups (inactive_lookups_),
276
0
        lookup_count (0) {}
277
278
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
279
280
  private:
281
  hb_set_t *visited_lookups;
282
  hb_set_t *inactive_lookups;
283
  unsigned int lookup_count;
284
};
285
286
struct hb_would_apply_context_t :
287
       hb_dispatch_context_t<hb_would_apply_context_t, bool>
288
{
289
  template <typename T>
290
0
  return_t dispatch (const T &obj) { return obj.would_apply (this); }
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
291
0
  static return_t default_return_value () { return false; }
292
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
293
294
  hb_face_t *face;
295
  const hb_codepoint_t *glyphs;
296
  unsigned int len;
297
  bool zero_context;
298
299
  hb_would_apply_context_t (hb_face_t *face_,
300
          const hb_codepoint_t *glyphs_,
301
          unsigned int len_,
302
          bool zero_context_) :
303
0
            face (face_),
304
0
            glyphs (glyphs_),
305
0
            len (len_),
306
0
            zero_context (zero_context_) {}
307
};
308
309
struct hb_collect_glyphs_context_t :
310
       hb_dispatch_context_t<hb_collect_glyphs_context_t>
311
{
312
  typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index);
313
  template <typename T>
314
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_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> 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_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> 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_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> 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::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<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::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> 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_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
315
0
  static return_t default_return_value () { return hb_empty_t (); }
316
  void recurse (unsigned int lookup_index)
317
0
  {
318
0
    if (unlikely (nesting_level_left == 0 || !recurse_func))
319
0
      return;
320
321
    /* Note that GPOS sets recurse_func to nullptr already, so it doesn't get
322
     * past the previous check.  For GSUB, we only want to collect the output
323
     * glyphs in the recursion.  If output is not requested, we can go home now.
324
     *
325
     * Note further, that the above is not exactly correct.  A recursed lookup
326
     * is allowed to match input that is not matched in the context, but that's
327
     * not how most fonts are built.  It's possible to relax that and recurse
328
     * with all sets here if it proves to be an issue.
329
     */
330
331
0
    if (output == hb_set_get_empty ())
332
0
      return;
333
334
    /* Return if new lookup was recursed to before. */
335
0
    if (recursed_lookups->has (lookup_index))
336
0
      return;
337
338
0
    hb_set_t *old_before = before;
339
0
    hb_set_t *old_input  = input;
340
0
    hb_set_t *old_after  = after;
341
0
    before = input = after = hb_set_get_empty ();
342
343
0
    nesting_level_left--;
344
0
    recurse_func (this, lookup_index);
345
0
    nesting_level_left++;
346
347
0
    before = old_before;
348
0
    input  = old_input;
349
0
    after  = old_after;
350
351
0
    recursed_lookups->add (lookup_index);
352
0
  }
353
354
  hb_face_t *face;
355
  hb_set_t *before;
356
  hb_set_t *input;
357
  hb_set_t *after;
358
  hb_set_t *output;
359
  recurse_func_t recurse_func;
360
  hb_set_t *recursed_lookups;
361
  unsigned int nesting_level_left;
362
363
  hb_collect_glyphs_context_t (hb_face_t *face_,
364
             hb_set_t  *glyphs_before, /* OUT.  May be NULL */
365
             hb_set_t  *glyphs_input,  /* OUT.  May be NULL */
366
             hb_set_t  *glyphs_after,  /* OUT.  May be NULL */
367
             hb_set_t  *glyphs_output, /* OUT.  May be NULL */
368
             unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
369
0
            face (face_),
370
0
            before (glyphs_before ? glyphs_before : hb_set_get_empty ()),
371
0
            input  (glyphs_input  ? glyphs_input  : hb_set_get_empty ()),
372
0
            after  (glyphs_after  ? glyphs_after  : hb_set_get_empty ()),
373
0
            output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
374
0
            recurse_func (nullptr),
375
0
            recursed_lookups (hb_set_create ()),
376
0
            nesting_level_left (nesting_level_left_) {}
377
0
  ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); }
378
379
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
380
};
381
382
struct hb_depend_context_t :
383
       hb_dispatch_context_t<hb_depend_context_t>
384
{
385
  enum glyph_set_type_t
386
  {
387
    GLYPH_SET_CLASS,
388
    GLYPH_SET_COVERAGE,
389
    GLYPH_SET_SINGLE
390
  };
391
392
  static constexpr hb_codepoint_t SINGLE_GLYPH_ACTIVE_FLAG = 0x80000000u;
393
394
  struct glyph_set_cache_key_t
395
  {
396
    glyph_set_cache_key_t () = default;
397
    glyph_set_cache_key_t (const void *data_, unsigned value_, glyph_set_type_t type_)
398
0
      : data (data_), value (value_), type (type_) {}
399
400
    bool operator == (const glyph_set_cache_key_t &o) const
401
0
    { return data == o.data && value == o.value && type == o.type; }
402
403
    uint32_t hash () const
404
0
    {
405
0
      uint32_t current = hb_hash ((uintptr_t) data);
406
0
      current = current * 31 + hb_hash (value);
407
0
      return current * 31 + hb_hash ((unsigned) type);
408
0
    }
409
410
    const void *data = nullptr;
411
    unsigned value = 0;
412
    glyph_set_type_t type = GLYPH_SET_CLASS;
413
  };
414
415
  struct context_set_cache_key_t
416
  {
417
    context_set_cache_key_t () = default;
418
    context_set_cache_key_t (const void *rule_,
419
           const void *record_,
420
           const void *data_,
421
           hb_codepoint_t active_glyphs_,
422
           unsigned value_,
423
           unsigned format_)
424
      : rule (rule_), record (record_), data (data_), active_glyphs (active_glyphs_),
425
0
  value (value_), format (format_) {}
426
427
    bool operator == (const context_set_cache_key_t &o) const
428
0
    {
429
0
      return rule == o.rule &&
430
0
       record == o.record &&
431
0
       data == o.data &&
432
0
       active_glyphs == o.active_glyphs &&
433
0
       value == o.value &&
434
0
       format == o.format;
435
0
    }
436
437
    uint32_t hash () const
438
0
    {
439
0
      uint32_t current = hb_hash ((uintptr_t) rule);
440
0
      current = current * 31 + hb_hash ((uintptr_t) record);
441
0
      current = current * 31 + hb_hash ((uintptr_t) data);
442
0
      current = current * 31 + hb_hash (active_glyphs);
443
0
      current = current * 31 + hb_hash (value);
444
0
      return current * 31 + hb_hash (format);
445
0
    }
446
447
    const void *rule = nullptr;
448
    const void *record = nullptr;
449
    const void *data = nullptr;
450
    hb_codepoint_t active_glyphs = HB_CODEPOINT_INVALID;
451
    unsigned value = 0;
452
    unsigned format = 0;
453
  };
454
455
  struct recurse_key_t
456
  {
457
    recurse_key_t () = default;
458
    recurse_key_t (unsigned lookup_index_,
459
                   hb_codepoint_t active_glyphs_,
460
                   hb_codepoint_t recurse_path_,
461
                   hb_codepoint_t context_set_)
462
      : lookup_index (lookup_index_),
463
        active_glyphs (active_glyphs_),
464
        recurse_path (recurse_path_),
465
0
        context_set (context_set_) {}
466
467
    bool operator == (const recurse_key_t &o) const
468
0
    {
469
0
      return lookup_index == o.lookup_index &&
470
0
             active_glyphs == o.active_glyphs &&
471
0
             recurse_path == o.recurse_path &&
472
0
             context_set == o.context_set;
473
0
    }
474
475
    uint32_t hash () const
476
0
    {
477
0
      uint32_t current = 0x84222325;
478
0
      current = (current ^ hb_hash (lookup_index)) * 16777619;
479
0
      current = (current ^ hb_hash (active_glyphs)) * 16777619;
480
0
      current = (current ^ hb_hash (recurse_path)) * 16777619;
481
0
      current = (current ^ hb_hash (context_set)) * 16777619;
482
0
      return current;
483
0
    }
484
485
    unsigned lookup_index = 0;
486
    hb_codepoint_t active_glyphs = 0;
487
    hb_codepoint_t recurse_path = 0;
488
    hb_codepoint_t context_set = HB_CODEPOINT_INVALID;
489
  };
490
491
  typedef return_t (*recurse_func_t) (hb_depend_context_t *c, unsigned lookup_index, hb_bit_page_t *covered_seq_indices, unsigned seq_index, unsigned end_index);
492
  /* return_t is hb_empty_t — dispatch is purely for side-effects, like hb_closure_context_t. */
493
  template <typename T>
494
0
  return_t dispatch (const T &obj) { obj.depend (this); return hb_empty_t (); }
Unexecuted instantiation: hb_empty_t OT::hb_depend_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_depend_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_depend_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_depend_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_depend_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_depend_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_depend_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_depend_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_depend_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_depend_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_depend_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_depend_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
495
0
  static return_t default_return_value () { return hb_empty_t (); }
496
497
  void recurse (unsigned lookup_idx, hb_bit_page_t *covered_seq_indices, unsigned seq_index, unsigned end_index)
498
0
  {
499
0
    /* Cycle detection using call-stack semantics: block re-entry of a
500
0
     * lookup that is currently on the execution stack, but allow it again
501
0
     * once it has returned.
502
0
     *
503
0
     * A flat "visited" set would be wrong: the same lookup legitimately
504
0
     * appears more than once when a rule iterates over multiple sequence
505
0
     * positions — each such call is independent and must be processed.
506
0
     *
507
0
     * Cutting an in-progress cycle is safe because the active glyph set
508
0
     * can only stay the same or shrink as we recurse.  If we re-encounter
509
0
     * lookup L while it is still on the stack, L is already executing
510
0
     * with a context at least as broad, so any edges a re-entry would add
511
0
     * are a subset of what L is already in the process of registering.
512
0
     *
513
0
     * lookups_seen is pre-seeded with the top-level lookup index in
514
0
     * GSUB_accelerator_t::depend before the direct depend() call, so
515
0
     * that indirect cycles of the form A→B→A are also caught here. */
516
0
    if (lookups_seen.has (lookup_idx)) return;
517
0
    lookups_seen.add (lookup_idx);
518
0
519
0
    /* Intern the ordered recursion path instead of copying and interning the
520
0
     * lookups_seen set.  Path identity is more specific than set identity but
521
0
     * never merges states with different cycle-detection behavior. */
522
0
    hb_codepoint_t parent_path = recurse_path;
523
0
    uint64_t path_key = (uint64_t) parent_path << 32 | lookup_idx;
524
0
    hb_codepoint_t *path = nullptr;
525
0
    hb_codepoint_t path_index;
526
0
    if (!recurse_path_to_index.has (path_key, &path))
527
0
    {
528
0
      path_index = recurse_path_to_index.get_population () + 1;
529
0
      if (unlikely (!recurse_path_to_index.set (path_key, path_index)))
530
0
      {
531
0
  depend_data->fail ();
532
0
  lookups_seen.del (lookup_idx);
533
0
  return;
534
0
      }
535
0
    }
536
0
    else
537
0
      path_index = *path;
538
0
    recurse_path = path_index;
539
0
    recurse_func (this, lookup_idx, covered_seq_indices, seq_index, end_index);
540
0
    recurse_path = parent_path;
541
0
    lookups_seen.del (lookup_idx);
542
0
  }
543
544
  struct active_glyphs_frame_t
545
  {
546
    hb_set_t glyphs;
547
    hb_codepoint_t active_idx = HB_CODEPOINT_INVALID;
548
    bool use_root = false;
549
  };
550
551
  const hb_set_t& parent_active_glyphs ()
552
0
  {
553
0
    if (!active_glyphs_stack_depth)
554
0
      return *glyphs;
555
0
556
0
    const active_glyphs_frame_t &frame = active_glyphs_stack[active_glyphs_stack_depth - 1];
557
0
    return frame.use_root ? *glyphs : frame.glyphs;
558
0
  }
559
560
  hb_set_t* push_cur_active_glyphs (hb_codepoint_t active_idx = HB_CODEPOINT_INVALID)
561
0
  {
562
0
    if (active_glyphs_stack_depth == active_glyphs_stack.length &&
563
0
  unlikely (!active_glyphs_stack.push_or_fail ()))
564
0
      return nullptr;
565
0
566
0
    active_glyphs_frame_t &frame = active_glyphs_stack[active_glyphs_stack_depth++];
567
0
    frame.glyphs.clear ();
568
0
    frame.active_idx = active_idx;
569
0
    frame.use_root = false;
570
0
    return &frame.glyphs;
571
0
  }
572
573
  bool push_root_active_glyphs ()
574
0
  {
575
0
    if (active_glyphs_stack_depth == active_glyphs_stack.length &&
576
0
  unlikely (!active_glyphs_stack.push_or_fail ()))
577
0
      return false;
578
0
579
0
    active_glyphs_stack[active_glyphs_stack_depth++].use_root = true;
580
0
    return true;
581
0
  }
582
583
  bool pop_cur_done_glyphs ()
584
0
  {
585
0
    if (!active_glyphs_stack_depth)
586
0
      return false;
587
0
588
0
    active_glyphs_stack_depth--;
589
0
    return true;
590
0
  }
591
592
  bool get_parent_active_glyphs_index (hb_codepoint_t *active_idx)
593
0
  {
594
0
    if (!active_glyphs_stack_depth ||
595
0
  active_glyphs_stack[active_glyphs_stack_depth - 1].use_root)
596
0
    {
597
0
      *active_idx = HB_CODEPOINT_INVALID;
598
0
      return true;
599
0
    }
600
0
601
0
    active_glyphs_frame_t &frame = active_glyphs_stack[active_glyphs_stack_depth - 1];
602
0
    *active_idx = frame.active_idx;
603
0
    if (*active_idx != HB_CODEPOINT_INVALID)
604
0
      return true;
605
0
606
0
    hb_codepoint_t glyph;
607
0
    if (frame.glyphs.get_singleton (&glyph) &&
608
0
  likely (glyph < SINGLE_GLYPH_ACTIVE_FLAG))
609
0
      *active_idx = glyph | SINGLE_GLYPH_ACTIVE_FLAG;
610
0
    else if (!find_or_create_recurse_set (frame.glyphs, active_idx))
611
0
      return false;
612
0
613
0
    frame.active_idx = *active_idx;
614
0
    return true;
615
0
  }
616
617
  bool get_context_set_cache_key (const void *rule,
618
          const void *record,
619
          const void *data,
620
          unsigned value,
621
          unsigned format,
622
          context_set_cache_key_t *key)
623
0
  {
624
0
    hb_codepoint_t active_idx;
625
0
    if (!get_parent_active_glyphs_index (&active_idx))
626
0
      return false;
627
0
    *key = context_set_cache_key_t (rule, record, data, active_idx, value, format);
628
0
    return true;
629
0
  }
630
631
  bool get_recurse_key (unsigned lookup_idx, recurse_key_t *key)
632
0
  {
633
0
    /* The active glyphs and in-progress lookup set are part of the state.
634
0
     * Omitting the latter would make memoization incorrect for cyclic lookup
635
0
     * graphs whose available recursive paths depend on their ancestry.
636
0
     * Edge flags are not part of the state: they affect neither traversal nor
637
0
     * edge identity, so revisiting with different flags can only find edges
638
0
     * that the deduplication table already contains. */
639
0
    hb_codepoint_t active_idx;
640
0
    if (!get_parent_active_glyphs_index (&active_idx))
641
0
      return false;
642
0
643
0
    *key = recurse_key_t (lookup_idx,
644
0
                          active_idx,
645
0
                          recurse_path,
646
0
                          depend_data->current_context_set_index);
647
0
    return !completed_recursions.has (*key);
648
0
  }
649
650
  void finish_recurse (const recurse_key_t &key)
651
0
  { depend_data->check_success (completed_recursions.set (key, true)); }
652
653
  void reset_recurse_cache ()
654
0
  {
655
0
    completed_recursions.clear ();
656
0
    recurse_path_to_index.clear ();
657
0
    recurse_path = 0;
658
0
  }
659
660
  bool find_or_create_recurse_set (const hb_set_t &set, hb_codepoint_t *index)
661
0
  {
662
0
    hb_codepoint_t *existing = nullptr;
663
0
    if (recurse_set_to_index.has (&set, &existing))
664
0
    {
665
0
      *index = *existing;
666
0
      return true;
667
0
    }
668
0
669
0
    hb_set_t *copy = hb_object_create<hb_set_t> ();
670
0
    if (unlikely (!copy))
671
0
      return depend_data->fail ();
672
0
    copy->set (set);
673
0
    if (unlikely (copy->in_error ()))
674
0
    {
675
0
      hb_set_destroy (copy);
676
0
      return depend_data->fail ();
677
0
    }
678
0
679
0
    *index = recurse_sets.length;
680
0
    if (unlikely (*index & SINGLE_GLYPH_ACTIVE_FLAG))
681
0
    {
682
0
      hb_set_destroy (copy);
683
0
      return depend_data->fail ();
684
0
    }
685
0
    if (unlikely (!recurse_sets.push_or_fail (hb::unique_ptr<hb_set_t> {copy})))
686
0
      return depend_data->fail ();
687
0
    if (unlikely (!recurse_set_to_index.set (recurse_sets[*index].get (), *index)))
688
0
      return depend_data->fail ();
689
0
    return true;
690
0
  }
691
692
  const hb_set_t *find_or_create_glyph_set (const void *data,
693
                                             unsigned value,
694
                                             glyph_set_type_t type);
695
  hb_codepoint_t find_or_create_cached_context_set (const hb_set_t *set);
696
697
  struct depend_scratch_t
698
  {
699
    void clear ()
700
0
    {
701
0
      preliminary_context.clear ();
702
0
      position_scratch.clear ();
703
0
      pos_glyphs.clear ();
704
0
      position_context.clear ();
705
0
      disjunctive_indices.clear ();
706
0
      filtered_disjunctive_indices.clear ();
707
0
      backtrack_sets.clear ();
708
0
      lookahead_sets.clear ();
709
0
      input_position_glyphs.clear ();
710
0
      cached_context_sets.clear ();
711
0
      compact_workspace.clear ();
712
0
    }
713
714
    hb_set_t preliminary_context;
715
    hb_set_t position_scratch;
716
    hb_set_t pos_glyphs;
717
    hb_set_t position_context;
718
    hb_set_t disjunctive_indices;
719
    hb_set_t filtered_disjunctive_indices;
720
    hb_vector_t<const hb_set_t *> backtrack_sets;
721
    hb_vector_t<const hb_set_t *> lookahead_sets;
722
    hb_vector_t<const hb_set_t *> input_position_glyphs;
723
    hb_vector_t<hb_codepoint_t> cached_context_sets;
724
    hb_vector_t<unsigned> compact_workspace;
725
    depend_scratch_t *next = nullptr;
726
  };
727
728
  depend_scratch_t *acquire_depend_scratch ()
729
0
  {
730
0
    depend_scratch_t *scratch = depend_scratch_pool;
731
0
    if (scratch)
732
0
      depend_scratch_pool = scratch->next;
733
0
    else
734
0
    {
735
0
      scratch = (depend_scratch_t *) hb_malloc (sizeof (depend_scratch_t));
736
0
      if (unlikely (!scratch))
737
0
      {
738
0
        depend_data->fail ();
739
0
        return nullptr;
740
0
      }
741
0
      new (scratch) depend_scratch_t ();
742
0
    }
743
0
744
0
    scratch->next = nullptr;
745
0
    scratch->clear ();
746
0
    return scratch;
747
0
  }
748
749
  void release_depend_scratch (depend_scratch_t *scratch)
750
0
  {
751
0
    scratch->next = depend_scratch_pool;
752
0
    depend_scratch_pool = scratch;
753
0
  }
754
755
  hb_depend_data_builder_t *depend_data;
756
  hb_face_t *face;
757
  hb_set_t *glyphs;
758
  hb_vector_t<active_glyphs_frame_t> active_glyphs_stack;
759
  unsigned active_glyphs_stack_depth = 0;
760
  recurse_func_t recurse_func;
761
  hb_codepoint_t lookup_index = HB_CODEPOINT_INVALID;
762
  hb_bit_set_t lookups_seen;
763
  hb_vector_t<hb::unique_ptr<hb_set_t>> recurse_sets;
764
  hb_hashmap_t<const hb_set_t *, hb_codepoint_t> recurse_set_to_index;
765
  hb_hashmap_t<uint64_t, hb_codepoint_t> recurse_path_to_index;
766
  hb_codepoint_t recurse_path = 0;
767
  hb_hashmap_t<recurse_key_t, bool> completed_recursions;
768
  hb_vector_t<hb::unique_ptr<hb_set_t>> glyph_sets;
769
  hb_hashmap_t<glyph_set_cache_key_t, hb_codepoint_t> glyph_set_to_index;
770
  hb_hashmap_t<uintptr_t, hb_codepoint_t> cached_context_set_indices;
771
  hb_hashmap_t<context_set_cache_key_t, hb_codepoint_t> context_set_cache;
772
  depend_scratch_t *depend_scratch_pool = nullptr;
773
774
  hb_depend_context_t (hb_depend_data_builder_t *depend_data_,
775
                       hb_face_t *face_,
776
                       hb_set_t *glyphs_)
777
                      : depend_data (depend_data_),
778
                        face(face_),
779
                        glyphs (glyphs_),
780
0
                        recurse_func (nullptr) {}
781
  ~hb_depend_context_t ()
782
0
  {
783
0
    while (depend_scratch_pool)
784
0
    {
785
0
      depend_scratch_t *scratch = depend_scratch_pool;
786
0
      depend_scratch_pool = scratch->next;
787
0
      scratch->~depend_scratch_t ();
788
0
      hb_free (scratch);
789
0
    }
790
0
  }
791
0
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
792
};
793
794
template <typename set_t>
795
struct hb_collect_coverage_context_t :
796
       hb_dispatch_context_t<hb_collect_coverage_context_t<set_t>, const Coverage &>
797
{
798
  typedef const Coverage &return_t; // Stoopid that we have to dupe this here.
799
  template <typename T>
800
  return_t dispatch (const T &obj) { return obj.get_coverage (); }
801
  static return_t default_return_value () { return Null (Coverage); }
802
  bool stop_sublookup_iteration (return_t r) const
803
  {
804
    r.collect_coverage (set);
805
    return false;
806
  }
807
808
  hb_collect_coverage_context_t (set_t *set_) :
809
           set (set_) {}
810
811
  set_t *set;
812
};
813
814
struct matcher_t
815
{
816
  typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data);
817
818
  template <typename context_t>
819
  void init (const context_t *c, bool context_match = false)
820
117M
  {
821
117M
    set_match_func (nullptr, nullptr);
822
117M
    lookup_props = c->lookup_props;
823
    /* Ignore ZWNJ if we are matching GPOS, or matching GSUB context and asked to. */
824
117M
    ignore_zwnj = c->table_index == 1 || (context_match && c->auto_zwnj);
825
    /* Ignore ZWJ if we are matching context, or asked to. */
826
117M
    ignore_zwj = context_match || c->auto_zwj;
827
    /* Ignore hidden glyphs (like CGJ) during GPOS. */
828
117M
    ignore_hidden = c->table_index == 1;
829
117M
    mask = context_match ? -1 : c->lookup_mask;
830
    /* Per syllable matching is only for GSUB. */
831
117M
    per_syllable = c->table_index == 0 && c->per_syllable;
832
117M
    syllable = 0;
833
117M
  }
834
835
  void set_match_func (match_func_t match_func_,
836
           const void *match_data_)
837
120M
  { match_func = match_func_; match_data = match_data_; }
838
839
  enum may_match_t {
840
    MATCH_NO,
841
    MATCH_YES,
842
    MATCH_MAYBE
843
  };
844
845
#ifndef HB_OPTIMIZE_SIZE
846
  HB_ALWAYS_INLINE
847
#endif
848
  may_match_t may_match (hb_glyph_info_t &info,
849
       hb_codepoint_t glyph_data) const
850
27.0M
  {
851
27.0M
    if (!(info.mask & mask) ||
852
27.0M
  (per_syllable && syllable && syllable != info.syllable ()))
853
0
      return MATCH_NO;
854
855
27.0M
    if (match_func)
856
6.00M
      return match_func (info, glyph_data, match_data) ? MATCH_YES : MATCH_NO;
857
858
20.9M
    return MATCH_MAYBE;
859
27.0M
  }
860
861
  enum may_skip_t {
862
    SKIP_NO,
863
    SKIP_YES,
864
    SKIP_MAYBE
865
  };
866
867
  template <typename context_t>
868
#ifndef HB_OPTIMIZE_SIZE
869
  HB_ALWAYS_INLINE
870
#endif
871
  may_skip_t may_skip (const context_t *c,
872
           const hb_glyph_info_t &info) const
873
27.6M
  {
874
27.6M
    if (!c->check_glyph_property (&info, lookup_props))
875
442k
      return SKIP_YES;
876
877
27.1M
    if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
878
27.1M
      (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
879
27.1M
      (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
880
27.1M
      (ignore_hidden || !_hb_glyph_info_is_hidden (&info))))
881
3.68M
      return SKIP_MAYBE;
882
883
23.4M
    return SKIP_NO;
884
27.1M
  }
885
886
  public:
887
  unsigned int lookup_props = 0;
888
  hb_mask_t mask = -1;
889
  bool ignore_zwnj = false;
890
  bool ignore_zwj = false;
891
  bool ignore_hidden = false;
892
  bool per_syllable = false;
893
  uint8_t syllable = 0;
894
  match_func_t match_func = nullptr;
895
  const void *match_data = nullptr;
896
};
897
898
/* A view of 16- or 24-bit glyph IDs or coverage offsets. */
899
struct glyph_data_t
900
{
901
  template <typename T>
902
6.93M
  glyph_data_t (const T *data_) : data (data_)
903
#ifndef HB_NO_BEYOND_64K
904
6.93M
                              , wide (sizeof (T) == 3)
905
#endif
906
6.93M
  {
907
6.93M
    static_assert (sizeof (T) == 2 || sizeof (T) == 3, "invalid glyph data size");
908
6.93M
  }
OT::glyph_data_t::glyph_data_t<OT::NumType<true, unsigned short, 2u> >(OT::NumType<true, unsigned short, 2u> const*)
Line
Count
Source
902
190k
  glyph_data_t (const T *data_) : data (data_)
903
#ifndef HB_NO_BEYOND_64K
904
190k
                              , wide (sizeof (T) == 3)
905
#endif
906
190k
  {
907
190k
    static_assert (sizeof (T) == 2 || sizeof (T) == 3, "invalid glyph data size");
908
190k
  }
OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::Common::Coverage, OT::NumType<true, unsigned short, 2u>, void, true> >(OT::OffsetTo<OT::Layout::Common::Coverage, OT::NumType<true, unsigned short, 2u>, void, true> const*)
Line
Count
Source
902
6.25M
  glyph_data_t (const T *data_) : data (data_)
903
#ifndef HB_NO_BEYOND_64K
904
6.25M
                              , wide (sizeof (T) == 3)
905
#endif
906
6.25M
  {
907
6.25M
    static_assert (sizeof (T) == 2 || sizeof (T) == 3, "invalid glyph data size");
908
6.25M
  }
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::NumType<true, unsigned int, 3u> >(OT::NumType<true, unsigned int, 3u> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::Common::Coverage, OT::NumType<true, unsigned int, 3u>, void, true> >(OT::OffsetTo<OT::Layout::Common::Coverage, OT::NumType<true, unsigned int, 3u>, void, true> const*)
OT::glyph_data_t::glyph_data_t<OT::HBGlyphID16>(OT::HBGlyphID16 const*)
Line
Count
Source
902
494k
  glyph_data_t (const T *data_) : data (data_)
903
#ifndef HB_NO_BEYOND_64K
904
494k
                              , wide (sizeof (T) == 3)
905
#endif
906
494k
  {
907
494k
    static_assert (sizeof (T) == 2 || sizeof (T) == 3, "invalid glyph data size");
908
494k
  }
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::HBGlyphID24>(OT::HBGlyphID24 const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned short, 2u>, OT::Layout::GPOS_impl::MarkArray<OT::Layout::SmallTypes>, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned short, 2u>, OT::Layout::GPOS_impl::MarkArray<OT::Layout::SmallTypes>, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned short, 2u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::SmallTypes, OT::NumType<true, unsigned short, 2u> >, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned short, 2u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::SmallTypes, OT::NumType<true, unsigned short, 2u> >, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::MarkArray<OT::Layout::MediumTypes>, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::MarkArray<OT::Layout::MediumTypes>, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned int, 3u> >, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned int, 3u> >, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::SmallTypes, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::SmallTypes, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned int, 3u>, void, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned int, 3u>, void, true> const*)
Unexecuted instantiation: OT::glyph_data_t::glyph_data_t<OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned short, 2u> >, true> >(OT::OffsetTo<OT::Layout::GPOS_impl::Anchor, OT::NumType<true, unsigned int, 3u>, OT::Layout::GPOS_impl::AnchorMatrix<OT::Layout::MediumTypes, OT::NumType<true, unsigned short, 2u> >, true> const*)
909
910
  unsigned operator [] (unsigned i) const
911
0
  {
912
0
#ifndef HB_NO_BEYOND_64K
913
0
    if (wide)
914
0
      return ((const HBUINT24 *) data)[i];
915
0
#endif
916
0
    return ((const HBUINT16 *) data)[i];
917
0
  }
918
919
  const void *data;
920
#ifndef HB_NO_BEYOND_64K
921
  bool wide;
922
#endif
923
};
924
925
template <typename context_t>
926
struct skipping_iterator_t
927
{
928
  void init (context_t *c_, bool context_match = false)
929
117M
  {
930
117M
    c = c_;
931
117M
    end = c->buffer->len;
932
117M
    match_glyph_data16 = nullptr;
933
117M
#ifndef HB_NO_BEYOND_64K
934
117M
    match_glyph_data24 = nullptr;
935
117M
#endif
936
117M
    matcher.init (c, context_match);
937
117M
  }
938
  void set_lookup_props (unsigned int lookup_props)
939
565k
  {
940
565k
    matcher.lookup_props = lookup_props;
941
565k
  }
942
  void set_match_func (matcher_t::match_func_t match_func_,
943
           const void *match_data_)
944
3.17M
  {
945
3.17M
    matcher.set_match_func (match_func_, match_data_);
946
3.17M
  }
947
  void set_glyph_data (glyph_data_t glyph_data)
948
3.17M
  {
949
3.17M
#ifndef HB_NO_BEYOND_64K
950
3.17M
    match_glyph_data16 = glyph_data.wide ? nullptr : (const HBUINT16 *) glyph_data.data;
951
3.17M
    match_glyph_data24 = glyph_data.wide ? (const HBUINT24 *) glyph_data.data : nullptr;
952
#else
953
    match_glyph_data16 = (const HBUINT16 *) glyph_data.data;
954
#endif
955
3.17M
  }
956
957
#ifndef HB_OPTIMIZE_SIZE
958
  HB_ALWAYS_INLINE
959
#endif
960
  void reset (unsigned int start_index_)
961
1.86M
  {
962
    // For GSUB forward iterator
963
1.86M
    idx = start_index_;
964
1.86M
    end = c->buffer->len;
965
1.86M
    matcher.syllable = c->buffer->cur().syllable();
966
1.86M
  }
967
  void reset_back (unsigned int start_index_, bool from_out_buffer = false)
968
1.30M
  {
969
    // For GSUB backward iterator
970
1.30M
    idx = start_index_;
971
1.30M
    matcher.syllable = c->buffer->cur().syllable();
972
1.30M
  }
973
974
#ifndef HB_OPTIMIZE_SIZE
975
  HB_ALWAYS_INLINE
976
#endif
977
  void reset_fast (unsigned int start_index_)
978
21.5M
  {
979
    // Doesn't set end or syllable. Used by GPOS which doesn't care / change.
980
21.5M
    idx = start_index_;
981
21.5M
  }
982
983
#ifndef HB_OPTIMIZE_SIZE
984
  HB_ALWAYS_INLINE
985
#endif
986
  matcher_t::may_skip_t may_skip (const hb_glyph_info_t &info) const
987
174k
  { return matcher.may_skip (c, info); }
988
989
  enum match_t {
990
    MATCH,
991
    NOT_MATCH,
992
    SKIP
993
  };
994
995
#ifndef HB_OPTIMIZE_SIZE
996
  HB_ALWAYS_INLINE
997
#endif
998
  match_t match (hb_glyph_info_t &info)
999
27.4M
  {
1000
27.4M
    matcher_t::may_skip_t skip = matcher.may_skip (c, info);
1001
27.4M
    if (unlikely (skip == matcher_t::SKIP_YES))
1002
442k
      return SKIP;
1003
1004
27.0M
    matcher_t::may_match_t match = matcher.may_match (info, get_glyph_data ());
1005
27.0M
    if (match == matcher_t::MATCH_YES ||
1006
25.9M
  (match == matcher_t::MATCH_MAYBE &&
1007
20.9M
   skip == matcher_t::SKIP_NO))
1008
21.4M
      return MATCH;
1009
1010
5.56M
    if (skip == matcher_t::SKIP_NO)
1011
1.87M
      return NOT_MATCH;
1012
1013
3.68M
    return SKIP;
1014
5.56M
  }
1015
1016
  bool next (unsigned *unsafe_to = nullptr)
1017
23.3M
  {
1018
23.3M
    auto *info = c->buffer->info;
1019
23.3M
    const signed stop = (signed) end - 1;
1020
24.8M
    while ((signed) idx < stop)
1021
23.0M
    {
1022
23.0M
      idx++;
1023
23.0M
      switch (match (info[idx]))
1024
23.0M
      {
1025
20.8M
  case MATCH:
1026
20.8M
  {
1027
20.8M
    advance_glyph_data ();
1028
20.8M
    return true;
1029
0
  }
1030
726k
  case NOT_MATCH:
1031
726k
  {
1032
726k
    if (unsafe_to)
1033
726k
      *unsafe_to = idx + 1;
1034
726k
    return false;
1035
0
  }
1036
1.50M
  case SKIP:
1037
1.50M
    continue;
1038
23.0M
      }
1039
23.0M
    }
1040
1.76M
    if (unsafe_to)
1041
1.76M
      *unsafe_to = end;
1042
1.76M
    return false;
1043
23.3M
  }
1044
  bool prev (unsigned *unsafe_from = nullptr)
1045
1.78M
  {
1046
1.78M
    auto *out_info = c->buffer->out_info;
1047
1.78M
    const unsigned stop = 0;
1048
3.79M
    while (idx > stop)
1049
3.62M
    {
1050
3.62M
      idx--;
1051
3.62M
      switch (match (out_info[idx]))
1052
3.62M
      {
1053
462k
  case MATCH:
1054
462k
  {
1055
462k
    advance_glyph_data ();
1056
462k
    return true;
1057
0
  }
1058
1.15M
  case NOT_MATCH:
1059
1.15M
  {
1060
1.15M
    if (unsafe_from)
1061
1.15M
      *unsafe_from = hb_max (1u, idx) - 1u;
1062
1.15M
    return false;
1063
0
  }
1064
2.00M
  case SKIP:
1065
2.00M
    continue;
1066
3.62M
      }
1067
3.62M
    }
1068
171k
    if (unsafe_from)
1069
171k
      *unsafe_from = 0;
1070
171k
    return false;
1071
1.78M
  }
1072
1073
  HB_ALWAYS_INLINE
1074
  hb_codepoint_t
1075
  get_glyph_data ()
1076
27.0M
  {
1077
27.0M
    if (match_glyph_data16) return *match_glyph_data16;
1078
21.1M
#ifndef HB_NO_BEYOND_64K
1079
21.1M
    else
1080
21.1M
    if (match_glyph_data24) return *match_glyph_data24;
1081
21.1M
#endif
1082
21.1M
    return 0;
1083
27.0M
  }
1084
  HB_ALWAYS_INLINE
1085
  void
1086
  advance_glyph_data ()
1087
21.3M
  {
1088
21.3M
    if (match_glyph_data16) match_glyph_data16++;
1089
20.3M
#ifndef HB_NO_BEYOND_64K
1090
20.3M
    else
1091
20.3M
    if (match_glyph_data24) match_glyph_data24++;
1092
21.3M
#endif
1093
21.3M
  }
1094
1095
  unsigned int idx;
1096
  protected:
1097
  context_t *c;
1098
  matcher_t matcher;
1099
  const HBUINT16 *match_glyph_data16;
1100
#ifndef HB_NO_BEYOND_64K
1101
  const HBUINT24 *match_glyph_data24;
1102
#endif
1103
1104
  unsigned int end;
1105
};
1106
1107
struct hb_ot_apply_context_t :
1108
       hb_dispatch_context_t<hb_ot_apply_context_t, bool, HB_DEBUG_APPLY>
1109
{
1110
0
  const char *get_name () { return "APPLY"; }
1111
  typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index);
1112
1113
  template <typename T>
1114
  static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (return_t, obj.apply (c, nullptr) )
1115
  template <typename T>
1116
  static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (return_t, obj.apply (c) )
1117
  template <typename T>
1118
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_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> 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_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> 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_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> 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::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<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::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> 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_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
1119
1120
16
  static return_t default_return_value () { return false; }
1121
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
1122
  return_t recurse (unsigned int sub_lookup_index)
1123
149k
  {
1124
149k
    assert (recurse_func);
1125
149k
    if (unlikely (nesting_level_left == 0))
1126
16
    {
1127
16
      buffer->successful = false;
1128
16
      return default_return_value ();
1129
16
    }
1130
1131
149k
    buffer->max_ops--;
1132
149k
    if (unlikely (buffer->max_ops < 0))
1133
0
    {
1134
0
      buffer->successful = false;
1135
0
      return default_return_value ();
1136
0
    }
1137
1138
149k
    nesting_level_left--;
1139
149k
    bool ret = recurse_func (this, sub_lookup_index);
1140
149k
    nesting_level_left++;
1141
149k
    return ret;
1142
149k
  }
1143
1144
  skipping_iterator_t<hb_ot_apply_context_t> iter_input, iter_context;
1145
1146
  unsigned int table_index; /* GSUB/GPOS */
1147
  hb_font_t *font;
1148
  hb_face_t *face;
1149
  hb_buffer_t *buffer;
1150
  hb_sanitize_context_t sanitizer;
1151
  recurse_func_t recurse_func = nullptr;
1152
  const GDEF &gdef;
1153
  const GDEF::accelerator_t &gdef_accel;
1154
  const ItemVariationStore &var_store;
1155
  hb_scalar_cache_t *var_store_cache;
1156
1157
  hb_direction_t direction;
1158
  hb_mask_t lookup_mask = 1;
1159
  unsigned int lookup_index = (unsigned) -1;
1160
  unsigned int lookup_props = 0;
1161
  unsigned int nesting_level_left = HB_MAX_NESTING_LEVEL;
1162
1163
  bool has_glyph_classes;
1164
  bool auto_zwnj = true;
1165
  bool auto_zwj = true;
1166
  bool per_syllable = false;
1167
  bool random = false;
1168
  unsigned new_syllables = (unsigned) -1;
1169
1170
  signed last_base = -1; // GPOS uses
1171
  unsigned last_base_until = 0; // GPOS uses
1172
1173
  hb_vector_t<uint32_t> match_positions;
1174
  uint32_t stack_match_positions[8];
1175
#ifndef HB_NO_BUFFER_MESSAGE
1176
  hb_buffer_t::changed_func_t orig_changed_func = nullptr;
1177
  void *orig_changed_data = nullptr;
1178
#endif
1179
1180
  hb_ot_apply_context_t (unsigned int table_index_,
1181
       hb_font_t *font_,
1182
       hb_buffer_t *buffer_,
1183
       hb_blob_t *table_blob_,
1184
       hb_scalar_cache_t *var_store_cache_ = nullptr) :
1185
51.6M
      table_index (table_index_),
1186
51.6M
      font (font_), face (font->face), buffer (buffer_),
1187
51.6M
      sanitizer (table_blob_),
1188
      gdef (
1189
#ifndef HB_NO_OT_LAYOUT
1190
51.6M
            *face->table.GDEF->table
1191
#else
1192
            Null (GDEF)
1193
#endif
1194
           ),
1195
      gdef_accel (
1196
#ifndef HB_NO_OT_LAYOUT
1197
51.6M
            *face->table.GDEF
1198
#else
1199
            Null (GDEF::accelerator_t)
1200
#endif
1201
           ),
1202
51.6M
      var_store (gdef.get_var_store ()),
1203
51.6M
      var_store_cache (var_store_cache_),
1204
51.6M
      direction (buffer_->props.direction),
1205
51.6M
      has_glyph_classes (gdef.has_glyph_classes ())
1206
51.6M
  {
1207
51.6M
    init_iters ();
1208
51.6M
    match_positions.set_storage (stack_match_positions);
1209
1210
51.6M
#ifndef HB_NO_BUFFER_MESSAGE
1211
51.6M
    if (buffer->messaging ())
1212
0
    {
1213
0
      assert (buffer->changed_func == nullptr ||
1214
0
        buffer->changed_func == buffer_changed_trampoline);
1215
0
      orig_changed_func = buffer->changed_func;
1216
0
      orig_changed_data = buffer->changed_data;
1217
0
      buffer->changed_func = buffer_changed_trampoline;
1218
0
      buffer->changed_data = this;
1219
0
    }
1220
51.6M
#endif
1221
51.6M
  }
1222
  ~hb_ot_apply_context_t ()
1223
51.6M
  {
1224
51.6M
#ifndef HB_NO_BUFFER_MESSAGE
1225
51.6M
    if (buffer->messaging ())
1226
0
    {
1227
0
      assert (buffer->changed_func == buffer_changed_trampoline);
1228
0
      assert (buffer->changed_data == this);
1229
0
      buffer->changed_func = orig_changed_func;
1230
0
      buffer->changed_data = orig_changed_data;
1231
0
    }
1232
51.6M
#endif
1233
51.6M
  }
1234
1235
  void init_iters ()
1236
58.6M
  {
1237
58.6M
    iter_input.init (this, false);
1238
58.6M
    iter_context.init (this, true);
1239
58.6M
  }
1240
1241
6.30M
  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 (); }
1242
5.89M
  void set_auto_zwj (bool auto_zwj_, bool init = true) { auto_zwj = auto_zwj_; if (init) init_iters (); }
1243
5.89M
  void set_auto_zwnj (bool auto_zwnj_, bool init = true) { auto_zwnj = auto_zwnj_; if (init) init_iters (); }
1244
5.89M
  void set_per_syllable (bool per_syllable_, bool init = true) { per_syllable = per_syllable_; if (init) init_iters (); }
1245
5.89M
  void set_random (bool random_) { random = random_; }
1246
50.8M
  void set_recurse_func (recurse_func_t func) { recurse_func = func; }
1247
6.19M
  void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
1248
  void set_lookup_props (unsigned int lookup_props_)
1249
6.60M
  {
1250
6.60M
    lookup_props = gdef_accel.sanitize_lookup_props (lookup_props_);
1251
6.60M
    init_iters ();
1252
6.60M
  }
1253
1254
  uint32_t random_number ()
1255
0
  {
1256
    /* http://www.cplusplus.com/reference/random/minstd_rand/ */
1257
0
    buffer->random_state = buffer->random_state * 48271 % 2147483647;
1258
0
    return buffer->random_state;
1259
0
  }
1260
1261
  static void buffer_changed_trampoline (hb_buffer_t *buffer HB_UNUSED, void *user_data)
1262
0
  {
1263
0
    ((hb_ot_apply_context_t *) user_data)->buffer_changed ();
1264
0
  }
1265
  void buffer_changed ()
1266
0
  {
1267
0
    buffer->update_digest ();
1268
0
    if (likely (has_glyph_classes))
1269
0
      for (unsigned i = 0; i < buffer->len; i++)
1270
0
  _set_glyph_class_props (buffer->info[i]);
1271
0
  }
1272
1273
  HB_ALWAYS_INLINE
1274
  HB_HOT
1275
  bool match_properties_mark (const hb_glyph_info_t *info,
1276
            unsigned int    glyph_props,
1277
            unsigned int    match_props) const
1278
3.38M
  {
1279
    /* If using mark filtering sets, the high short of
1280
     * match_props has the set index.
1281
     */
1282
3.38M
    if (match_props & LookupFlag::UseMarkFilteringSet)
1283
0
    {
1284
0
      unsigned set_index = match_props >> 16;
1285
0
      return gdef_accel.mark_set_covers (set_index, info->codepoint);
1286
0
    }
1287
1288
    /* The second byte of match_props has the meaning
1289
     * "ignore marks of attachment type different than
1290
     * the attachment type specified."
1291
     */
1292
3.38M
    if (match_props & LookupFlag::MarkAttachmentType)
1293
57
      return (match_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType);
1294
1295
3.38M
    return true;
1296
3.38M
  }
1297
1298
#ifndef HB_OPTIMIZE_SIZE
1299
  HB_ALWAYS_INLINE
1300
#endif
1301
  bool check_glyph_property (const hb_glyph_info_t *info,
1302
           unsigned match_props) const
1303
201M
  {
1304
201M
    unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info);
1305
1306
    /* Not covered, if, for example, glyph class is ligature and
1307
     * match_props includes LookupFlags::IgnoreLigatures
1308
     */
1309
201M
    if (glyph_props & match_props & LookupFlag::IgnoreFlags)
1310
442k
      return false;
1311
1312
201M
    if (glyph_props & HB_OT_LAYOUT_GLYPH_PROPS_MARK)
1313
3.38M
      return match_properties_mark (info, glyph_props, match_props);
1314
1315
198M
    return true;
1316
201M
  }
1317
1318
  void _set_glyph_class (hb_codepoint_t glyph_index,
1319
        unsigned int class_guess = 0,
1320
        bool ligature = false,
1321
        bool component = false)
1322
12.7M
  {
1323
12.7M
    buffer->digest.add (glyph_index);
1324
1325
12.7M
    if (new_syllables != (unsigned) -1)
1326
0
      buffer->cur().syllable() = new_syllables;
1327
1328
12.7M
    unsigned int props = _hb_glyph_info_get_glyph_props (&buffer->cur());
1329
12.7M
    props |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED;
1330
12.7M
    if (ligature)
1331
66.9k
    {
1332
66.9k
      props |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED;
1333
      /* In the only place that the MULTIPLIED bit is used, Uniscribe
1334
       * seems to only care about the "last" transformation between
1335
       * Ligature and Multiple substitutions.  Ie. if you ligate, expand,
1336
       * and ligate again, it forgives the multiplication and acts as
1337
       * if only ligation happened.  As such, clear MULTIPLIED bit.
1338
       */
1339
66.9k
      props &= ~HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
1340
66.9k
    }
1341
12.7M
    if (component)
1342
12.7M
      props |= HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED;
1343
12.7M
    if (likely (has_glyph_classes))
1344
66.9k
    {
1345
66.9k
      _set_glyph_class_props (buffer->cur(), props, glyph_index);
1346
66.9k
    }
1347
12.7M
    else if (class_guess)
1348
0
    {
1349
0
      props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
1350
0
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props | class_guess);
1351
0
    }
1352
12.7M
    else
1353
12.7M
      _hb_glyph_info_set_glyph_props (&buffer->cur(), props);
1354
12.7M
  }
1355
  void _set_glyph_class_props (hb_glyph_info_t &info,
1356
             unsigned int props,
1357
             hb_codepoint_t glyph_index)
1358
66.9k
  {
1359
66.9k
    props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE;
1360
66.9k
    _hb_glyph_info_set_glyph_props (&info, props | gdef_accel.get_glyph_props (glyph_index));
1361
66.9k
  }
1362
  void _set_glyph_class_props (hb_glyph_info_t &info)
1363
0
  {
1364
0
    _set_glyph_class_props (info,
1365
0
          _hb_glyph_info_get_glyph_props (&info),
1366
0
          info.codepoint);
1367
0
  }
1368
1369
  void replace_glyph (hb_codepoint_t glyph_index)
1370
0
  {
1371
0
    _set_glyph_class (glyph_index);
1372
0
    (void) buffer->replace_glyph (glyph_index);
1373
0
  }
1374
  void replace_glyph_inplace (hb_codepoint_t glyph_index)
1375
0
  {
1376
0
    _set_glyph_class (glyph_index);
1377
0
    buffer->cur().codepoint = glyph_index;
1378
0
  }
1379
  void replace_glyph_with_ligature (hb_codepoint_t glyph_index,
1380
            unsigned int class_guess)
1381
66.9k
  {
1382
66.9k
    _set_glyph_class (glyph_index, class_guess, true);
1383
66.9k
    (void) buffer->replace_glyph (glyph_index);
1384
66.9k
  }
1385
  void output_glyph_for_component (hb_codepoint_t glyph_index,
1386
           unsigned int class_guess)
1387
12.7M
  {
1388
12.7M
    _set_glyph_class (glyph_index, class_guess, false, true);
1389
12.7M
    (void) buffer->output_glyph (glyph_index);
1390
12.7M
  }
1391
};
1392
1393
enum class hb_ot_subtable_cache_op_t
1394
{
1395
  ENTER,
1396
  LEAVE,
1397
};
1398
1399
struct hb_accelerate_subtables_context_t :
1400
       hb_dispatch_context_t<hb_accelerate_subtables_context_t>
1401
{
1402
  template <typename T>
1403
  static inline auto collect_second_glyphs_ (const T &obj,
1404
               hb_set_digest_t *digest,
1405
               hb_priority<1>) HB_RETURN (void, obj.collect_second_glyphs (digest) )
1406
  template <typename T>
1407
  static inline void collect_second_glyphs_ (const T &obj HB_UNUSED,
1408
               hb_set_digest_t *digest,
1409
               hb_priority<0>)
1410
926
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
6
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
5
  { *digest = hb_set_digest_t::full (); }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
3
  { *digest = hb_set_digest_t::full (); }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
2
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
3
  { *digest = hb_set_digest_t::full (); }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
1
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
882
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
5
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
8
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
1
  { *digest = hb_set_digest_t::full (); }
void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&, hb_set_digest_t*, hb_priority<0u>)
Line
Count
Source
1410
10
  { *digest = hb_set_digest_t::full (); }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::collect_second_glyphs_<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&, hb_set_digest_t*, hb_priority<0u>)
1411
1412
  template <typename T>
1413
  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) )
1414
  template <typename T>
1415
  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) )
1416
  template <typename T>
1417
  static inline bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
1418
175M
  {
1419
175M
    const T *typed_obj = (const T *) obj;
1420
175M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
175M
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
1418
564
  {
1419
564
    const T *typed_obj = (const T *) obj;
1420
564
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
564
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
1418
350
  {
1419
350
    const T *typed_obj = (const T *) obj;
1420
350
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
350
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
171M
  {
1419
171M
    const T *typed_obj = (const T *) obj;
1420
171M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
171M
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
1418
4
  {
1419
4
    const T *typed_obj = (const T *) obj;
1420
4
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
4
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
523k
  {
1419
523k
    const T *typed_obj = (const T *) obj;
1420
523k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
523k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
158k
  {
1419
158k
    const T *typed_obj = (const T *) obj;
1420
158k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
158k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
8
  {
1419
8
    const T *typed_obj = (const T *) obj;
1420
8
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
8
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
1418
1.12k
  {
1419
1.12k
    const T *typed_obj = (const T *) obj;
1420
1.12k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
1.12k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
80.1k
  {
1419
80.1k
    const T *typed_obj = (const T *) obj;
1420
80.1k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
80.1k
  }
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
1418
12
  {
1419
12
    const T *typed_obj = (const T *) obj;
1420
12
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
12
  }
bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Line
Count
Source
1418
2.64M
  {
1419
2.64M
    const T *typed_obj = (const T *) obj;
1420
2.64M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
2.64M
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
8
  {
1419
8
    const T *typed_obj = (const T *) obj;
1420
8
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
8
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
206k
  {
1419
206k
    const T *typed_obj = (const T *) obj;
1420
206k
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
206k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
20
  {
1419
20
    const T *typed_obj = (const T *) obj;
1420
20
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
20
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1418
1.02M
  {
1419
1.02M
    const T *typed_obj = (const T *) obj;
1420
1.02M
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
1.02M
  }
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
1418
24
  {
1419
24
    const T *typed_obj = (const T *) obj;
1420
24
    return apply_ (typed_obj, c, external_cache, hb_prioritize);
1421
24
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
1422
1423
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1424
  template <typename T>
1425
  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) )
1426
  template <typename T>
1427
  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) )
1428
  template <typename T>
1429
  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) )
1430
  template <typename T>
1431
  static inline bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache)
1432
147k
  {
1433
147k
    const T *typed_obj = (const T *) obj;
1434
147k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
1435
147k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::SinglePosFormat1_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::SinglePosFormat2_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::SinglePosFormat1_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::SinglePosFormat2_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::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_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::CursivePosFormat1_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::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
1432
32
  {
1433
32
    const T *typed_obj = (const T *) obj;
1434
32
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
1435
32
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat3_6<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::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
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
1432
147k
  {
1433
147k
    const T *typed_obj = (const T *) obj;
1434
147k
    return apply_cached_ (typed_obj, c, external_cache, hb_prioritize);
1435
147k
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat3<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::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_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::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*)
1436
1437
  template <typename T>
1438
  static inline auto cache_func_ (hb_ot_apply_context_t *c,
1439
          hb_ot_subtable_cache_op_t op,
1440
          hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) )
1441
  template <typename T=void>
1442
  static inline bool cache_func_ (hb_ot_apply_context_t *c,
1443
          hb_ot_subtable_cache_op_t op HB_UNUSED,
1444
0
          hb_priority<0>) { return false; }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::SinglePosFormat1_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::SinglePosFormat2_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::SinglePosFormat1_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::SinglePosFormat2_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::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_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::CursivePosFormat1_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::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_6<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::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::ContextFormat3_6<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::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::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_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::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>)
1445
  template <typename Type>
1446
  static inline bool cache_func_to (hb_ot_apply_context_t *c,
1447
            hb_ot_subtable_cache_op_t op)
1448
248
  {
1449
248
    return cache_func_<Type> (c, op, hb_prioritize);
1450
248
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::SinglePosFormat1_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::SinglePosFormat2_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::SinglePosFormat1_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::SinglePosFormat2_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::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_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::CursivePosFormat1_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::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
1448
64
  {
1449
64
    return cache_func_<Type> (c, op, hb_prioritize);
1450
64
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat3_6<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::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
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
1448
184
  {
1449
184
    return cache_func_<Type> (c, op, hb_prioritize);
1450
184
  }
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat3<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::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_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::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
1451
#endif
1452
1453
  typedef bool (*hb_apply_func_t) (const void *obj, hb_ot_apply_context_t *c, void *external_cache);
1454
  typedef bool (*hb_cache_func_t) (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op);
1455
1456
  struct hb_applicable_t
1457
  {
1458
    friend struct hb_accelerate_subtables_context_t;
1459
    friend struct hb_ot_layout_lookup_accelerator_t;
1460
1461
    template <typename T>
1462
    void init (const T &obj_,
1463
         hb_apply_func_t apply_func_
1464
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1465
         , hb_apply_func_t apply_cached_func_
1466
         , hb_cache_func_t cache_func_
1467
         , void *external_cache_
1468
#endif
1469
    )
1470
2.87k
    {
1471
2.87k
      obj = &obj_;
1472
2.87k
      apply_func = apply_func_;
1473
2.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
2.87k
      apply_cached_func = apply_cached_func_;
1475
2.87k
      cache_func = cache_func_;
1476
2.87k
      external_cache = external_cache_;
1477
2.87k
#endif
1478
2.87k
      digest.init ();
1479
2.87k
      obj_.get_coverage ().collect_coverage (&digest);
1480
2.87k
    }
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_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
1470
6
    {
1471
6
      obj = &obj_;
1472
6
      apply_func = apply_func_;
1473
6
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
6
      apply_cached_func = apply_cached_func_;
1475
6
      cache_func = cache_func_;
1476
6
      external_cache = external_cache_;
1477
6
#endif
1478
6
      digest.init ();
1479
6
      obj_.get_coverage ().collect_coverage (&digest);
1480
6
    }
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_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
1470
5
    {
1471
5
      obj = &obj_;
1472
5
      apply_func = apply_func_;
1473
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
5
      apply_cached_func = apply_cached_func_;
1475
5
      cache_func = cache_func_;
1476
5
      external_cache = external_cache_;
1477
5
#endif
1478
5
      digest.init ();
1479
5
      obj_.get_coverage ().collect_coverage (&digest);
1480
5
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_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*)
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_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
1470
3
    {
1471
3
      obj = &obj_;
1472
3
      apply_func = apply_func_;
1473
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
3
      apply_cached_func = apply_cached_func_;
1475
3
      cache_func = cache_func_;
1476
3
      external_cache = external_cache_;
1477
3
#endif
1478
3
      digest.init ();
1479
3
      obj_.get_coverage ().collect_coverage (&digest);
1480
3
    }
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
1470
90
    {
1471
90
      obj = &obj_;
1472
90
      apply_func = apply_func_;
1473
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
90
      apply_cached_func = apply_cached_func_;
1475
90
      cache_func = cache_func_;
1476
90
      external_cache = external_cache_;
1477
90
#endif
1478
90
      digest.init ();
1479
90
      obj_.get_coverage ().collect_coverage (&digest);
1480
90
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_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
1470
2
    {
1471
2
      obj = &obj_;
1472
2
      apply_func = apply_func_;
1473
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
2
      apply_cached_func = apply_cached_func_;
1475
2
      cache_func = cache_func_;
1476
2
      external_cache = external_cache_;
1477
2
#endif
1478
2
      digest.init ();
1479
2
      obj_.get_coverage ().collect_coverage (&digest);
1480
2
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_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*)
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
1470
494
    {
1471
494
      obj = &obj_;
1472
494
      apply_func = apply_func_;
1473
494
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
494
      apply_cached_func = apply_cached_func_;
1475
494
      cache_func = cache_func_;
1476
494
      external_cache = external_cache_;
1477
494
#endif
1478
494
      digest.init ();
1479
494
      obj_.get_coverage ().collect_coverage (&digest);
1480
494
    }
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
1470
1
    {
1471
1
      obj = &obj_;
1472
1
      apply_func = apply_func_;
1473
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
1
      apply_cached_func = apply_cached_func_;
1475
1
      cache_func = cache_func_;
1476
1
      external_cache = external_cache_;
1477
1
#endif
1478
1
      digest.init ();
1479
1
      obj_.get_coverage ().collect_coverage (&digest);
1480
1
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
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
1470
78
    {
1471
78
      obj = &obj_;
1472
78
      apply_func = apply_func_;
1473
78
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
78
      apply_cached_func = apply_cached_func_;
1475
78
      cache_func = cache_func_;
1476
78
      external_cache = external_cache_;
1477
78
#endif
1478
78
      digest.init ();
1479
78
      obj_.get_coverage ().collect_coverage (&digest);
1480
78
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
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
1470
4
    {
1471
4
      obj = &obj_;
1472
4
      apply_func = apply_func_;
1473
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
4
      apply_cached_func = apply_cached_func_;
1475
4
      cache_func = cache_func_;
1476
4
      external_cache = external_cache_;
1477
4
#endif
1478
4
      digest.init ();
1479
4
      obj_.get_coverage ().collect_coverage (&digest);
1480
4
    }
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
1470
16
    {
1471
16
      obj = &obj_;
1472
16
      apply_func = apply_func_;
1473
16
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
16
      apply_cached_func = apply_cached_func_;
1475
16
      cache_func = cache_func_;
1476
16
      external_cache = external_cache_;
1477
16
#endif
1478
16
      digest.init ();
1479
16
      obj_.get_coverage ().collect_coverage (&digest);
1480
16
    }
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<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
1470
29
    {
1471
29
      obj = &obj_;
1472
29
      apply_func = apply_func_;
1473
29
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
29
      apply_cached_func = apply_cached_func_;
1475
29
      cache_func = cache_func_;
1476
29
      external_cache = external_cache_;
1477
29
#endif
1478
29
      digest.init ();
1479
29
      obj_.get_coverage ().collect_coverage (&digest);
1480
29
    }
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
1470
2
    {
1471
2
      obj = &obj_;
1472
2
      apply_func = apply_func_;
1473
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
2
      apply_cached_func = apply_cached_func_;
1475
2
      cache_func = cache_func_;
1476
2
      external_cache = external_cache_;
1477
2
#endif
1478
2
      digest.init ();
1479
2
      obj_.get_coverage ().collect_coverage (&digest);
1480
2
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<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
1470
1
    {
1471
1
      obj = &obj_;
1472
1
      apply_func = apply_func_;
1473
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
1
      apply_cached_func = apply_cached_func_;
1475
1
      cache_func = cache_func_;
1476
1
      external_cache = external_cache_;
1477
1
#endif
1478
1
      digest.init ();
1479
1
      obj_.get_coverage ().collect_coverage (&digest);
1480
1
    }
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
1470
139
    {
1471
139
      obj = &obj_;
1472
139
      apply_func = apply_func_;
1473
139
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
139
      apply_cached_func = apply_cached_func_;
1475
139
      cache_func = cache_func_;
1476
139
      external_cache = external_cache_;
1477
139
#endif
1478
139
      digest.init ();
1479
139
      obj_.get_coverage ().collect_coverage (&digest);
1480
139
    }
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
1470
90
    {
1471
90
      obj = &obj_;
1472
90
      apply_func = apply_func_;
1473
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
90
      apply_cached_func = apply_cached_func_;
1475
90
      cache_func = cache_func_;
1476
90
      external_cache = external_cache_;
1477
90
#endif
1478
90
      digest.init ();
1479
90
      obj_.get_coverage ().collect_coverage (&digest);
1480
90
    }
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<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
1470
789
    {
1471
789
      obj = &obj_;
1472
789
      apply_func = apply_func_;
1473
789
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
789
      apply_cached_func = apply_cached_func_;
1475
789
      cache_func = cache_func_;
1476
789
      external_cache = external_cache_;
1477
789
#endif
1478
789
      digest.init ();
1479
789
      obj_.get_coverage ().collect_coverage (&digest);
1480
789
    }
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
1470
4
    {
1471
4
      obj = &obj_;
1472
4
      apply_func = apply_func_;
1473
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
4
      apply_cached_func = apply_cached_func_;
1475
4
      cache_func = cache_func_;
1476
4
      external_cache = external_cache_;
1477
4
#endif
1478
4
      digest.init ();
1479
4
      obj_.get_coverage ().collect_coverage (&digest);
1480
4
    }
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
1470
4
    {
1471
4
      obj = &obj_;
1472
4
      apply_func = apply_func_;
1473
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
4
      apply_cached_func = apply_cached_func_;
1475
4
      cache_func = cache_func_;
1476
4
      external_cache = external_cache_;
1477
4
#endif
1478
4
      digest.init ();
1479
4
      obj_.get_coverage ().collect_coverage (&digest);
1480
4
    }
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
1470
2
    {
1471
2
      obj = &obj_;
1472
2
      apply_func = apply_func_;
1473
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
2
      apply_cached_func = apply_cached_func_;
1475
2
      cache_func = cache_func_;
1476
2
      external_cache = external_cache_;
1477
2
#endif
1478
2
      digest.init ();
1479
2
      obj_.get_coverage ().collect_coverage (&digest);
1480
2
    }
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
1470
3
    {
1471
3
      obj = &obj_;
1472
3
      apply_func = apply_func_;
1473
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
3
      apply_cached_func = apply_cached_func_;
1475
3
      cache_func = cache_func_;
1476
3
      external_cache = external_cache_;
1477
3
#endif
1478
3
      digest.init ();
1479
3
      obj_.get_coverage ().collect_coverage (&digest);
1480
3
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*)
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
1470
1
    {
1471
1
      obj = &obj_;
1472
1
      apply_func = apply_func_;
1473
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
1
      apply_cached_func = apply_cached_func_;
1475
1
      cache_func = cache_func_;
1476
1
      external_cache = external_cache_;
1477
1
#endif
1478
1
      digest.init ();
1479
1
      obj_.get_coverage ().collect_coverage (&digest);
1480
1
    }
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
1470
882
    {
1471
882
      obj = &obj_;
1472
882
      apply_func = apply_func_;
1473
882
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
882
      apply_cached_func = apply_cached_func_;
1475
882
      cache_func = cache_func_;
1476
882
      external_cache = external_cache_;
1477
882
#endif
1478
882
      digest.init ();
1479
882
      obj_.get_coverage ().collect_coverage (&digest);
1480
882
    }
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
1470
5
    {
1471
5
      obj = &obj_;
1472
5
      apply_func = apply_func_;
1473
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
5
      apply_cached_func = apply_cached_func_;
1475
5
      cache_func = cache_func_;
1476
5
      external_cache = external_cache_;
1477
5
#endif
1478
5
      digest.init ();
1479
5
      obj_.get_coverage ().collect_coverage (&digest);
1480
5
    }
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
1470
8
    {
1471
8
      obj = &obj_;
1472
8
      apply_func = apply_func_;
1473
8
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
8
      apply_cached_func = apply_cached_func_;
1475
8
      cache_func = cache_func_;
1476
8
      external_cache = external_cache_;
1477
8
#endif
1478
8
      digest.init ();
1479
8
      obj_.get_coverage ().collect_coverage (&digest);
1480
8
    }
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
1470
1
    {
1471
1
      obj = &obj_;
1472
1
      apply_func = apply_func_;
1473
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
1
      apply_cached_func = apply_cached_func_;
1475
1
      cache_func = cache_func_;
1476
1
      external_cache = external_cache_;
1477
1
#endif
1478
1
      digest.init ();
1479
1
      obj_.get_coverage ().collect_coverage (&digest);
1480
1
    }
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
1470
194
    {
1471
194
      obj = &obj_;
1472
194
      apply_func = apply_func_;
1473
194
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
194
      apply_cached_func = apply_cached_func_;
1475
194
      cache_func = cache_func_;
1476
194
      external_cache = external_cache_;
1477
194
#endif
1478
194
      digest.init ();
1479
194
      obj_.get_coverage ().collect_coverage (&digest);
1480
194
    }
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
1470
14
    {
1471
14
      obj = &obj_;
1472
14
      apply_func = apply_func_;
1473
14
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
14
      apply_cached_func = apply_cached_func_;
1475
14
      cache_func = cache_func_;
1476
14
      external_cache = external_cache_;
1477
14
#endif
1478
14
      digest.init ();
1479
14
      obj_.get_coverage ().collect_coverage (&digest);
1480
14
    }
void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_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
1470
10
    {
1471
10
      obj = &obj_;
1472
10
      apply_func = apply_func_;
1473
10
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1474
10
      apply_cached_func = apply_cached_func_;
1475
10
      cache_func = cache_func_;
1476
10
      external_cache = external_cache_;
1477
10
#endif
1478
10
      digest.init ();
1479
10
      obj_.get_coverage ().collect_coverage (&digest);
1480
10
    }
Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_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*)
1481
1482
#ifdef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1483
    bool apply (hb_ot_apply_context_t *c) const
1484
    {
1485
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, nullptr);
1486
    }
1487
    bool apply_no_digest (hb_ot_apply_context_t *c) const
1488
    {
1489
      return apply_func (obj, c, nullptr);
1490
    }
1491
#else
1492
    bool apply (hb_ot_apply_context_t *c) const
1493
2.38M
    {
1494
2.38M
      return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, external_cache);
1495
2.38M
    }
1496
    bool apply_cached (hb_ot_apply_context_t *c) const
1497
0
    {
1498
0
      return digest.may_have (c->buffer->cur().codepoint) &&  apply_cached_func (obj, c, external_cache);
1499
0
    }
1500
    bool apply_no_digest (hb_ot_apply_context_t *c) const
1501
173M
    {
1502
173M
      return apply_func (obj, c, external_cache);
1503
173M
    }
1504
    bool apply_cached_no_digest (hb_ot_apply_context_t *c) const
1505
147k
    {
1506
147k
      return apply_cached_func (obj, c, external_cache);
1507
147k
    }
1508
1509
    bool cache_enter (hb_ot_apply_context_t *c) const
1510
124
    {
1511
124
      return cache_func (c, hb_ot_subtable_cache_op_t::ENTER);
1512
124
    }
1513
    void cache_leave (hb_ot_apply_context_t *c) const
1514
124
    {
1515
124
      cache_func (c, hb_ot_subtable_cache_op_t::LEAVE);
1516
124
    }
1517
#endif
1518
1519
    private:
1520
    const void *obj;
1521
    hb_apply_func_t apply_func;
1522
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1523
    hb_apply_func_t apply_cached_func;
1524
    hb_cache_func_t cache_func;
1525
    void *external_cache;
1526
#endif
1527
    hb_set_digest_t digest;
1528
  };
1529
1530
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1531
  template <typename T>
1532
  auto cache_cost (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.cache_cost () )
1533
  template <typename T>
1534
  auto cache_cost (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( 0u )
1535
1536
  template <typename T>
1537
  auto external_cache_create (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.external_cache_create () )
1538
  template <typename T>
1539
  auto external_cache_create (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( nullptr )
1540
#endif
1541
1542
  /* Dispatch interface. */
1543
  template <typename T>
1544
  return_t dispatch (const T &obj)
1545
2.87k
  {
1546
2.87k
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
2.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
2.87k
    void *external_cache = nullptr;
1550
2.87k
    if (i < 8)
1551
2.78k
      external_cache = external_cache_create (obj, hb_prioritize);
1552
2.87k
#endif
1553
1554
2.87k
    hb_applicable_t *entry = &array[i++];
1555
1556
2.87k
    entry->init (obj,
1557
2.87k
     apply_to<T>
1558
2.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
2.87k
     , apply_cached_to<T>
1560
2.87k
     , cache_func_to<T>
1561
2.87k
     , external_cache
1562
2.87k
#endif
1563
2.87k
     );
1564
1565
2.87k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
2.87k
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
2.87k
    if (cost > subtable_cache_user_cost)
1576
35
    {
1577
35
      subtable_cache_user_idx = i - 1;
1578
35
      subtable_cache_user_cost = cost;
1579
35
    }
1580
2.87k
#endif
1581
1582
2.87k
    return hb_empty_t ();
1583
2.87k
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
6
  {
1546
6
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
6
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
6
    void *external_cache = nullptr;
1550
6
    if (i < 8)
1551
6
      external_cache = external_cache_create (obj, hb_prioritize);
1552
6
#endif
1553
1554
6
    hb_applicable_t *entry = &array[i++];
1555
1556
6
    entry->init (obj,
1557
6
     apply_to<T>
1558
6
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
6
     , apply_cached_to<T>
1560
6
     , cache_func_to<T>
1561
6
     , external_cache
1562
6
#endif
1563
6
     );
1564
1565
6
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
6
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
6
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
6
#endif
1581
1582
6
    return hb_empty_t ();
1583
6
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
5
  {
1546
5
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
5
    void *external_cache = nullptr;
1550
5
    if (i < 8)
1551
5
      external_cache = external_cache_create (obj, hb_prioritize);
1552
5
#endif
1553
1554
5
    hb_applicable_t *entry = &array[i++];
1555
1556
5
    entry->init (obj,
1557
5
     apply_to<T>
1558
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
5
     , apply_cached_to<T>
1560
5
     , cache_func_to<T>
1561
5
     , external_cache
1562
5
#endif
1563
5
     );
1564
1565
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
5
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
5
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
5
#endif
1581
1582
5
    return hb_empty_t ();
1583
5
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat1_3<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::SinglePosFormat2_4<OT::Layout::MediumTypes> const&)
Line
Count
Source
1545
3
  {
1546
3
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
3
    void *external_cache = nullptr;
1550
3
    if (i < 8)
1551
3
      external_cache = external_cache_create (obj, hb_prioritize);
1552
3
#endif
1553
1554
3
    hb_applicable_t *entry = &array[i++];
1555
1556
3
    entry->init (obj,
1557
3
     apply_to<T>
1558
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
3
     , apply_cached_to<T>
1560
3
     , cache_func_to<T>
1561
3
     , external_cache
1562
3
#endif
1563
3
     );
1564
1565
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
3
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
3
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
3
#endif
1581
1582
3
    return hb_empty_t ();
1583
3
  }
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
1545
90
  {
1546
90
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
90
    void *external_cache = nullptr;
1550
90
    if (i < 8)
1551
90
      external_cache = external_cache_create (obj, hb_prioritize);
1552
90
#endif
1553
1554
90
    hb_applicable_t *entry = &array[i++];
1555
1556
90
    entry->init (obj,
1557
90
     apply_to<T>
1558
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
90
     , apply_cached_to<T>
1560
90
     , cache_func_to<T>
1561
90
     , external_cache
1562
90
#endif
1563
90
     );
1564
1565
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
90
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
90
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
90
#endif
1581
1582
90
    return hb_empty_t ();
1583
90
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
2
  {
1546
2
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
2
    void *external_cache = nullptr;
1550
2
    if (i < 8)
1551
2
      external_cache = external_cache_create (obj, hb_prioritize);
1552
2
#endif
1553
1554
2
    hb_applicable_t *entry = &array[i++];
1555
1556
2
    entry->init (obj,
1557
2
     apply_to<T>
1558
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
2
     , apply_cached_to<T>
1560
2
     , cache_func_to<T>
1561
2
     , external_cache
1562
2
#endif
1563
2
     );
1564
1565
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
2
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
2
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
2
#endif
1581
1582
2
    return hb_empty_t ();
1583
2
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::CursivePosFormat1_2<OT::Layout::MediumTypes> const&)
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
1545
494
  {
1546
494
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
494
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
494
    void *external_cache = nullptr;
1550
494
    if (i < 8)
1551
494
      external_cache = external_cache_create (obj, hb_prioritize);
1552
494
#endif
1553
1554
494
    hb_applicable_t *entry = &array[i++];
1555
1556
494
    entry->init (obj,
1557
494
     apply_to<T>
1558
494
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
494
     , apply_cached_to<T>
1560
494
     , cache_func_to<T>
1561
494
     , external_cache
1562
494
#endif
1563
494
     );
1564
1565
494
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
494
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
494
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
494
#endif
1581
1582
494
    return hb_empty_t ();
1583
494
  }
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
1545
1
  {
1546
1
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
1
    void *external_cache = nullptr;
1550
1
    if (i < 8)
1551
1
      external_cache = external_cache_create (obj, hb_prioritize);
1552
1
#endif
1553
1554
1
    hb_applicable_t *entry = &array[i++];
1555
1556
1
    entry->init (obj,
1557
1
     apply_to<T>
1558
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
1
     , apply_cached_to<T>
1560
1
     , cache_func_to<T>
1561
1
     , external_cache
1562
1
#endif
1563
1
     );
1564
1565
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
1
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
1
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
1
#endif
1581
1582
1
    return hb_empty_t ();
1583
1
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&)
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&)
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
1545
78
  {
1546
78
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
78
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
78
    void *external_cache = nullptr;
1550
78
    if (i < 8)
1551
78
      external_cache = external_cache_create (obj, hb_prioritize);
1552
78
#endif
1553
1554
78
    hb_applicable_t *entry = &array[i++];
1555
1556
78
    entry->init (obj,
1557
78
     apply_to<T>
1558
78
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
78
     , apply_cached_to<T>
1560
78
     , cache_func_to<T>
1561
78
     , external_cache
1562
78
#endif
1563
78
     );
1564
1565
78
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
78
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
78
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
78
#endif
1581
1582
78
    return hb_empty_t ();
1583
78
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&)
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
1545
4
  {
1546
4
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
4
    void *external_cache = nullptr;
1550
4
    if (i < 8)
1551
4
      external_cache = external_cache_create (obj, hb_prioritize);
1552
4
#endif
1553
1554
4
    hb_applicable_t *entry = &array[i++];
1555
1556
4
    entry->init (obj,
1557
4
     apply_to<T>
1558
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
4
     , apply_cached_to<T>
1560
4
     , cache_func_to<T>
1561
4
     , external_cache
1562
4
#endif
1563
4
     );
1564
1565
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
4
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
4
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
4
#endif
1581
1582
4
    return hb_empty_t ();
1583
4
  }
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
1545
16
  {
1546
16
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
16
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
16
    void *external_cache = nullptr;
1550
16
    if (i < 8)
1551
16
      external_cache = external_cache_create (obj, hb_prioritize);
1552
16
#endif
1553
1554
16
    hb_applicable_t *entry = &array[i++];
1555
1556
16
    entry->init (obj,
1557
16
     apply_to<T>
1558
16
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
16
     , apply_cached_to<T>
1560
16
     , cache_func_to<T>
1561
16
     , external_cache
1562
16
#endif
1563
16
     );
1564
1565
16
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
16
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
16
    if (cost > subtable_cache_user_cost)
1576
8
    {
1577
8
      subtable_cache_user_idx = i - 1;
1578
8
      subtable_cache_user_cost = cost;
1579
8
    }
1580
16
#endif
1581
1582
16
    return hb_empty_t ();
1583
16
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::SmallTypes> >(OT::ContextFormat3_6<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
29
  {
1546
29
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
29
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
29
    void *external_cache = nullptr;
1550
29
    if (i < 8)
1551
29
      external_cache = external_cache_create (obj, hb_prioritize);
1552
29
#endif
1553
1554
29
    hb_applicable_t *entry = &array[i++];
1555
1556
29
    entry->init (obj,
1557
29
     apply_to<T>
1558
29
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
29
     , apply_cached_to<T>
1560
29
     , cache_func_to<T>
1561
29
     , external_cache
1562
29
#endif
1563
29
     );
1564
1565
29
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
29
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
29
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
29
#endif
1581
1582
29
    return hb_empty_t ();
1583
29
  }
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
1545
2
  {
1546
2
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
2
    void *external_cache = nullptr;
1550
2
    if (i < 8)
1551
2
      external_cache = external_cache_create (obj, hb_prioritize);
1552
2
#endif
1553
1554
2
    hb_applicable_t *entry = &array[i++];
1555
1556
2
    entry->init (obj,
1557
2
     apply_to<T>
1558
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
2
     , apply_cached_to<T>
1560
2
     , cache_func_to<T>
1561
2
     , external_cache
1562
2
#endif
1563
2
     );
1564
1565
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
2
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
2
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
2
#endif
1581
1582
2
    return hb_empty_t ();
1583
2
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&)
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat3_6<OT::Layout::MediumTypes> >(OT::ContextFormat3_6<OT::Layout::MediumTypes> const&)
Line
Count
Source
1545
1
  {
1546
1
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
1
    void *external_cache = nullptr;
1550
1
    if (i < 8)
1551
1
      external_cache = external_cache_create (obj, hb_prioritize);
1552
1
#endif
1553
1554
1
    hb_applicable_t *entry = &array[i++];
1555
1556
1
    entry->init (obj,
1557
1
     apply_to<T>
1558
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
1
     , apply_cached_to<T>
1560
1
     , cache_func_to<T>
1561
1
     , external_cache
1562
1
#endif
1563
1
     );
1564
1565
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
1
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
1
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
1
#endif
1581
1582
1
    return hb_empty_t ();
1583
1
  }
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
1545
139
  {
1546
139
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
139
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
139
    void *external_cache = nullptr;
1550
139
    if (i < 8)
1551
139
      external_cache = external_cache_create (obj, hb_prioritize);
1552
139
#endif
1553
1554
139
    hb_applicable_t *entry = &array[i++];
1555
1556
139
    entry->init (obj,
1557
139
     apply_to<T>
1558
139
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
139
     , apply_cached_to<T>
1560
139
     , cache_func_to<T>
1561
139
     , external_cache
1562
139
#endif
1563
139
     );
1564
1565
139
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
139
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
139
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
139
#endif
1581
1582
139
    return hb_empty_t ();
1583
139
  }
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
1545
90
  {
1546
90
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
90
    void *external_cache = nullptr;
1550
90
    if (i < 8)
1551
90
      external_cache = external_cache_create (obj, hb_prioritize);
1552
90
#endif
1553
1554
90
    hb_applicable_t *entry = &array[i++];
1555
1556
90
    entry->init (obj,
1557
90
     apply_to<T>
1558
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
90
     , apply_cached_to<T>
1560
90
     , cache_func_to<T>
1561
90
     , external_cache
1562
90
#endif
1563
90
     );
1564
1565
90
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
90
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
90
    if (cost > subtable_cache_user_cost)
1576
27
    {
1577
27
      subtable_cache_user_idx = i - 1;
1578
27
      subtable_cache_user_cost = cost;
1579
27
    }
1580
90
#endif
1581
1582
90
    return hb_empty_t ();
1583
90
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat3<OT::Layout::SmallTypes> >(OT::ChainContextFormat3<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
789
  {
1546
789
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
789
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
789
    void *external_cache = nullptr;
1550
789
    if (i < 8)
1551
694
      external_cache = external_cache_create (obj, hb_prioritize);
1552
789
#endif
1553
1554
789
    hb_applicable_t *entry = &array[i++];
1555
1556
789
    entry->init (obj,
1557
789
     apply_to<T>
1558
789
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
789
     , apply_cached_to<T>
1560
789
     , cache_func_to<T>
1561
789
     , external_cache
1562
789
#endif
1563
789
     );
1564
1565
789
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
789
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
789
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
789
#endif
1581
1582
789
    return hb_empty_t ();
1583
789
  }
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
1545
4
  {
1546
4
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
4
    void *external_cache = nullptr;
1550
4
    if (i < 8)
1551
4
      external_cache = external_cache_create (obj, hb_prioritize);
1552
4
#endif
1553
1554
4
    hb_applicable_t *entry = &array[i++];
1555
1556
4
    entry->init (obj,
1557
4
     apply_to<T>
1558
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
4
     , apply_cached_to<T>
1560
4
     , cache_func_to<T>
1561
4
     , external_cache
1562
4
#endif
1563
4
     );
1564
1565
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
4
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
4
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
4
#endif
1581
1582
4
    return hb_empty_t ();
1583
4
  }
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
1545
4
  {
1546
4
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
4
    void *external_cache = nullptr;
1550
4
    if (i < 8)
1551
4
      external_cache = external_cache_create (obj, hb_prioritize);
1552
4
#endif
1553
1554
4
    hb_applicable_t *entry = &array[i++];
1555
1556
4
    entry->init (obj,
1557
4
     apply_to<T>
1558
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
4
     , apply_cached_to<T>
1560
4
     , cache_func_to<T>
1561
4
     , external_cache
1562
4
#endif
1563
4
     );
1564
1565
4
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
4
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
4
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
4
#endif
1581
1582
4
    return hb_empty_t ();
1583
4
  }
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
1545
2
  {
1546
2
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
2
    void *external_cache = nullptr;
1550
2
    if (i < 8)
1551
2
      external_cache = external_cache_create (obj, hb_prioritize);
1552
2
#endif
1553
1554
2
    hb_applicable_t *entry = &array[i++];
1555
1556
2
    entry->init (obj,
1557
2
     apply_to<T>
1558
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
2
     , apply_cached_to<T>
1560
2
     , cache_func_to<T>
1561
2
     , external_cache
1562
2
#endif
1563
2
     );
1564
1565
2
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
2
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
2
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
2
#endif
1581
1582
2
    return hb_empty_t ();
1583
2
  }
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
1545
3
  {
1546
3
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
3
    void *external_cache = nullptr;
1550
3
    if (i < 8)
1551
3
      external_cache = external_cache_create (obj, hb_prioritize);
1552
3
#endif
1553
1554
3
    hb_applicable_t *entry = &array[i++];
1555
1556
3
    entry->init (obj,
1557
3
     apply_to<T>
1558
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
3
     , apply_cached_to<T>
1560
3
     , cache_func_to<T>
1561
3
     , external_cache
1562
3
#endif
1563
3
     );
1564
1565
3
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
3
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
3
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
3
#endif
1581
1582
3
    return hb_empty_t ();
1583
3
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&)
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
1545
1
  {
1546
1
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
1
    void *external_cache = nullptr;
1550
1
    if (i < 8)
1551
1
      external_cache = external_cache_create (obj, hb_prioritize);
1552
1
#endif
1553
1554
1
    hb_applicable_t *entry = &array[i++];
1555
1556
1
    entry->init (obj,
1557
1
     apply_to<T>
1558
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
1
     , apply_cached_to<T>
1560
1
     , cache_func_to<T>
1561
1
     , external_cache
1562
1
#endif
1563
1
     );
1564
1565
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
1
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
1
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
1
#endif
1581
1582
1
    return hb_empty_t ();
1583
1
  }
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
1545
882
  {
1546
882
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
882
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
882
    void *external_cache = nullptr;
1550
882
    if (i < 8)
1551
880
      external_cache = external_cache_create (obj, hb_prioritize);
1552
882
#endif
1553
1554
882
    hb_applicable_t *entry = &array[i++];
1555
1556
882
    entry->init (obj,
1557
882
     apply_to<T>
1558
882
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
882
     , apply_cached_to<T>
1560
882
     , cache_func_to<T>
1561
882
     , external_cache
1562
882
#endif
1563
882
     );
1564
1565
882
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
882
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
882
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
882
#endif
1581
1582
882
    return hb_empty_t ();
1583
882
  }
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
1545
5
  {
1546
5
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
5
    void *external_cache = nullptr;
1550
5
    if (i < 8)
1551
5
      external_cache = external_cache_create (obj, hb_prioritize);
1552
5
#endif
1553
1554
5
    hb_applicable_t *entry = &array[i++];
1555
1556
5
    entry->init (obj,
1557
5
     apply_to<T>
1558
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
5
     , apply_cached_to<T>
1560
5
     , cache_func_to<T>
1561
5
     , external_cache
1562
5
#endif
1563
5
     );
1564
1565
5
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
5
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
5
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
5
#endif
1581
1582
5
    return hb_empty_t ();
1583
5
  }
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
1545
8
  {
1546
8
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
8
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
8
    void *external_cache = nullptr;
1550
8
    if (i < 8)
1551
8
      external_cache = external_cache_create (obj, hb_prioritize);
1552
8
#endif
1553
1554
8
    hb_applicable_t *entry = &array[i++];
1555
1556
8
    entry->init (obj,
1557
8
     apply_to<T>
1558
8
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
8
     , apply_cached_to<T>
1560
8
     , cache_func_to<T>
1561
8
     , external_cache
1562
8
#endif
1563
8
     );
1564
1565
8
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
8
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
8
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
8
#endif
1581
1582
8
    return hb_empty_t ();
1583
8
  }
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
1545
1
  {
1546
1
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
1
    void *external_cache = nullptr;
1550
1
    if (i < 8)
1551
1
      external_cache = external_cache_create (obj, hb_prioritize);
1552
1
#endif
1553
1554
1
    hb_applicable_t *entry = &array[i++];
1555
1556
1
    entry->init (obj,
1557
1
     apply_to<T>
1558
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
1
     , apply_cached_to<T>
1560
1
     , cache_func_to<T>
1561
1
     , external_cache
1562
1
#endif
1563
1
     );
1564
1565
1
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
1
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
1
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
1
#endif
1581
1582
1
    return hb_empty_t ();
1583
1
  }
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
1545
194
  {
1546
194
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
194
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
194
    void *external_cache = nullptr;
1550
194
    if (i < 8)
1551
194
      external_cache = external_cache_create (obj, hb_prioritize);
1552
194
#endif
1553
1554
194
    hb_applicable_t *entry = &array[i++];
1555
1556
194
    entry->init (obj,
1557
194
     apply_to<T>
1558
194
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
194
     , apply_cached_to<T>
1560
194
     , cache_func_to<T>
1561
194
     , external_cache
1562
194
#endif
1563
194
     );
1564
1565
194
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
194
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
194
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
194
#endif
1581
1582
194
    return hb_empty_t ();
1583
194
  }
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
1545
14
  {
1546
14
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
14
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
14
    void *external_cache = nullptr;
1550
14
    if (i < 8)
1551
14
      external_cache = external_cache_create (obj, hb_prioritize);
1552
14
#endif
1553
1554
14
    hb_applicable_t *entry = &array[i++];
1555
1556
14
    entry->init (obj,
1557
14
     apply_to<T>
1558
14
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
14
     , apply_cached_to<T>
1560
14
     , cache_func_to<T>
1561
14
     , external_cache
1562
14
#endif
1563
14
     );
1564
1565
14
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
14
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
14
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
14
#endif
1581
1582
14
    return hb_empty_t ();
1583
14
  }
hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::SmallTypes> const&)
Line
Count
Source
1545
10
  {
1546
10
    collect_second_glyphs_ (obj, &digest_second, hb_prioritize);
1547
1548
10
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1549
10
    void *external_cache = nullptr;
1550
10
    if (i < 8)
1551
10
      external_cache = external_cache_create (obj, hb_prioritize);
1552
10
#endif
1553
1554
10
    hb_applicable_t *entry = &array[i++];
1555
1556
10
    entry->init (obj,
1557
10
     apply_to<T>
1558
10
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1559
10
     , apply_cached_to<T>
1560
10
     , cache_func_to<T>
1561
10
     , external_cache
1562
10
#endif
1563
10
     );
1564
1565
10
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1566
    /* Cache handling
1567
     *
1568
     * We allow one subtable from each lookup to use a cache. The assumption
1569
     * being that multiple subtables of the same lookup cannot use a cache
1570
     * because the resources they would use will collide.  As such, we ask
1571
     * each subtable to tell us how much it costs (which a cache would avoid),
1572
     * and we allocate the cache opportunity to the costliest subtable.
1573
     */
1574
10
    unsigned cost = cache_cost (obj, hb_prioritize);
1575
10
    if (cost > subtable_cache_user_cost)
1576
0
    {
1577
0
      subtable_cache_user_idx = i - 1;
1578
0
      subtable_cache_user_cost = cost;
1579
0
    }
1580
10
#endif
1581
1582
10
    return hb_empty_t ();
1583
10
  }
Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1_2<OT::Layout::MediumTypes> const&)
1584
148k
  static return_t default_return_value () { return hb_empty_t (); }
1585
1586
  hb_accelerate_subtables_context_t (hb_applicable_t *array_) :
1587
6.12k
             array (array_) {}
1588
1589
  hb_applicable_t *array;
1590
  unsigned i = 0;
1591
  hb_set_digest_t digest_second;
1592
1593
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1594
  unsigned subtable_cache_user_idx = (unsigned) -1;
1595
  unsigned subtable_cache_user_cost = 0;
1596
#endif
1597
};
1598
1599
1600
typedef bool (*intersects_func_t) (const hb_set_t *glyphs, unsigned value, const void *data, void *cache);
1601
typedef void (*intersected_glyphs_func_t) (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache);
1602
typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, unsigned value, const void *data);
1603
typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data);
1604
typedef unsigned (*get_value_func_t) (hb_glyph_info_t &info, const void *data);
1605
1606
/* One word per RuleSet, summarizing the classes accepted at the first
1607
 * input position after the current glyph.  Collisions only cause extra work. */
1608
struct hb_ot_layout_ruleset_digest_t
1609
{
1610
147
  void init () { mask = 0; }
1611
25
  void set_full () { mask = (uint64_t) -1; }
1612
4
  void add (unsigned value) { mask |= (uint64_t) 1 << (value & 63); }
1613
0
  bool may_have (unsigned value) const { return mask & ((uint64_t) 1 << (value & 63)); }
1614
1615
  uint64_t mask;
1616
};
1617
1618
struct ContextClosureFuncs
1619
{
1620
  intersects_func_t intersects;
1621
  intersected_glyphs_func_t intersected_glyphs;
1622
};
1623
struct ContextCollectGlyphsFuncs
1624
{
1625
  collect_glyphs_func_t collect;
1626
};
1627
struct ContextApplyFuncs
1628
{
1629
  match_func_t match;
1630
};
1631
struct ChainContextApplyFuncs
1632
{
1633
  match_func_t match[3];
1634
};
1635
1636
1637
static inline bool intersects_glyph (const hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED, void *cache HB_UNUSED)
1638
0
{
1639
0
  return glyphs->has (value);
1640
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*)
1641
static inline bool intersects_class (const hb_set_t *glyphs, unsigned value, const void *data, void *cache)
1642
0
{
1643
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1644
0
  hb_map_t *map = (hb_map_t *) cache;
1645
1646
0
  hb_codepoint_t *cached_v;
1647
0
  if (map->has (value, &cached_v))
1648
0
    return *cached_v;
1649
1650
0
  bool v = class_def.intersects_class (glyphs, value);
1651
0
  map->set (value, v);
1652
1653
0
  return v;
1654
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*)
1655
static inline bool intersects_coverage (const hb_set_t *glyphs, unsigned value, const void *data, void *cache HB_UNUSED)
1656
0
{
1657
0
  Offset32To<Coverage> coverage;
1658
0
  coverage = value;
1659
0
  return (data+coverage).intersects (glyphs);
1660
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*)
1661
1662
1663
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)
1664
0
{
1665
0
  unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value];
1666
0
  intersected_glyphs->add (g);
1667
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1668
1669
using intersected_class_cache_t = hb_hashmap_t<unsigned, hb_set_t>;
1670
1671
static inline void intersected_class_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache)
1672
0
{
1673
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1674
1675
0
  intersected_class_cache_t *map = (intersected_class_cache_t *) cache;
1676
1677
0
  hb_set_t *cached_v;
1678
0
  if (map->has (value, &cached_v))
1679
0
  {
1680
0
    intersected_glyphs->union_ (*cached_v);
1681
0
    return;
1682
0
  }
1683
1684
0
  hb_set_t v;
1685
0
  class_def.intersected_class_glyphs (glyphs, value, &v);
1686
1687
0
  intersected_glyphs->union_ (v);
1688
1689
0
  map->set (value, std::move (v));
1690
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1691
1692
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)
1693
0
{
1694
0
  Offset32To<Coverage> coverage;
1695
0
  coverage = value;
1696
0
  (data+coverage).intersect_set (*glyphs, *intersected_glyphs);
1697
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*)
1698
1699
1700
static inline bool array_is_subset_of (const hb_set_t *glyphs,
1701
               unsigned int count,
1702
               glyph_data_t values,
1703
               intersects_func_t intersects_func,
1704
               const void *intersects_data,
1705
               void *cache)
1706
0
{
1707
0
  for (unsigned i = 0; i < count; i++)
1708
0
    if (!intersects_func (glyphs, values[i], intersects_data, cache)) return false;
1709
0
  return true;
1710
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-face.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-layout.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
Unexecuted instantiation: gsubgpos-context.cc:OT::array_is_subset_of(hb_set_t const*, unsigned int, OT::glyph_data_t, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*)
1711
1712
1713
static inline void collect_glyph (hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED)
1714
0
{
1715
0
  glyphs->add (value);
1716
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.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*)
1717
static inline void collect_class (hb_set_t *glyphs, unsigned value, const void *data)
1718
0
{
1719
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1720
0
  class_def.collect_class (glyphs, value);
1721
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.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_class(hb_set_t*, unsigned int, void const*)
1722
static inline void collect_coverage (hb_set_t *glyphs, unsigned value, const void *data)
1723
0
{
1724
0
  Offset32To<Coverage> coverage;
1725
0
  coverage = value;
1726
0
  (data+coverage).collect_coverage (glyphs);
1727
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.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*)
1728
1729
inline const hb_set_t *
1730
hb_depend_context_t::find_or_create_glyph_set (const void *data,
1731
                                                unsigned value,
1732
                                                glyph_set_type_t type)
1733
0
{
1734
0
  /* Class definitions and coverages are immutable for the lifetime of the
1735
0
   * context, so their expanded glyph sets can be shared across traversals. */
1736
0
  glyph_set_cache_key_t key (data, value, type);
1737
0
  hb_codepoint_t *existing = nullptr;
1738
0
  if (glyph_set_to_index.has (key, &existing))
1739
0
    return glyph_sets[*existing].get ();
1740
0
1741
0
  hb_set_t *set = hb_object_create<hb_set_t> ();
1742
0
  if (unlikely (!set))
1743
0
  {
1744
0
    depend_data->fail ();
1745
0
    return nullptr;
1746
0
  }
1747
0
1748
0
  if (type == GLYPH_SET_COVERAGE)
1749
0
    collect_coverage (set, value, data);
1750
0
  else if (type == GLYPH_SET_CLASS)
1751
0
    collect_class (set, value, data);
1752
0
  else
1753
0
    set->add (value);
1754
0
  if (unlikely (set->in_error ()))
1755
0
  {
1756
0
    hb_set_destroy (set);
1757
0
    depend_data->fail ();
1758
0
    return nullptr;
1759
0
  }
1760
0
1761
0
  hb_codepoint_t index = glyph_sets.length;
1762
0
  if (unlikely (!glyph_sets.push_or_fail (hb::unique_ptr<hb_set_t> {set})))
1763
0
  {
1764
0
    depend_data->fail ();
1765
0
    return nullptr;
1766
0
  }
1767
0
  if (unlikely (!glyph_set_to_index.set (key, index)))
1768
0
  {
1769
0
    depend_data->fail ();
1770
0
    return nullptr;
1771
0
  }
1772
0
  return glyph_sets[index].get ();
1773
0
}
1774
1775
inline hb_codepoint_t
1776
hb_depend_context_t::find_or_create_cached_context_set (const hb_set_t *set)
1777
0
{
1778
0
  uintptr_t key = (uintptr_t) set;
1779
0
  hb_codepoint_t *existing = nullptr;
1780
0
  if (cached_context_set_indices.has (key, &existing))
1781
0
    return *existing;
1782
0
1783
0
  hb_codepoint_t index = depend_data->find_or_create_context_set (*set);
1784
0
  if (unlikely (index == HB_CODEPOINT_INVALID))
1785
0
    return HB_CODEPOINT_INVALID;
1786
0
  if (unlikely (!cached_context_set_indices.set (key, index)))
1787
0
    return depend_data->fail_invalid ();
1788
0
  return index;
1789
0
}
1790
1791
static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
1792
          hb_set_t *glyphs,
1793
          unsigned int count,
1794
          glyph_data_t values,
1795
          collect_glyphs_func_t collect_func,
1796
          const void *collect_data)
1797
0
{
1798
0
  for (unsigned i = 0; i < count; i++)
1799
0
    collect_func (glyphs, values[i], collect_data);
1800
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::collect_array(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::glyph_data_t, void (*)(hb_set_t*, unsigned int, void const*), void const*)
1801
1802
1803
static inline bool match_always (hb_glyph_info_t &info HB_UNUSED, unsigned value HB_UNUSED, const void *data HB_UNUSED)
1804
174k
{
1805
174k
  return true;
1806
174k
}
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
1804
174k
{
1805
174k
  return true;
1806
174k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*)
1807
static inline bool match_glyph (hb_glyph_info_t &info, unsigned value, const void *data HB_UNUSED)
1808
393k
{
1809
393k
  return info.codepoint == value;
1810
393k
}
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
1808
393k
{
1809
393k
  return info.codepoint == value;
1810
393k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*)
1811
static inline bool match_class (hb_glyph_info_t &info, unsigned value, const void *data)
1812
0
{
1813
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1814
0
  return class_def.get_class (info.codepoint) == value;
1815
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*)
1816
static inline unsigned get_class_value (hb_glyph_info_t &info, const void *data)
1817
0
{
1818
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *> (data);
1819
0
  return class_def.get_class (info.codepoint);
1820
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_value(hb_glyph_info_t&, void const*)
1821
struct match_class_cache_data_t
1822
{
1823
  const ClassDef *class_def;
1824
  hb_ot_layout_mapping_cache_t *cache;
1825
};
1826
static inline bool match_class_cache (hb_glyph_info_t &info, unsigned value, const void *data)
1827
0
{
1828
0
  const auto &cache_data = *reinterpret_cast<const match_class_cache_data_t *> (data);
1829
0
  return cache_data.class_def->get_class (info.codepoint, cache_data.cache) == value;
1830
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cache(hb_glyph_info_t&, unsigned int, void const*)
1831
static inline unsigned get_class_cache_value (hb_glyph_info_t &info, const void *data)
1832
0
{
1833
0
  const auto &cache_data = *reinterpret_cast<const match_class_cache_data_t *> (data);
1834
0
  return cache_data.class_def->get_class (info.codepoint, cache_data.cache);
1835
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cache_value(hb_glyph_info_t&, void const*)
1836
static inline unsigned get_class_cached (const ClassDef &class_def, hb_glyph_info_t &info)
1837
20
{
1838
20
  unsigned klass = info.syllable();
1839
20
  if (klass < 255)
1840
0
    return klass;
1841
20
  klass = class_def.get_class (info.codepoint);
1842
20
  if (likely (klass < 255))
1843
8
    info.syllable() = klass;
1844
20
  return klass;
1845
20
}
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
1837
20
{
1838
20
  unsigned klass = info.syllable();
1839
20
  if (klass < 255)
1840
0
    return klass;
1841
20
  klass = class_def.get_class (info.codepoint);
1842
20
  if (likely (klass < 255))
1843
8
    info.syllable() = klass;
1844
20
  return klass;
1845
20
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&)
1846
static inline bool match_class_cached (hb_glyph_info_t &info, unsigned value, const void *data)
1847
0
{
1848
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1849
0
  return get_class_cached (class_def, info) == value;
1850
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*)
1851
static inline unsigned get_class_cached_value (hb_glyph_info_t &info, const void *data)
1852
0
{
1853
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *> (data);
1854
0
  return get_class_cached (class_def, info);
1855
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached_value(hb_glyph_info_t&, void const*)
1856
static inline unsigned get_class_cached1 (const ClassDef &class_def, hb_glyph_info_t &info)
1857
0
{
1858
0
  unsigned klass = info.syllable() & 0x0F;
1859
0
  if (klass < 15)
1860
0
    return klass;
1861
0
  klass = class_def.get_class (info.codepoint);
1862
0
  if (likely (klass < 15))
1863
0
    info.syllable() = (info.syllable() & 0xF0) | klass;
1864
0
  return klass;
1865
0
}
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&)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&)
1866
static inline bool match_class_cached1 (hb_glyph_info_t &info, unsigned value, const void *data)
1867
0
{
1868
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1869
0
  return get_class_cached1 (class_def, info) == value;
1870
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*)
1871
static inline unsigned get_class_cached2 (const ClassDef &class_def, hb_glyph_info_t &info)
1872
135k
{
1873
135k
  unsigned klass = (info.syllable() & 0xF0) >> 4;
1874
135k
  if (klass < 15)
1875
0
    return klass;
1876
135k
  klass = class_def.get_class (info.codepoint);
1877
135k
  if (likely (klass < 15))
1878
135k
    info.syllable() = (info.syllable() & 0x0F) | (klass << 4);
1879
135k
  return klass;
1880
135k
}
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
1872
135k
{
1873
135k
  unsigned klass = (info.syllable() & 0xF0) >> 4;
1874
135k
  if (klass < 15)
1875
0
    return klass;
1876
135k
  klass = class_def.get_class (info.codepoint);
1877
135k
  if (likely (klass < 15))
1878
135k
    info.syllable() = (info.syllable() & 0x0F) | (klass << 4);
1879
135k
  return klass;
1880
135k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&)
1881
static inline bool match_class_cached2 (hb_glyph_info_t &info, unsigned value, const void *data)
1882
0
{
1883
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
1884
0
  return get_class_cached2 (class_def, info) == value;
1885
0
}
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*)
Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*)
1886
static inline unsigned get_class_cached2_value (hb_glyph_info_t &info, const void *data)
1887
0
{
1888
0
  const ClassDef &class_def = *reinterpret_cast<const ClassDef *> (data);
1889
0
  return get_class_cached2 (class_def, info);
1890
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::get_class_cached2_value(hb_glyph_info_t&, void const*)
1891
static inline bool match_coverage (hb_glyph_info_t &info, unsigned value, const void *data)
1892
5.43M
{
1893
5.43M
  Offset32To<Coverage> coverage;
1894
5.43M
  coverage = value;
1895
5.43M
  return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED;
1896
5.43M
}
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
1892
5.43M
{
1893
5.43M
  Offset32To<Coverage> coverage;
1894
5.43M
  coverage = value;
1895
5.43M
  return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED;
1896
5.43M
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*)
1897
1898
static inline bool would_match_input (hb_would_apply_context_t *c,
1899
              unsigned int count, /* Including the first glyph (not matched) */
1900
              glyph_data_t input, /* Array of input values--start with second glyph */
1901
              match_func_t match_func,
1902
              const void *match_data)
1903
0
{
1904
0
  if (count != c->len)
1905
0
    return false;
1906
1907
0
  for (unsigned int i = 1; i < count; i++)
1908
0
  {
1909
0
    hb_glyph_info_t info;
1910
0
    info.codepoint = c->glyphs[i];
1911
0
    if (likely (!match_func (info, input[i - 1], match_data)))
1912
0
      return false;
1913
0
  }
1914
1915
0
  return true;
1916
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-face.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-layout.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::would_match_input(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*)
1917
#ifndef HB_OPTIMIZE_SIZE
1918
HB_ALWAYS_INLINE
1919
#else
1920
inline
1921
#endif
1922
static bool match_input (hb_ot_apply_context_t *c,
1923
       unsigned int count, /* Including the first glyph (not matched) */
1924
       glyph_data_t input, /* Array of input values--start with second glyph */
1925
       match_func_t match_func,
1926
       const void *match_data,
1927
       unsigned int *end_position,
1928
       unsigned int *p_total_component_count = nullptr)
1929
2.58M
{
1930
2.58M
  TRACE_APPLY (nullptr);
1931
1932
2.58M
  hb_buffer_t *buffer = c->buffer;
1933
1934
2.58M
  if (count == 1)
1935
1.84M
  {
1936
1.84M
    *end_position = buffer->idx + 1;
1937
1.84M
    c->match_positions[0] = buffer->idx;
1938
1.84M
    if (p_total_component_count)
1939
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1940
1.84M
    return_trace (true);
1941
1.84M
  }
1942
1943
737k
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1944
1945
737k
  auto &skippy_iter = c->iter_input;
1946
737k
  skippy_iter.reset (buffer->idx);
1947
737k
  skippy_iter.set_match_func (match_func, match_data);
1948
737k
  skippy_iter.set_glyph_data (input);
1949
1950
  /*
1951
   * This is perhaps the trickiest part of OpenType...  Remarks:
1952
   *
1953
   * - If all components of the ligature were marks, we call this a mark ligature.
1954
   *
1955
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1956
   *   it as a ligature glyph.
1957
   *
1958
   * - Ligatures cannot be formed across glyphs attached to different components
1959
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1960
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1961
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1962
   *   There are a couple of exceptions to this:
1963
   *
1964
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1965
   *     assuming that the font designer knows what they are doing (otherwise it can
1966
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1967
   *
1968
   *   o If two marks want to ligate and they belong to different components of the
1969
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1970
   *     mark-filtering rules, then allow.
1971
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1972
   */
1973
1974
737k
  unsigned int total_component_count = 0;
1975
1976
737k
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1977
737k
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1978
1979
737k
  enum {
1980
737k
    LIGBASE_NOT_CHECKED,
1981
737k
    LIGBASE_MAY_NOT_SKIP,
1982
737k
    LIGBASE_MAY_SKIP
1983
737k
  } ligbase = LIGBASE_NOT_CHECKED;
1984
1985
896k
  for (unsigned int i = 1; i < count; i++)
1986
761k
  {
1987
761k
    unsigned unsafe_to;
1988
761k
    if (!skippy_iter.next (&unsafe_to))
1989
603k
    {
1990
603k
      *end_position = unsafe_to;
1991
603k
      return_trace (false);
1992
603k
    }
1993
1994
158k
    if (unlikely (i + 1 > c->match_positions.length &&
1995
158k
      !c->match_positions.resize_dirty  (i + 1)))
1996
0
      return_trace (false);
1997
158k
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1998
1999
158k
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
2000
158k
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
2001
2002
158k
    if (first_lig_id && first_lig_comp)
2003
0
    {
2004
      /* If first component was attached to a previous ligature component,
2005
       * all subsequent components should be attached to the same ligature
2006
       * component, otherwise we shouldn't ligate them... */
2007
0
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
2008
0
      {
2009
  /* ...unless, we are attached to a base ligature and that base
2010
   * ligature is ignorable. */
2011
0
  if (ligbase == LIGBASE_NOT_CHECKED)
2012
0
  {
2013
0
    bool found = false;
2014
0
    const auto *out = buffer->out_info;
2015
0
    unsigned int j = buffer->out_len;
2016
0
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
2017
0
    {
2018
0
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
2019
0
      {
2020
0
        j--;
2021
0
        found = true;
2022
0
        break;
2023
0
      }
2024
0
      j--;
2025
0
    }
2026
2027
0
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
2028
0
      ligbase = LIGBASE_MAY_SKIP;
2029
0
    else
2030
0
      ligbase = LIGBASE_MAY_NOT_SKIP;
2031
0
  }
2032
2033
0
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
2034
0
    return_trace (false);
2035
0
      }
2036
0
    }
2037
158k
    else
2038
158k
    {
2039
      /* If first component was NOT attached to a previous ligature component,
2040
       * all subsequent components should also NOT be attached to any ligature
2041
       * component, unless they are attached to the first component itself! */
2042
158k
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
2043
0
  return_trace (false);
2044
158k
    }
2045
2046
158k
    total_component_count += _hb_glyph_info_get_lig_num_comps_in_ligation (&buffer->info[skippy_iter.idx]);
2047
158k
  }
2048
2049
134k
  *end_position = skippy_iter.idx + 1;
2050
2051
134k
  if (p_total_component_count)
2052
66.9k
  {
2053
66.9k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
2054
66.9k
    *p_total_component_count = total_component_count;
2055
66.9k
  }
2056
2057
134k
  c->match_positions.arrayZ[0] = buffer->idx;
2058
2059
134k
  return_trace (true);
2060
737k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
hb-ot-layout.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Line
Count
Source
1929
2.58M
{
1930
2.58M
  TRACE_APPLY (nullptr);
1931
1932
2.58M
  hb_buffer_t *buffer = c->buffer;
1933
1934
2.58M
  if (count == 1)
1935
1.84M
  {
1936
1.84M
    *end_position = buffer->idx + 1;
1937
1.84M
    c->match_positions[0] = buffer->idx;
1938
1.84M
    if (p_total_component_count)
1939
0
      *p_total_component_count = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
1940
1.84M
    return_trace (true);
1941
1.84M
  }
1942
1943
737k
  if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
1944
1945
737k
  auto &skippy_iter = c->iter_input;
1946
737k
  skippy_iter.reset (buffer->idx);
1947
737k
  skippy_iter.set_match_func (match_func, match_data);
1948
737k
  skippy_iter.set_glyph_data (input);
1949
1950
  /*
1951
   * This is perhaps the trickiest part of OpenType...  Remarks:
1952
   *
1953
   * - If all components of the ligature were marks, we call this a mark ligature.
1954
   *
1955
   * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize
1956
   *   it as a ligature glyph.
1957
   *
1958
   * - Ligatures cannot be formed across glyphs attached to different components
1959
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
1960
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
1961
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
1962
   *   There are a couple of exceptions to this:
1963
   *
1964
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
1965
   *     assuming that the font designer knows what they are doing (otherwise it can
1966
   *     break Indic stuff when a matra wants to ligate with a conjunct,
1967
   *
1968
   *   o If two marks want to ligate and they belong to different components of the
1969
   *     same ligature glyph, and said ligature glyph is to be ignored according to
1970
   *     mark-filtering rules, then allow.
1971
   *     https://github.com/harfbuzz/harfbuzz/issues/545
1972
   */
1973
1974
737k
  unsigned int total_component_count = 0;
1975
1976
737k
  unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
1977
737k
  unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
1978
1979
737k
  enum {
1980
737k
    LIGBASE_NOT_CHECKED,
1981
737k
    LIGBASE_MAY_NOT_SKIP,
1982
737k
    LIGBASE_MAY_SKIP
1983
737k
  } ligbase = LIGBASE_NOT_CHECKED;
1984
1985
896k
  for (unsigned int i = 1; i < count; i++)
1986
761k
  {
1987
761k
    unsigned unsafe_to;
1988
761k
    if (!skippy_iter.next (&unsafe_to))
1989
603k
    {
1990
603k
      *end_position = unsafe_to;
1991
603k
      return_trace (false);
1992
603k
    }
1993
1994
158k
    if (unlikely (i + 1 > c->match_positions.length &&
1995
158k
      !c->match_positions.resize_dirty  (i + 1)))
1996
0
      return_trace (false);
1997
158k
    c->match_positions.arrayZ[i] = skippy_iter.idx;
1998
1999
158k
    unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
2000
158k
    unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
2001
2002
158k
    if (first_lig_id && first_lig_comp)
2003
0
    {
2004
      /* If first component was attached to a previous ligature component,
2005
       * all subsequent components should be attached to the same ligature
2006
       * component, otherwise we shouldn't ligate them... */
2007
0
      if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
2008
0
      {
2009
  /* ...unless, we are attached to a base ligature and that base
2010
   * ligature is ignorable. */
2011
0
  if (ligbase == LIGBASE_NOT_CHECKED)
2012
0
  {
2013
0
    bool found = false;
2014
0
    const auto *out = buffer->out_info;
2015
0
    unsigned int j = buffer->out_len;
2016
0
    while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
2017
0
    {
2018
0
      if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
2019
0
      {
2020
0
        j--;
2021
0
        found = true;
2022
0
        break;
2023
0
      }
2024
0
      j--;
2025
0
    }
2026
2027
0
    if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES)
2028
0
      ligbase = LIGBASE_MAY_SKIP;
2029
0
    else
2030
0
      ligbase = LIGBASE_MAY_NOT_SKIP;
2031
0
  }
2032
2033
0
  if (ligbase == LIGBASE_MAY_NOT_SKIP)
2034
0
    return_trace (false);
2035
0
      }
2036
0
    }
2037
158k
    else
2038
158k
    {
2039
      /* If first component was NOT attached to a previous ligature component,
2040
       * all subsequent components should also NOT be attached to any ligature
2041
       * component, unless they are attached to the first component itself! */
2042
158k
      if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
2043
0
  return_trace (false);
2044
158k
    }
2045
2046
158k
    total_component_count += _hb_glyph_info_get_lig_num_comps_in_ligation (&buffer->info[skippy_iter.idx]);
2047
158k
  }
2048
2049
134k
  *end_position = skippy_iter.idx + 1;
2050
2051
134k
  if (p_total_component_count)
2052
66.9k
  {
2053
66.9k
    total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur());
2054
66.9k
    *p_total_component_count = total_component_count;
2055
66.9k
  }
2056
2057
134k
  c->match_positions.arrayZ[0] = buffer->idx;
2058
2059
134k
  return_trace (true);
2060
737k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_input(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*)
2061
static inline bool ligate_input (hb_ot_apply_context_t *c,
2062
         unsigned int count, /* Including the first glyph */
2063
         unsigned int match_end,
2064
         hb_codepoint_t lig_glyph,
2065
         unsigned int total_component_count)
2066
66.9k
{
2067
66.9k
  TRACE_APPLY (nullptr);
2068
2069
66.9k
  hb_buffer_t *buffer = c->buffer;
2070
2071
66.9k
  buffer->merge_clusters (buffer->idx, match_end);
2072
2073
  /* - If a base and one or more marks ligate, consider that as a base, NOT
2074
   *   ligature, such that all following marks can still attach to it.
2075
   *   https://github.com/harfbuzz/harfbuzz/issues/1109
2076
   *
2077
   * - If all components of the ligature were marks, we call this a mark ligature.
2078
   *   If it *is* a mark ligature, we don't allocate a new ligature id, and leave
2079
   *   the ligature to keep its old ligature id.  This will allow it to attach to
2080
   *   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
2081
   *   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
2082
   *   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
2083
   *   later, we don't want them to lose their ligature id/component, otherwise
2084
   *   GPOS will fail to correctly position the mark ligature on top of the
2085
   *   LAM,LAM,HEH ligature.  See:
2086
   *     https://bugzilla.gnome.org/show_bug.cgi?id=676343
2087
   *
2088
   * - If a ligature is formed of components that some of which are also ligatures
2089
   *   themselves, and those ligature components had marks attached to *their*
2090
   *   components, we have to attach the marks to the new ligature component
2091
   *   positions!  Now *that*'s tricky!  And these marks may be following the
2092
   *   last component of the whole sequence, so we should loop forward looking
2093
   *   for them and update them.
2094
   *
2095
   *   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
2096
   *   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
2097
   *   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
2098
   *   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
2099
   *   the new ligature with a component value of 2.
2100
   *
2101
   *   This in fact happened to a font...  See:
2102
   *   https://bugzilla.gnome.org/show_bug.cgi?id=437633
2103
   */
2104
2105
66.9k
  bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]);
2106
66.9k
  bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]);
2107
134k
  for (unsigned int i = 1; i < count; i++)
2108
67.2k
    if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]]))
2109
0
    {
2110
0
      is_base_ligature = false;
2111
0
      is_mark_ligature = false;
2112
0
      break;
2113
0
    }
2114
66.9k
  bool is_ligature = !is_base_ligature && !is_mark_ligature;
2115
2116
66.9k
  unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0;
2117
66.9k
  unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0;
2118
66.9k
  unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
2119
66.9k
  unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
2120
66.9k
  unsigned int components_so_far = last_num_components;
2121
2122
66.9k
  if (is_ligature)
2123
0
  {
2124
0
    _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count);
2125
0
    if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
2126
0
    {
2127
0
      _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER);
2128
0
    }
2129
0
  }
2130
66.9k
  c->replace_glyph_with_ligature (lig_glyph, klass);
2131
2132
134k
  for (unsigned int i = 1; i < count; i++)
2133
67.2k
  {
2134
80.9k
    while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful)
2135
13.7k
    {
2136
13.7k
      if (is_ligature)
2137
0
      {
2138
0
  unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
2139
0
  if (this_comp == 0)
2140
0
    this_comp = last_num_components;
2141
0
  assert (components_so_far >= last_num_components);
2142
0
  unsigned int new_lig_comp = components_so_far - last_num_components +
2143
0
            hb_min (this_comp, last_num_components);
2144
0
    _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp);
2145
0
      }
2146
13.7k
      (void) buffer->next_glyph ();
2147
13.7k
    }
2148
2149
67.2k
    last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
2150
67.2k
    last_num_components = _hb_glyph_info_get_lig_num_comps_in_ligation (&buffer->cur());
2151
67.2k
    components_so_far += last_num_components;
2152
2153
    /* Skip the base glyph */
2154
67.2k
    buffer->idx++;
2155
67.2k
  }
2156
2157
66.9k
  if (!is_mark_ligature && last_lig_id)
2158
0
  {
2159
    /* Re-adjust components for any marks following. */
2160
0
    for (unsigned i = buffer->idx; i < buffer->len; ++i)
2161
0
    {
2162
0
      if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break;
2163
2164
0
      unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]);
2165
0
      if (!this_comp) break;
2166
2167
0
      assert (components_so_far >= last_num_components);
2168
0
      unsigned new_lig_comp = components_so_far - last_num_components +
2169
0
            hb_min (this_comp, last_num_components);
2170
0
      _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp);
2171
0
    }
2172
0
  }
2173
66.9k
  return_trace (true);
2174
66.9k
}
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
2066
66.9k
{
2067
66.9k
  TRACE_APPLY (nullptr);
2068
2069
66.9k
  hb_buffer_t *buffer = c->buffer;
2070
2071
66.9k
  buffer->merge_clusters (buffer->idx, match_end);
2072
2073
  /* - If a base and one or more marks ligate, consider that as a base, NOT
2074
   *   ligature, such that all following marks can still attach to it.
2075
   *   https://github.com/harfbuzz/harfbuzz/issues/1109
2076
   *
2077
   * - If all components of the ligature were marks, we call this a mark ligature.
2078
   *   If it *is* a mark ligature, we don't allocate a new ligature id, and leave
2079
   *   the ligature to keep its old ligature id.  This will allow it to attach to
2080
   *   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
2081
   *   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
2082
   *   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
2083
   *   later, we don't want them to lose their ligature id/component, otherwise
2084
   *   GPOS will fail to correctly position the mark ligature on top of the
2085
   *   LAM,LAM,HEH ligature.  See:
2086
   *     https://bugzilla.gnome.org/show_bug.cgi?id=676343
2087
   *
2088
   * - If a ligature is formed of components that some of which are also ligatures
2089
   *   themselves, and those ligature components had marks attached to *their*
2090
   *   components, we have to attach the marks to the new ligature component
2091
   *   positions!  Now *that*'s tricky!  And these marks may be following the
2092
   *   last component of the whole sequence, so we should loop forward looking
2093
   *   for them and update them.
2094
   *
2095
   *   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
2096
   *   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
2097
   *   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
2098
   *   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
2099
   *   the new ligature with a component value of 2.
2100
   *
2101
   *   This in fact happened to a font...  See:
2102
   *   https://bugzilla.gnome.org/show_bug.cgi?id=437633
2103
   */
2104
2105
66.9k
  bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]);
2106
66.9k
  bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]);
2107
134k
  for (unsigned int i = 1; i < count; i++)
2108
67.2k
    if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]]))
2109
0
    {
2110
0
      is_base_ligature = false;
2111
0
      is_mark_ligature = false;
2112
0
      break;
2113
0
    }
2114
66.9k
  bool is_ligature = !is_base_ligature && !is_mark_ligature;
2115
2116
66.9k
  unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0;
2117
66.9k
  unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0;
2118
66.9k
  unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
2119
66.9k
  unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur());
2120
66.9k
  unsigned int components_so_far = last_num_components;
2121
2122
66.9k
  if (is_ligature)
2123
0
  {
2124
0
    _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count);
2125
0
    if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
2126
0
    {
2127
0
      _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER);
2128
0
    }
2129
0
  }
2130
66.9k
  c->replace_glyph_with_ligature (lig_glyph, klass);
2131
2132
134k
  for (unsigned int i = 1; i < count; i++)
2133
67.2k
  {
2134
80.9k
    while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful)
2135
13.7k
    {
2136
13.7k
      if (is_ligature)
2137
0
      {
2138
0
  unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
2139
0
  if (this_comp == 0)
2140
0
    this_comp = last_num_components;
2141
0
  assert (components_so_far >= last_num_components);
2142
0
  unsigned int new_lig_comp = components_so_far - last_num_components +
2143
0
            hb_min (this_comp, last_num_components);
2144
0
    _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp);
2145
0
      }
2146
13.7k
      (void) buffer->next_glyph ();
2147
13.7k
    }
2148
2149
67.2k
    last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
2150
67.2k
    last_num_components = _hb_glyph_info_get_lig_num_comps_in_ligation (&buffer->cur());
2151
67.2k
    components_so_far += last_num_components;
2152
2153
    /* Skip the base glyph */
2154
67.2k
    buffer->idx++;
2155
67.2k
  }
2156
2157
66.9k
  if (!is_mark_ligature && last_lig_id)
2158
0
  {
2159
    /* Re-adjust components for any marks following. */
2160
0
    for (unsigned i = buffer->idx; i < buffer->len; ++i)
2161
0
    {
2162
0
      if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break;
2163
2164
0
      unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]);
2165
0
      if (!this_comp) break;
2166
2167
0
      assert (components_so_far >= last_num_components);
2168
0
      unsigned new_lig_comp = components_so_far - last_num_components +
2169
0
            hb_min (this_comp, last_num_components);
2170
0
      _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp);
2171
0
    }
2172
0
  }
2173
66.9k
  return_trace (true);
2174
66.9k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-var.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-color.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: hb-subset-table-other.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: gsubgpos-context.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int)
2175
2176
#ifndef HB_OPTIMIZE_SIZE
2177
HB_ALWAYS_INLINE
2178
#else
2179
inline
2180
#endif
2181
static bool match_backtrack (hb_ot_apply_context_t *c,
2182
           unsigned int count,
2183
           glyph_data_t backtrack,
2184
           match_func_t match_func,
2185
           const void *match_data,
2186
           unsigned int *match_start)
2187
1.37M
{
2188
1.37M
  TRACE_APPLY (nullptr);
2189
2190
1.37M
  if (!count)
2191
66.8k
  {
2192
66.8k
    *match_start = c->buffer->backtrack_len ();
2193
66.8k
    return_trace (true);
2194
66.8k
  }
2195
2196
1.30M
  auto &skippy_iter = c->iter_context;
2197
1.30M
  skippy_iter.reset_back (c->buffer->backtrack_len ());
2198
1.30M
  skippy_iter.set_match_func (match_func, match_data);
2199
1.30M
  skippy_iter.set_glyph_data (backtrack);
2200
2201
1.66M
  for (unsigned int i = 0; i < count; i++)
2202
1.65M
  {
2203
1.65M
    unsigned unsafe_from;
2204
1.65M
    if (!skippy_iter.prev (&unsafe_from))
2205
1.30M
    {
2206
1.30M
      *match_start = unsafe_from;
2207
1.30M
      return_trace (false);
2208
1.30M
    }
2209
1.65M
  }
2210
2211
4.11k
  *match_start = skippy_iter.idx;
2212
4.11k
  return_trace (true);
2213
1.30M
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
hb-ot-layout.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Line
Count
Source
2187
1.37M
{
2188
1.37M
  TRACE_APPLY (nullptr);
2189
2190
1.37M
  if (!count)
2191
66.8k
  {
2192
66.8k
    *match_start = c->buffer->backtrack_len ();
2193
66.8k
    return_trace (true);
2194
66.8k
  }
2195
2196
1.30M
  auto &skippy_iter = c->iter_context;
2197
1.30M
  skippy_iter.reset_back (c->buffer->backtrack_len ());
2198
1.30M
  skippy_iter.set_match_func (match_func, match_data);
2199
1.30M
  skippy_iter.set_glyph_data (backtrack);
2200
2201
1.66M
  for (unsigned int i = 0; i < count; i++)
2202
1.65M
  {
2203
1.65M
    unsigned unsafe_from;
2204
1.65M
    if (!skippy_iter.prev (&unsafe_from))
2205
1.30M
    {
2206
1.30M
      *match_start = unsafe_from;
2207
1.30M
      return_trace (false);
2208
1.30M
    }
2209
1.65M
  }
2210
2211
4.11k
  *match_start = skippy_iter.idx;
2212
4.11k
  return_trace (true);
2213
1.30M
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_backtrack(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*)
2214
2215
#ifndef HB_OPTIMIZE_SIZE
2216
HB_ALWAYS_INLINE
2217
#else
2218
inline
2219
#endif
2220
static bool match_lookahead (hb_ot_apply_context_t *c,
2221
           unsigned int count,
2222
           glyph_data_t lookahead,
2223
           match_func_t match_func,
2224
           const void *match_data,
2225
           unsigned int start_index,
2226
           unsigned int *end_index)
2227
1.90M
{
2228
1.90M
  TRACE_APPLY (nullptr);
2229
2230
1.90M
  if (!count)
2231
964k
  {
2232
964k
    *end_index = start_index;
2233
964k
    return_trace (true);
2234
964k
  }
2235
2236
945k
  auto &skippy_iter = c->iter_context;
2237
945k
  assert (start_index >= 1);
2238
945k
  skippy_iter.reset (start_index - 1);
2239
945k
  skippy_iter.set_match_func (match_func, match_data);
2240
945k
  skippy_iter.set_glyph_data (lookahead);
2241
2242
1.35M
  for (unsigned int i = 0; i < count; i++)
2243
945k
  {
2244
945k
    unsigned unsafe_to;
2245
945k
    if (!skippy_iter.next (&unsafe_to))
2246
534k
    {
2247
534k
      *end_index = unsafe_to;
2248
534k
      return_trace (false);
2249
534k
    }
2250
945k
  }
2251
2252
410k
  *end_index = skippy_iter.idx + 1;
2253
410k
  return_trace (true);
2254
945k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-face.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
hb-ot-layout.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Line
Count
Source
2227
1.90M
{
2228
1.90M
  TRACE_APPLY (nullptr);
2229
2230
1.90M
  if (!count)
2231
964k
  {
2232
964k
    *end_index = start_index;
2233
964k
    return_trace (true);
2234
964k
  }
2235
2236
945k
  auto &skippy_iter = c->iter_context;
2237
945k
  assert (start_index >= 1);
2238
945k
  skippy_iter.reset (start_index - 1);
2239
945k
  skippy_iter.set_match_func (match_func, match_data);
2240
945k
  skippy_iter.set_glyph_data (lookahead);
2241
2242
1.35M
  for (unsigned int i = 0; i < count; i++)
2243
945k
  {
2244
945k
    unsigned unsafe_to;
2245
945k
    if (!skippy_iter.next (&unsafe_to))
2246
534k
    {
2247
534k
      *end_index = unsafe_to;
2248
534k
      return_trace (false);
2249
534k
    }
2250
945k
  }
2251
2252
410k
  *end_index = skippy_iter.idx + 1;
2253
410k
  return_trace (true);
2254
945k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
Unexecuted instantiation: gsubgpos-context.cc:OT::match_lookahead(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*)
2255
2256
2257
2258
struct LookupRecord
2259
{
2260
  bool serialize (hb_serialize_context_t *c,
2261
      const hb_map_t         *lookup_map) const
2262
0
  {
2263
0
    TRACE_SERIALIZE (this);
2264
0
    auto *out = c->embed (*this);
2265
0
    if (unlikely (!out)) return_trace (false);
2266
2267
0
    return_trace (c->check_assign (out->lookupListIndex, lookup_map->get (lookupListIndex), HB_SERIALIZE_ERROR_INT_OVERFLOW));
2268
0
  }
2269
2270
  bool sanitize (hb_sanitize_context_t *c) const
2271
0
  {
2272
0
    TRACE_SANITIZE (this);
2273
0
    return_trace (c->check_struct (this));
2274
0
  }
2275
2276
  HBUINT16  sequenceIndex;    /* Index into current glyph
2277
           * sequence--first glyph = 0 */
2278
  HBUINT16  lookupListIndex;  /* Lookup to apply to that
2279
           * position--zero--based */
2280
  public:
2281
  DEFINE_SIZE_STATIC (4);
2282
};
2283
2284
static inline unsigned serialize_lookuprecord_array (hb_serialize_context_t *c,
2285
                 const hb_array_t<const LookupRecord> lookupRecords,
2286
                 const hb_map_t *lookup_map)
2287
0
{
2288
0
  unsigned count = 0;
2289
0
  for (const LookupRecord& r : lookupRecords)
2290
0
  {
2291
0
    if (!lookup_map->has (r.lookupListIndex))
2292
0
      continue;
2293
2294
0
    if (!r.serialize (c, lookup_map))
2295
0
      return 0;
2296
2297
0
    count++;
2298
0
  }
2299
0
  return count;
2300
0
}
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.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*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
Unexecuted instantiation: gsubgpos-context.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*)
2301
2302
enum ContextFormat { SimpleContext = 1, ClassBasedContext = 2, CoverageBasedContext = 3 };
2303
2304
static inline const hb_set_t *
2305
depend_position_glyphs (hb_depend_context_t *c,
2306
      ContextFormat context_format,
2307
      const void *data,
2308
      unsigned value,
2309
      bool filter_class_by_parent,
2310
      hb_set_t *scratch,
2311
      hb_vector_t<unsigned> *compact_workspace = nullptr)
2312
0
{
2313
0
  switch (context_format)
2314
0
  {
2315
0
    case ContextFormat::SimpleContext:
2316
0
      return c->find_or_create_glyph_set (nullptr, value,
2317
0
                                           hb_depend_context_t::GLYPH_SET_SINGLE);
2318
0
    case ContextFormat::ClassBasedContext:
2319
0
    {
2320
0
      const hb_set_t *class_set = c->find_or_create_glyph_set (
2321
0
        data, value, hb_depend_context_t::GLYPH_SET_CLASS);
2322
0
      if (unlikely (!class_set))
2323
0
  return nullptr;
2324
0
      if (!filter_class_by_parent)
2325
0
  return class_set;
2326
0
      scratch->set (*class_set);
2327
0
      scratch->intersect (c->parent_active_glyphs (), compact_workspace);
2328
0
      break;
2329
0
    }
2330
0
    case ContextFormat::CoverageBasedContext:
2331
0
      return c->find_or_create_glyph_set (
2332
0
        data, value, hb_depend_context_t::GLYPH_SET_COVERAGE);
2333
0
  }
2334
0
2335
0
  if (unlikely (scratch->in_error ()))
2336
0
  {
2337
0
    c->depend_data->fail ();
2338
0
    return nullptr;
2339
0
  }
2340
0
  return scratch;
2341
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-face.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-layout.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: gsubgpos-context.cc:OT::depend_position_glyphs(OT::hb_depend_context_t*, OT::ContextFormat, void const*, unsigned int, bool, hb_set_t*, hb_vector_t<unsigned int, false>*)
2342
2343
static inline void context_closure_recurse_lookups (hb_closure_context_t *c,
2344
               unsigned inputCount, glyph_data_t input,
2345
               unsigned lookupCount,
2346
               const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */,
2347
               unsigned value,
2348
               ContextFormat context_format,
2349
               const void *data,
2350
               intersected_glyphs_func_t intersected_glyphs_func,
2351
               void *cache)
2352
0
{
2353
0
  hb_set_t covered_seq_indicies;
2354
0
  hb_set_t pos_glyphs;
2355
0
  for (unsigned int i = 0; i < lookupCount; i++)
2356
0
  {
2357
0
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
2358
0
    if (seqIndex >= inputCount) continue;
2359
2360
0
    bool has_pos_glyphs = false;
2361
2362
0
    if (!covered_seq_indicies.has (seqIndex))
2363
0
    {
2364
0
      has_pos_glyphs = true;
2365
0
      pos_glyphs.clear ();
2366
0
      if (seqIndex == 0)
2367
0
      {
2368
0
        switch (context_format) {
2369
0
        case ContextFormat::SimpleContext:
2370
0
          pos_glyphs.add (value);
2371
0
          break;
2372
0
        case ContextFormat::ClassBasedContext:
2373
0
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
2374
0
          break;
2375
0
        case ContextFormat::CoverageBasedContext:
2376
0
          pos_glyphs.set (c->parent_active_glyphs ());
2377
0
          break;
2378
0
        }
2379
0
      }
2380
0
      else
2381
0
      {
2382
0
        const void *input_data = input.data;
2383
0
        unsigned input_value = seqIndex - 1;
2384
0
        if (context_format != ContextFormat::SimpleContext)
2385
0
        {
2386
0
          input_data = data;
2387
0
          input_value = input[seqIndex - 1];
2388
0
        }
2389
2390
0
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
2391
0
      }
2392
0
    }
2393
2394
0
    covered_seq_indicies.add (seqIndex);
2395
0
    hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs ();
2396
0
    if (unlikely (!cur_active_glyphs))
2397
0
      return;
2398
0
    if (has_pos_glyphs) {
2399
0
      *cur_active_glyphs = std::move (pos_glyphs);
2400
0
    } else {
2401
0
      *cur_active_glyphs = *c->glyphs;
2402
0
    }
2403
2404
0
    unsigned endIndex = inputCount;
2405
0
    if (context_format == ContextFormat::CoverageBasedContext)
2406
0
      endIndex += 1;
2407
2408
0
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex);
2409
2410
0
    c->pop_cur_done_glyphs ();
2411
0
  }
2412
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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-layout.cc:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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:OT::context_closure_recurse_lookups(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, 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*)
2413
2414
static bool
2415
context_depend_sets_are_cached (hb_depend_context_t *c,
2416
        unsigned input_count,
2417
        unsigned lookup_count,
2418
        const LookupRecord lookup_records[],
2419
        const void *rule,
2420
        unsigned value,
2421
        ContextFormat context_format,
2422
        const void *data,
2423
        hb_vector_t<hb_codepoint_t> *cached_context_sets)
2424
0
{
2425
0
  hb_codepoint_t active_idx = HB_CODEPOINT_INVALID;
2426
0
  bool have_active_idx = false;
2427
0
  for (unsigned i = 0; i < lookup_count; i++)
2428
0
  {
2429
0
    if (lookup_records[i].sequenceIndex >= input_count)
2430
0
      continue;
2431
0
2432
0
    if (!have_active_idx)
2433
0
    {
2434
0
      if (unlikely (!c->get_parent_active_glyphs_index (&active_idx)))
2435
0
  return false;
2436
0
      have_active_idx = true;
2437
0
    }
2438
0
2439
0
    hb_depend_context_t::context_set_cache_key_t key (
2440
0
      rule, &lookup_records[i], data, active_idx, value, context_format);
2441
0
    hb_codepoint_t *cached_context_set = nullptr;
2442
0
    if (!c->context_set_cache.has (key, &cached_context_set))
2443
0
      return false;
2444
0
    if (unlikely (!cached_context_sets->push_or_fail (*cached_context_set)))
2445
0
      return c->depend_data->fail ();
2446
0
  }
2447
0
  /* A rule with no valid records has no cache entries, and its preparation
2448
0
   * can still allocate dependency sets in an observable order. */
2449
0
  return have_active_idx;
2450
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-face.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_depend_sets_are_cached(OT::hb_depend_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, hb_vector_t<unsigned int, false>*)
2451
2452
static inline void context_depend_recurse_lookups (hb_depend_context_t *c,
2453
               unsigned inputCount, glyph_data_t input,
2454
               unsigned lookupCount,
2455
               const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */,
2456
               const void *rule,
2457
               unsigned value,
2458
               ContextFormat context_format,
2459
               const void *data,
2460
               intersected_glyphs_func_t intersected_glyphs_func,
2461
               void *cache,
2462
               const hb_set_t &preliminary_context,
2463
               const hb_vector_t<const hb_set_t *> *input_position_glyphs,
2464
               const hb_vector_t<hb_codepoint_t> *cached_context_sets,
2465
               hb_depend_context_t::depend_scratch_t *scratch)
2466
0
{
2467
0
  /* For depend graph extraction, we filter active glyphs by InputCoverage constraints
2468
0
   * (same as closure), but we do NOT do sequential accumulation of outputs.
2469
0
   *
2470
0
   * - Position filtering (InputCoverage): Required. The contextual rule can only match
2471
0
   *   glyphs in its InputCoverage. Edges for other glyphs are spurious.
2472
0
   * - Sequential accumulation: Not done. We want ALL possible edges, so we don't
2473
0
   *   limit later lookups based on outputs from earlier lookups in the same rule. */
2474
0
2475
0
  /* Sequence positions are tracked in one allocation-free bit page below.
2476
0
   * A rule longer than HB_MAX_CONTEXT_LENGTH never applies during shaping
2477
0
   * (the apply path rejects it), so skip it here instead of running past
2478
0
   * the fixed page in add_range(). */
2479
0
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH))
2480
0
    return;
2481
0
2482
0
  hb_bit_page_t covered_seq_indices;
2483
0
  hb_set_t &pos_glyphs = scratch->pos_glyphs;
2484
0
  hb_set_t &position_context = scratch->position_context;
2485
0
  hb_set_t &disjunctive_indices = scratch->disjunctive_indices;
2486
0
  hb_set_t &filtered_disjunctive_indices = scratch->filtered_disjunctive_indices;
2487
0
  unsigned cached_context_index = 0;
2488
0
  for (unsigned int i = 0; i < lookupCount; i++)
2489
0
  {
2490
0
    unsigned seqIndex = lookupRecord[i].sequenceIndex;
2491
0
    if (seqIndex >= inputCount)
2492
0
      continue;
2493
0
2494
0
    hb_depend_context_t::context_set_cache_key_t context_cache_key;
2495
0
    if (unlikely (!c->get_context_set_cache_key (rule, &lookupRecord[i], data, value,
2496
0
             context_format, &context_cache_key)))
2497
0
      return;
2498
0
2499
0
    hb_codepoint_t context_set_idx;
2500
0
    hb_codepoint_t *cached_context_set_idx;
2501
0
    if (cached_context_sets)
2502
0
      context_set_idx = (*cached_context_sets)[cached_context_index++];
2503
0
    else if (c->context_set_cache.has (context_cache_key, &cached_context_set_idx))
2504
0
      context_set_idx = *cached_context_set_idx;
2505
0
    else
2506
0
    {
2507
0
      if (unlikely (!input_position_glyphs))
2508
0
      {
2509
0
  c->depend_data->fail ();
2510
0
  return;
2511
0
      }
2512
0
2513
0
      /* Build position-specific context_set for this lookup. */
2514
0
      position_context.clear ();  // Will hold direct glyphs
2515
0
      disjunctive_indices.clear ();  // Will hold encoded set references
2516
0
      filtered_disjunctive_indices.clear ();
2517
0
2518
0
      /* Process preliminary_context in one pass. */
2519
0
      hb_codepoint_t elem = HB_SET_VALUE_INVALID;
2520
0
      while (preliminary_context.next (&elem)) {
2521
0
  if (!(elem & HB_DEPEND_CONTEXT_SET_FLAG)) {
2522
0
    /* Direct glyph */
2523
0
    position_context.add (elem);
2524
0
  } else {
2525
0
    /* Encoded set reference - defer processing until we have all direct requirements */
2526
0
    disjunctive_indices.add (elem);
2527
0
  }
2528
0
      }
2529
0
2530
0
      /* Add singleton glyphs from OTHER input positions. */
2531
0
      for (unsigned j = 0; j < input_position_glyphs->length; j++) {
2532
0
  if (j != seqIndex && (*input_position_glyphs)[j]->get_population () == 1) {
2533
0
    position_context.add ((*input_position_glyphs)[j]->get_min ());
2534
0
  }
2535
0
      }
2536
0
2537
0
      /* Now position_context has all direct requirements.
2538
0
       * Process deferred encoded sets and filter them. */
2539
0
      elem = HB_SET_VALUE_INVALID;
2540
0
      while (disjunctive_indices.next (&elem)) {
2541
0
  hb_codepoint_t set_idx = elem & 0x7FFFFFFF;
2542
0
  const hb_set_t *original_set = c->depend_data->get_set_from_index (set_idx);
2543
0
  if (unlikely (!original_set)) continue;
2544
0
2545
0
  /* Dependency context sets are never inverted. */
2546
0
  if (!original_set->intersects (position_context)) {
2547
0
    /* No overlap with position_context - add full requirement */
2548
0
    filtered_disjunctive_indices.add (elem);
2549
0
  }
2550
0
  /* Otherwise: position_context intersects with original_set.
2551
0
   * Since disjunctive requirements need only ONE glyph from the set,
2552
0
   * and position_context already has a glyph from this set, the
2553
0
   * requirement is satisfied - no need to add anything. */
2554
0
      }
2555
0
2556
0
      /* Process non-singleton input positions. */
2557
0
      for (unsigned j = 0; j < input_position_glyphs->length; j++) {
2558
0
  if (j != seqIndex && (*input_position_glyphs)[j]->get_population () > 1) {
2559
0
    /* Input-position sets are also never inverted. */
2560
0
    if (!(*input_position_glyphs)[j]->intersects (position_context)) {
2561
0
      /* No overlap with position_context - add full requirement */
2562
0
      bool cached_set = context_format == ContextFormat::CoverageBasedContext ||
2563
0
            (context_format == ContextFormat::ClassBasedContext && j != 0);
2564
0
      hb_codepoint_t idx = cached_set
2565
0
        ? c->find_or_create_cached_context_set ((*input_position_glyphs)[j])
2566
0
        : c->depend_data->find_or_create_context_set (*(*input_position_glyphs)[j]);
2567
0
      if (unlikely (idx == HB_CODEPOINT_INVALID))
2568
0
        return;
2569
0
      filtered_disjunctive_indices.add (HB_DEPEND_CONTEXT_SET_FLAG | idx);
2570
0
    }
2571
0
    /* Otherwise: position_context intersects, requirement satisfied */
2572
0
  }
2573
0
      }
2574
0
2575
0
      /* Combine direct + disjunctive. */
2576
0
      position_context.union_ (filtered_disjunctive_indices);
2577
0
      if (unlikely (position_context.in_error () ||
2578
0
        filtered_disjunctive_indices.in_error ()))
2579
0
      {
2580
0
  c->depend_data->fail ();
2581
0
  return;
2582
0
      }
2583
0
2584
0
      context_set_idx = position_context.is_empty ()
2585
0
  ? HB_CODEPOINT_INVALID
2586
0
  : c->depend_data->find_or_create_context_set (position_context);
2587
0
      if (unlikely (!position_context.is_empty () &&
2588
0
        context_set_idx == HB_CODEPOINT_INVALID))
2589
0
  return;
2590
0
2591
0
      if (unlikely (!c->context_set_cache.set (context_cache_key, context_set_idx)))
2592
0
      {
2593
0
  c->depend_data->fail ();
2594
0
  return;
2595
0
      }
2596
0
    }
2597
0
2598
0
    /* Save outer context to restore after this lookup. When a contextual lookup
2599
0
     * calls another contextual lookup, we want each lookup in this rule to see
2600
0
     * the same outer context, not context from a sibling lookup. */
2601
0
    hb_codepoint_t saved_context_set_index = c->depend_data->current_context_set_index;
2602
0
    hb_subset_depend_edge_flags_t saved_edge_flags = c->depend_data->current_edge_flags;
2603
0
2604
0
    /* Detect nested contextual: if we already have a context set, we're inside
2605
0
     * an outer contextual rule that called this one. The outer context will be
2606
0
     * lost, so edges created here may over-approximate. */
2607
0
    bool nested_contextual = (saved_context_set_index != HB_CODEPOINT_INVALID);
2608
0
2609
0
    /* Set for this position's edges */
2610
0
    c->depend_data->current_context_set_index = context_set_idx;
2611
0
2612
0
    /* Mark edges from multi-position rules (inputCount > 1) as potentially
2613
0
     * over-approximate. Depend extraction records edges based on what glyphs
2614
0
     * COULD be at each position per the static input coverage/class. But during
2615
0
     * closure computation, lookups within the rule are applied sequentially:
2616
0
     * lookups at earlier positions may transform later positions, and multiple
2617
0
     * lookups at the same position may interact (one produces a glyph, another
2618
0
     * immediately consumes it as an "intermediate"). So a glyph matching the
2619
0
     * coverage might not persist at that position when closure traverses. */
2620
0
    c->depend_data->current_edge_flags = HB_SUBSET_DEPEND_EDGE_FLAG_NONE;
2621
0
    if (inputCount > 1) {
2622
0
      c->depend_data->current_edge_flags |= HB_SUBSET_DEPEND_EDGE_FLAG_FROM_CONTEXT_POSITION;
2623
0
    }
2624
0
    if (nested_contextual) {
2625
0
      c->depend_data->current_edge_flags |= HB_SUBSET_DEPEND_EDGE_FLAG_FROM_NESTED_CONTEXT;
2626
0
    }
2627
0
2628
0
    bool has_pos_glyphs = false;
2629
0
2630
0
    if (!covered_seq_indices.has (seqIndex))
2631
0
    {
2632
0
      has_pos_glyphs = true;
2633
0
      pos_glyphs.clear ();
2634
0
      if (seqIndex == 0)
2635
0
      {
2636
0
        switch (context_format) {
2637
0
        case ContextFormat::SimpleContext:
2638
0
          pos_glyphs.add (value);
2639
0
          break;
2640
0
        case ContextFormat::ClassBasedContext:
2641
0
          intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache);
2642
0
          break;
2643
0
        case ContextFormat::CoverageBasedContext:
2644
0
          pos_glyphs.set (c->parent_active_glyphs ());
2645
0
          break;
2646
0
        }
2647
0
      }
2648
0
      else
2649
0
      {
2650
0
        const void *input_data = input.data;
2651
0
        unsigned input_value = seqIndex - 1;
2652
0
        if (context_format != ContextFormat::SimpleContext)
2653
0
        {
2654
0
          input_data = data;
2655
0
          input_value = input[seqIndex - 1];
2656
0
        }
2657
0
2658
0
        intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache);
2659
0
      }
2660
0
    }
2661
0
2662
0
    covered_seq_indices.add (seqIndex);
2663
0
    if (has_pos_glyphs)
2664
0
    {
2665
0
      hb_codepoint_t active_idx = HB_CODEPOINT_INVALID;
2666
0
      if (context_format == ContextFormat::SimpleContext)
2667
0
      {
2668
0
  hb_codepoint_t glyph = seqIndex ? pos_glyphs.get_min () : value;
2669
0
  if (likely (glyph < hb_depend_context_t::SINGLE_GLYPH_ACTIVE_FLAG))
2670
0
    active_idx = glyph | hb_depend_context_t::SINGLE_GLYPH_ACTIVE_FLAG;
2671
0
      }
2672
0
      hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs (active_idx);
2673
0
      if (unlikely (!cur_active_glyphs))
2674
0
      {
2675
0
  c->depend_data->current_context_set_index = saved_context_set_index;
2676
0
  c->depend_data->current_edge_flags = saved_edge_flags;
2677
0
  return;
2678
0
      }
2679
0
      *cur_active_glyphs = std::move (pos_glyphs);
2680
0
    }
2681
0
    else if (unlikely (!c->push_root_active_glyphs ()))
2682
0
    {
2683
0
      c->depend_data->current_context_set_index = saved_context_set_index;
2684
0
      c->depend_data->current_edge_flags = saved_edge_flags;
2685
0
      return;
2686
0
    }
2687
0
2688
0
    unsigned endIndex = inputCount;
2689
0
    if (context_format == ContextFormat::CoverageBasedContext)
2690
0
      endIndex += 1;
2691
0
2692
0
    c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indices, seqIndex, endIndex);
2693
0
    c->pop_cur_done_glyphs ();
2694
0
2695
0
    /* Restore outer context after this lookup, so subsequent lookups in this
2696
0
     * rule see the original context rather than this lookup's context. */
2697
0
    c->depend_data->current_context_set_index = saved_context_set_index;
2698
0
    c->depend_data->current_edge_flags = saved_edge_flags;
2699
0
  }
2700
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-ot-face.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_depend_recurse_lookups(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*, hb_set_t const&, hb_vector_t<hb_set_t const*, false> const*, hb_vector_t<unsigned int, false> const*, OT::hb_depend_context_t::depend_scratch_t*)
2701
2702
template <typename context_t>
2703
static inline void recurse_lookups (context_t *c,
2704
                                    unsigned int lookupCount,
2705
                                    const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */)
2706
0
{
2707
0
  for (unsigned int i = 0; i < lookupCount; i++)
2708
0
    c->recurse (lookupRecord[i].lookupListIndex);
2709
0
}
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-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-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-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-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_collect_glyphs_context_t>(OT::hb_collect_glyphs_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-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-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-subset.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-plan-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-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_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-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_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_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_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_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*)
2710
2711
static inline void apply_lookup (hb_ot_apply_context_t *c,
2712
         unsigned int count, /* Including the first glyph */
2713
         unsigned int lookupCount,
2714
         const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
2715
         unsigned int match_end)
2716
72.0k
{
2717
72.0k
  hb_buffer_t *buffer = c->buffer;
2718
72.0k
  int end;
2719
2720
  /* All positions are distance from beginning of *output* buffer.
2721
   * Adjust. */
2722
72.0k
  {
2723
72.0k
    unsigned int bl = buffer->backtrack_len ();
2724
72.0k
    end = bl + match_end - buffer->idx;
2725
2726
72.0k
    int delta = bl - buffer->idx;
2727
    /* Convert positions to new indexing. */
2728
209k
    for (unsigned int j = 0; j < count; j++)
2729
137k
      c->match_positions.arrayZ[j] += delta;
2730
72.0k
  }
2731
2732
684k
  for (unsigned int i = 0; i < lookupCount && buffer->successful; i++)
2733
612k
  {
2734
612k
    unsigned int idx = lookupRecord[i].sequenceIndex;
2735
612k
    if (idx >= count)
2736
462k
      continue;
2737
2738
149k
    unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len ();
2739
2740
    /* This can happen if earlier recursed lookups deleted many entries. */
2741
149k
    if (unlikely (c->match_positions.arrayZ[idx] >= orig_len))
2742
0
      continue;
2743
2744
149k
    if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx])))
2745
0
      break;
2746
2747
149k
    if (unlikely (buffer->max_ops <= 0))
2748
0
      break;
2749
2750
149k
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
2751
0
    {
2752
0
      if (buffer->have_output)
2753
0
        c->buffer->sync_so_far ();
2754
0
      c->buffer->message (c->font,
2755
0
        "start recursing to lookup %u at %u",
2756
0
        (unsigned) lookupRecord[i].lookupListIndex,
2757
0
        buffer->idx);
2758
0
    }
2759
2760
149k
    bool ret = c->recurse (lookupRecord[i].lookupListIndex);
2761
2762
149k
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
2763
0
    {
2764
0
      if (buffer->have_output)
2765
0
        c->buffer->sync_so_far ();
2766
0
      c->buffer->message (c->font,
2767
0
        "end recursing to lookup %u",
2768
0
        (unsigned) lookupRecord[i].lookupListIndex);
2769
0
    }
2770
2771
149k
    if (!ret)
2772
79.0k
      continue;
2773
2774
70.4k
    unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len ();
2775
70.4k
    int delta = new_len - orig_len;
2776
2777
70.4k
    if (!delta)
2778
5.13k
      continue;
2779
2780
    /* Recursed lookup changed buffer len.  Adjust.
2781
     *
2782
     * TODO:
2783
     *
2784
     * Right now, if buffer length increased by n, we assume n new glyphs
2785
     * were added right after the current position, and if buffer length
2786
     * was decreased by n, we assume n match positions after the current
2787
     * one where removed.  The former (buffer length increased) case is
2788
     * fine, but the decrease case can be improved in at least two ways,
2789
     * both of which are significant:
2790
     *
2791
     *   - If recursed-to lookup is MultipleSubst and buffer length
2792
     *     decreased, then it's current match position that was deleted,
2793
     *     NOT the one after it.
2794
     *
2795
     *   - If buffer length was decreased by n, it does not necessarily
2796
     *     mean that n match positions where removed, as there recursed-to
2797
     *     lookup might had a different LookupFlag.  Here's a constructed
2798
     *     case of that:
2799
     *     https://github.com/harfbuzz/harfbuzz/discussions/3538
2800
     *
2801
     * It should be possible to construct tests for both of these cases.
2802
     */
2803
2804
65.3k
    end += delta;
2805
65.3k
    if (end < int (c->match_positions.arrayZ[idx]))
2806
0
    {
2807
      /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed
2808
       * lookup ended up removing many items.
2809
       * Just never rewind end beyond start of current position, since that is
2810
       * not possible in the recursed lookup.  Also adjust delta as such.
2811
       *
2812
       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496
2813
       * https://github.com/harfbuzz/harfbuzz/issues/1611
2814
       */
2815
0
      delta += c->match_positions.arrayZ[idx] - end;
2816
0
      end = c->match_positions.arrayZ[idx];
2817
0
    }
2818
2819
65.3k
    unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
2820
2821
65.3k
    if (delta > 0)
2822
0
    {
2823
0
      if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
2824
0
  break;
2825
0
      if (unlikely (count + delta > c->match_positions.length &&
2826
0
        !c->match_positions.resize_dirty  (count + delta)))
2827
0
        return;
2828
0
    }
2829
65.3k
    else
2830
65.3k
    {
2831
      /* NOTE: delta is non-positive. */
2832
65.3k
      delta = hb_max (delta, (int) next - (int) count);
2833
65.3k
      next -= delta;
2834
65.3k
    }
2835
2836
    /* Shift! */
2837
65.3k
    memmove (c->match_positions + next + delta, c->match_positions + next,
2838
65.3k
       (count - next) * sizeof (c->match_positions.arrayZ[0]));
2839
65.3k
    next += delta;
2840
65.3k
    count += delta;
2841
2842
    /* Fill in new entries. */
2843
65.3k
    for (unsigned int j = idx + 1; j < next; j++)
2844
0
      c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1;
2845
2846
    /* And fixup the rest. */
2847
65.3k
    for (; next < count; next++)
2848
0
      c->match_positions.arrayZ[next] += delta;
2849
65.3k
  }
2850
2851
72.0k
  assert (end >= 0);
2852
72.0k
  (void) buffer->move_to (end);
2853
72.0k
}
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
2716
72.0k
{
2717
72.0k
  hb_buffer_t *buffer = c->buffer;
2718
72.0k
  int end;
2719
2720
  /* All positions are distance from beginning of *output* buffer.
2721
   * Adjust. */
2722
72.0k
  {
2723
72.0k
    unsigned int bl = buffer->backtrack_len ();
2724
72.0k
    end = bl + match_end - buffer->idx;
2725
2726
72.0k
    int delta = bl - buffer->idx;
2727
    /* Convert positions to new indexing. */
2728
209k
    for (unsigned int j = 0; j < count; j++)
2729
137k
      c->match_positions.arrayZ[j] += delta;
2730
72.0k
  }
2731
2732
684k
  for (unsigned int i = 0; i < lookupCount && buffer->successful; i++)
2733
612k
  {
2734
612k
    unsigned int idx = lookupRecord[i].sequenceIndex;
2735
612k
    if (idx >= count)
2736
462k
      continue;
2737
2738
149k
    unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len ();
2739
2740
    /* This can happen if earlier recursed lookups deleted many entries. */
2741
149k
    if (unlikely (c->match_positions.arrayZ[idx] >= orig_len))
2742
0
      continue;
2743
2744
149k
    if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx])))
2745
0
      break;
2746
2747
149k
    if (unlikely (buffer->max_ops <= 0))
2748
0
      break;
2749
2750
149k
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
2751
0
    {
2752
0
      if (buffer->have_output)
2753
0
        c->buffer->sync_so_far ();
2754
0
      c->buffer->message (c->font,
2755
0
        "start recursing to lookup %u at %u",
2756
0
        (unsigned) lookupRecord[i].lookupListIndex,
2757
0
        buffer->idx);
2758
0
    }
2759
2760
149k
    bool ret = c->recurse (lookupRecord[i].lookupListIndex);
2761
2762
149k
    if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ())
2763
0
    {
2764
0
      if (buffer->have_output)
2765
0
        c->buffer->sync_so_far ();
2766
0
      c->buffer->message (c->font,
2767
0
        "end recursing to lookup %u",
2768
0
        (unsigned) lookupRecord[i].lookupListIndex);
2769
0
    }
2770
2771
149k
    if (!ret)
2772
79.0k
      continue;
2773
2774
70.4k
    unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len ();
2775
70.4k
    int delta = new_len - orig_len;
2776
2777
70.4k
    if (!delta)
2778
5.13k
      continue;
2779
2780
    /* Recursed lookup changed buffer len.  Adjust.
2781
     *
2782
     * TODO:
2783
     *
2784
     * Right now, if buffer length increased by n, we assume n new glyphs
2785
     * were added right after the current position, and if buffer length
2786
     * was decreased by n, we assume n match positions after the current
2787
     * one where removed.  The former (buffer length increased) case is
2788
     * fine, but the decrease case can be improved in at least two ways,
2789
     * both of which are significant:
2790
     *
2791
     *   - If recursed-to lookup is MultipleSubst and buffer length
2792
     *     decreased, then it's current match position that was deleted,
2793
     *     NOT the one after it.
2794
     *
2795
     *   - If buffer length was decreased by n, it does not necessarily
2796
     *     mean that n match positions where removed, as there recursed-to
2797
     *     lookup might had a different LookupFlag.  Here's a constructed
2798
     *     case of that:
2799
     *     https://github.com/harfbuzz/harfbuzz/discussions/3538
2800
     *
2801
     * It should be possible to construct tests for both of these cases.
2802
     */
2803
2804
65.3k
    end += delta;
2805
65.3k
    if (end < int (c->match_positions.arrayZ[idx]))
2806
0
    {
2807
      /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed
2808
       * lookup ended up removing many items.
2809
       * Just never rewind end beyond start of current position, since that is
2810
       * not possible in the recursed lookup.  Also adjust delta as such.
2811
       *
2812
       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496
2813
       * https://github.com/harfbuzz/harfbuzz/issues/1611
2814
       */
2815
0
      delta += c->match_positions.arrayZ[idx] - end;
2816
0
      end = c->match_positions.arrayZ[idx];
2817
0
    }
2818
2819
65.3k
    unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
2820
2821
65.3k
    if (delta > 0)
2822
0
    {
2823
0
      if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
2824
0
  break;
2825
0
      if (unlikely (count + delta > c->match_positions.length &&
2826
0
        !c->match_positions.resize_dirty  (count + delta)))
2827
0
        return;
2828
0
    }
2829
65.3k
    else
2830
65.3k
    {
2831
      /* NOTE: delta is non-positive. */
2832
65.3k
      delta = hb_max (delta, (int) next - (int) count);
2833
65.3k
      next -= delta;
2834
65.3k
    }
2835
2836
    /* Shift! */
2837
65.3k
    memmove (c->match_positions + next + delta, c->match_positions + next,
2838
65.3k
       (count - next) * sizeof (c->match_positions.arrayZ[0]));
2839
65.3k
    next += delta;
2840
65.3k
    count += delta;
2841
2842
    /* Fill in new entries. */
2843
65.3k
    for (unsigned int j = idx + 1; j < next; j++)
2844
0
      c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1;
2845
2846
    /* And fixup the rest. */
2847
65.3k
    for (; next < count; next++)
2848
0
      c->match_positions.arrayZ[next] += delta;
2849
65.3k
  }
2850
2851
72.0k
  assert (end >= 0);
2852
72.0k
  (void) buffer->move_to (end);
2853
72.0k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-var.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-color.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: hb-subset-table-other.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
Unexecuted instantiation: gsubgpos-context.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int)
2854
2855
2856
2857
/* Contextual lookups */
2858
2859
struct ContextClosureLookupContext
2860
{
2861
  ContextClosureFuncs funcs;
2862
  ContextFormat context_format;
2863
  const void *intersects_data;
2864
  void *intersects_cache;
2865
  void *intersected_glyphs_cache;
2866
};
2867
2868
typedef ContextClosureLookupContext ContextDependLookupContext;
2869
2870
struct ContextCollectGlyphsLookupContext
2871
{
2872
  ContextCollectGlyphsFuncs funcs;
2873
  const void *collect_data;
2874
};
2875
2876
struct ContextApplyLookupContext
2877
{
2878
  ContextApplyFuncs funcs;
2879
  const void *match_data;
2880
  get_value_func_t get_value;
2881
};
2882
2883
static inline bool context_intersects (const hb_set_t *glyphs,
2884
               unsigned int inputCount, /* Including the first glyph (not matched) */
2885
               glyph_data_t input, /* Array of input values--start with second glyph */
2886
               ContextClosureLookupContext &lookup_context)
2887
0
{
2888
0
  return array_is_subset_of (glyphs,
2889
0
           inputCount ? inputCount - 1 : 0, input,
2890
0
           lookup_context.funcs.intersects,
2891
0
           lookup_context.intersects_data,
2892
0
           lookup_context.intersects_cache);
2893
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, OT::ContextClosureLookupContext&)
2894
2895
static inline void context_closure_lookup (hb_closure_context_t *c,
2896
             unsigned int inputCount, /* Including the first glyph (not matched) */
2897
             glyph_data_t input, /* Array of input values--start with second glyph */
2898
             unsigned int lookupCount,
2899
             const LookupRecord lookupRecord[],
2900
             unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */
2901
             ContextClosureLookupContext &lookup_context)
2902
0
{
2903
0
  if (context_intersects (c->glyphs,
2904
0
        inputCount, input,
2905
0
        lookup_context))
2906
0
    context_closure_recurse_lookups (c,
2907
0
             inputCount, input,
2908
0
             lookupCount, lookupRecord,
2909
0
             value,
2910
0
             lookup_context.context_format,
2911
0
             lookup_context.intersects_data,
2912
0
             lookup_context.funcs.intersected_glyphs,
2913
0
             lookup_context.intersected_glyphs_cache);
2914
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&)
2915
2916
static inline void context_depend_lookup (hb_depend_context_t *c,
2917
            unsigned int inputCount, /* Including the first glyph (not matched) */
2918
            glyph_data_t input, /* Array of input values--start with second glyph */
2919
            unsigned int lookupCount,
2920
            const LookupRecord lookupRecord[],
2921
            const void *rule,
2922
            unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */
2923
            ContextDependLookupContext &lookup_context)
2924
0
{
2925
0
  if (!context_intersects (c->glyphs,
2926
0
         inputCount, input,
2927
0
         lookup_context))
2928
0
    return;
2929
0
2930
0
  hb_depend_context_t::depend_scratch_t *scratch = c->acquire_depend_scratch ();
2931
0
  if (unlikely (!scratch))
2932
0
    return;
2933
0
  HB_SCOPE_GUARD (c->release_depend_scratch (scratch));
2934
0
2935
0
  bool context_sets_cached = context_depend_sets_are_cached (
2936
0
    c, inputCount, lookupCount, lookupRecord, rule, value,
2937
0
    lookup_context.context_format, lookup_context.intersects_data,
2938
0
    &scratch->cached_context_sets);
2939
0
  if (unlikely (!c->depend_data->successful))
2940
0
    return;
2941
0
2942
0
  /* Build preliminary_context (empty for ContextSubst - no backtrack/lookahead) */
2943
0
  hb_set_t &preliminary_context = scratch->preliminary_context;
2944
0
2945
0
  /* Build glyph sets for ALL input positions */
2946
0
  hb_set_t &position_scratch = scratch->position_scratch;
2947
0
  hb_vector_t<const hb_set_t *> &input_position_glyphs = scratch->input_position_glyphs;
2948
0
2949
0
  /* Cached labels no longer need the expanded input-position sets. */
2950
0
  if (!context_sets_cached)
2951
0
  {
2952
0
    /* Position 0 (Coverage glyph) — must be in both the class AND the
2953
0
     * coverage, so intersect with parent_active_glyphs (= coverage ∩ glyphs
2954
0
     * set by the ContextFormat2/3 caller). */
2955
0
    const hb_set_t *pos0_glyphs = depend_position_glyphs (
2956
0
      c, lookup_context.context_format, lookup_context.intersects_data, value,
2957
0
      true, &position_scratch, &scratch->compact_workspace);
2958
0
    if (unlikely (!pos0_glyphs ||
2959
0
      !input_position_glyphs.push_or_fail (pos0_glyphs)))
2960
0
    {
2961
0
      c->depend_data->fail ();
2962
0
      return;
2963
0
    }
2964
0
2965
0
    /* Positions 1+ (Input array) */
2966
0
    for (unsigned i = 0; i + 1 < inputCount; i++)
2967
0
    {
2968
0
      const hb_set_t *pos_glyphs = depend_position_glyphs (
2969
0
  c, lookup_context.context_format, lookup_context.intersects_data,
2970
0
  input[i], false, &position_scratch);
2971
0
      if (unlikely (!pos_glyphs ||
2972
0
        !input_position_glyphs.push_or_fail (pos_glyphs)))
2973
0
      {
2974
0
  c->depend_data->fail ();
2975
0
  return;
2976
0
      }
2977
0
    }
2978
0
  }
2979
0
2980
0
  context_depend_recurse_lookups (c,
2981
0
          inputCount, input,
2982
0
          lookupCount, lookupRecord,
2983
0
          rule,
2984
0
          value,
2985
0
          lookup_context.context_format,
2986
0
          lookup_context.intersects_data,
2987
0
          lookup_context.funcs.intersected_glyphs,
2988
0
          lookup_context.intersected_glyphs_cache,
2989
0
          preliminary_context,
2990
0
          context_sets_cached ? nullptr : &input_position_glyphs,
2991
0
          context_sets_cached ? &scratch->cached_context_sets : nullptr,
2992
0
          scratch);
2993
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ContextClosureLookupContext&)
2994
2995
static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
2996
              unsigned int inputCount, /* Including the first glyph (not matched) */
2997
              glyph_data_t input, /* Array of input values--start with second glyph */
2998
              unsigned int lookupCount,
2999
              const LookupRecord lookupRecord[],
3000
              ContextCollectGlyphsLookupContext &lookup_context)
3001
0
{
3002
0
  collect_array (c, c->input,
3003
0
     inputCount ? inputCount - 1 : 0, input,
3004
0
     lookup_context.funcs.collect, lookup_context.collect_data);
3005
0
  recurse_lookups (c,
3006
0
       lookupCount, lookupRecord);
3007
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&)
3008
3009
static inline bool context_would_apply_lookup (hb_would_apply_context_t *c,
3010
                 unsigned int inputCount, /* Including the first glyph (not matched) */
3011
                 glyph_data_t input, /* Array of input values--start with second glyph */
3012
                 unsigned int lookupCount HB_UNUSED,
3013
                 const LookupRecord lookupRecord[] HB_UNUSED,
3014
                 const ContextApplyLookupContext &lookup_context)
3015
0
{
3016
0
  return would_match_input (c,
3017
0
          inputCount, input,
3018
0
          lookup_context.funcs.match, lookup_context.match_data);
3019
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
3020
3021
static inline bool context_apply_lookup (hb_ot_apply_context_t *c,
3022
           unsigned int inputCount, /* Including the first glyph (not matched) */
3023
           glyph_data_t input, /* Array of input values--start with second glyph */
3024
           unsigned int lookupCount,
3025
           const LookupRecord lookupRecord[],
3026
           const ContextApplyLookupContext &lookup_context)
3027
1.12k
{
3028
1.12k
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3029
3030
1.12k
  unsigned match_end = 0;
3031
1.12k
  bool ret = false;
3032
1.12k
  if (match_input (c,
3033
1.12k
       inputCount, input,
3034
1.12k
       lookup_context.funcs.match, lookup_context.match_data,
3035
1.12k
       &match_end))
3036
1.12k
  {
3037
1.12k
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
3038
1.12k
    apply_lookup (c,
3039
1.12k
      inputCount,
3040
1.12k
      lookupCount, lookupRecord,
3041
1.12k
      match_end);
3042
1.12k
    ret = true;
3043
1.12k
  }
3044
0
  else
3045
0
  {
3046
0
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
3047
0
    ret = false;
3048
0
  }
3049
3050
1.12k
  return ret;
3051
1.12k
}
Unexecuted instantiation: hb-aat-layout.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
hb-ot-layout.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Line
Count
Source
3027
1.12k
{
3028
1.12k
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
3029
3030
1.12k
  unsigned match_end = 0;
3031
1.12k
  bool ret = false;
3032
1.12k
  if (match_input (c,
3033
1.12k
       inputCount, input,
3034
1.12k
       lookup_context.funcs.match, lookup_context.match_data,
3035
1.12k
       &match_end))
3036
1.12k
  {
3037
1.12k
    c->buffer->unsafe_to_break (c->buffer->idx, match_end);
3038
1.12k
    apply_lookup (c,
3039
1.12k
      inputCount,
3040
1.12k
      lookupCount, lookupRecord,
3041
1.12k
      match_end);
3042
1.12k
    ret = true;
3043
1.12k
  }
3044
0
  else
3045
0
  {
3046
0
    c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
3047
0
    ret = false;
3048
0
  }
3049
3050
1.12k
  return ret;
3051
1.12k
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&)
3052
3053
static inline bool context_cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
3054
248
{
3055
248
  switch (op)
3056
248
  {
3057
124
    case hb_ot_subtable_cache_op_t::ENTER:
3058
124
    {
3059
124
      if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable))
3060
0
  return false;
3061
124
      auto &info = c->buffer->info;
3062
124
      unsigned count = c->buffer->len;
3063
763k
      for (unsigned i = 0; i < count; i++)
3064
763k
  info[i].syllable() = 255;
3065
124
      c->new_syllables = 255;
3066
124
      return true;
3067
124
    }
3068
124
    case hb_ot_subtable_cache_op_t::LEAVE:
3069
124
    {
3070
124
      c->new_syllables = (unsigned) -1;
3071
124
      HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable);
3072
124
      break;
3073
124
    }
3074
248
  }
3075
124
  return false;
3076
248
}
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
3054
248
{
3055
248
  switch (op)
3056
248
  {
3057
124
    case hb_ot_subtable_cache_op_t::ENTER:
3058
124
    {
3059
124
      if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable))
3060
0
  return false;
3061
124
      auto &info = c->buffer->info;
3062
124
      unsigned count = c->buffer->len;
3063
763k
      for (unsigned i = 0; i < count; i++)
3064
763k
  info[i].syllable() = 255;
3065
124
      c->new_syllables = 255;
3066
124
      return true;
3067
124
    }
3068
124
    case hb_ot_subtable_cache_op_t::LEAVE:
3069
124
    {
3070
124
      c->new_syllables = (unsigned) -1;
3071
124
      HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable);
3072
124
      break;
3073
124
    }
3074
248
  }
3075
124
  return false;
3076
248
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-var.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-color.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: hb-subset-table-other.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Unexecuted instantiation: gsubgpos-context.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
3077
3078
template <typename Types>
3079
struct Rule
3080
{
3081
  template <typename SetTypes, typename RuleType>
3082
  friend struct RuleSetOf;
3083
3084
  bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const
3085
0
  {
3086
0
    return context_intersects (glyphs,
3087
0
             inputCount, inputZ.arrayZ,
3088
0
             lookup_context);
3089
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
3090
3091
  void depend (hb_depend_context_t *c, unsigned value, ContextDependLookupContext &lookup_context) const
3092
0
  {
3093
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3094
0
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
3095
0
    context_depend_lookup (c,
3096
0
         inputCount, inputZ.arrayZ,
3097
0
         lookupCount, lookupRecord.arrayZ,
3098
0
         this,
3099
0
         value, lookup_context);
3100
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
3101
3102
  void closure (hb_closure_context_t *c, unsigned value, ContextClosureLookupContext &lookup_context) const
3103
0
  {
3104
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
3105
3106
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3107
0
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
3108
0
    context_closure_lookup (c,
3109
0
          inputCount, inputZ.arrayZ,
3110
0
          lookupCount, lookupRecord.arrayZ,
3111
0
          value, lookup_context);
3112
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
3113
3114
  void closure_lookups (hb_closure_lookups_context_t *c,
3115
                        ContextClosureLookupContext &lookup_context) const
3116
0
  {
3117
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
3118
0
    if (!intersects (c->glyphs, lookup_context)) return;
3119
3120
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3121
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
3122
0
    recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
3123
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
3124
3125
  void collect_glyphs (hb_collect_glyphs_context_t *c,
3126
           ContextCollectGlyphsLookupContext &lookup_context) const
3127
0
  {
3128
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3129
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
3130
0
    context_collect_glyphs_lookup (c,
3131
0
           inputCount, inputZ.arrayZ,
3132
0
           lookupCount, lookupRecord.arrayZ,
3133
0
           lookup_context);
3134
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
3135
3136
  void collect_second_glyphs (hb_set_digest_t *digest,
3137
            const ClassDef *class_def = nullptr) const
3138
706
  {
3139
706
    if (inputCount <= 1)
3140
591
    {
3141
591
      *digest = hb_set_digest_t::full ();
3142
591
      return;
3143
591
    }
3144
3145
115
    unsigned second = inputZ.arrayZ[0];
3146
115
    if (!class_def)
3147
0
      digest->add (second);
3148
115
    else if (!second)
3149
66
      *digest = hb_set_digest_t::full ();
3150
49
    else
3151
49
      class_def->collect_class (digest, second);
3152
115
  }
OT::Rule<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const
Line
Count
Source
3138
706
  {
3139
706
    if (inputCount <= 1)
3140
591
    {
3141
591
      *digest = hb_set_digest_t::full ();
3142
591
      return;
3143
591
    }
3144
3145
115
    unsigned second = inputZ.arrayZ[0];
3146
115
    if (!class_def)
3147
0
      digest->add (second);
3148
115
    else if (!second)
3149
66
      *digest = hb_set_digest_t::full ();
3150
49
    else
3151
49
      class_def->collect_class (digest, second);
3152
115
  }
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const
3153
3154
  bool would_apply (hb_would_apply_context_t *c,
3155
        const ContextApplyLookupContext &lookup_context) const
3156
0
  {
3157
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3158
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
3159
0
    return context_would_apply_lookup (c,
3160
0
               inputCount, inputZ.arrayZ,
3161
0
               lookupCount, lookupRecord.arrayZ,
3162
0
               lookup_context);
3163
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
3164
3165
  bool apply (hb_ot_apply_context_t *c,
3166
        const ContextApplyLookupContext &lookup_context) const
3167
0
  {
3168
0
    TRACE_APPLY (this);
3169
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3170
0
             (inputZ.as_array (inputCount ? inputCount - 1 : 0));
3171
0
    return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
3172
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const
3173
3174
  bool serialize (hb_serialize_context_t *c,
3175
      const hb_map_t *input_mapping, /* old->new glyphid or class mapping */
3176
      const hb_map_t *lookup_map) const
3177
0
  {
3178
0
    TRACE_SERIALIZE (this);
3179
0
    auto *out = c->start_embed (this);
3180
0
    if (unlikely (!c->extend_min (out))) return_trace (false);
3181
3182
0
    out->inputCount = inputCount;
3183
0
    const auto input = inputZ.as_array (inputCount - 1);
3184
0
    for (const auto org : input)
3185
0
    {
3186
0
      typename Types::HBUINT d;
3187
0
      d = input_mapping->get (org);
3188
0
      c->copy (d);
3189
0
    }
3190
3191
0
    const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
3192
0
             (inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
3193
3194
0
    unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
3195
0
    return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
3196
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const
3197
3198
  bool subset (hb_subset_context_t *c,
3199
         const hb_map_t *lookup_map,
3200
         const hb_map_t *klass_map = nullptr) const
3201
0
  {
3202
0
    TRACE_SUBSET (this);
3203
0
    if (unlikely (!inputCount)) return_trace (false);
3204
0
    const auto input = inputZ.as_array (inputCount - 1);
3205
3206
0
    const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
3207
0
    if (!hb_all (input, mapping)) return_trace (false);
3208
0
    return_trace (serialize (c->serializer, mapping, lookup_map));
3209
0
  }
Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
3210
3211
  public:
3212
  bool sanitize (hb_sanitize_context_t *c) const
3213
5.96k
  {
3214
5.96k
    TRACE_SANITIZE (this);
3215
5.96k
    return_trace (c->check_struct (this) &&
3216
5.96k
      hb_barrier () &&
3217
5.96k
      c->check_range (inputZ.arrayZ,
3218
5.96k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
3219
5.96k
          LookupRecord::static_size * lookupCount));
3220
5.96k
  }
OT::Rule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3213
5.86k
  {
3214
5.86k
    TRACE_SANITIZE (this);
3215
5.86k
    return_trace (c->check_struct (this) &&
3216
5.86k
      hb_barrier () &&
3217
5.86k
      c->check_range (inputZ.arrayZ,
3218
5.86k
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
3219
5.86k
          LookupRecord::static_size * lookupCount));
3220
5.86k
  }
OT::Rule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3213
98
  {
3214
98
    TRACE_SANITIZE (this);
3215
98
    return_trace (c->check_struct (this) &&
3216
98
      hb_barrier () &&
3217
98
      c->check_range (inputZ.arrayZ,
3218
98
          inputZ.item_size * (inputCount ? inputCount - 1 : 0) +
3219
98
          LookupRecord::static_size * lookupCount));
3220
98
  }
3221
3222
  protected:
3223
  HBUINT16  inputCount;   /* Total number of glyphs in input
3224
           * glyph sequence--includes the first
3225
           * glyph */
3226
  HBUINT16  lookupCount;    /* Number of LookupRecords */
3227
  UnsizedArrayOf<typename Types::HBUINT>
3228
    inputZ;     /* Array of match inputs--start with
3229
           * second glyph */
3230
/*UnsizedArrayOf<LookupRecord>
3231
    lookupRecordX;*/  /* Array of LookupRecords--in
3232
           * design order */
3233
  public:
3234
  DEFINE_SIZE_ARRAY (4, inputZ);
3235
};
3236
3237
template <typename Types, typename RuleType>
3238
struct RuleSetOf
3239
{
3240
  bool intersects (const hb_set_t *glyphs,
3241
       ContextClosureLookupContext &lookup_context) const
3242
0
  {
3243
0
    return
3244
0
    + hb_iter (rule)
3245
0
    | hb_map (hb_add (this))
3246
0
    | hb_map ([&] (const RuleType &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<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
3247
0
    | hb_any
3248
0
    ;
3249
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const
3250
3251
  void collect_first_input_classes (hb_ot_layout_ruleset_digest_t *digest) const
3252
138
  {
3253
138
    digest->init ();
3254
138
    for (unsigned i = 0; i < rule.len; i++)
3255
19
    {
3256
19
      const RuleType &r = this+rule.arrayZ[i];
3257
19
      if (r.inputCount <= 1)
3258
19
      {
3259
19
  digest->set_full ();
3260
19
  return;
3261
19
      }
3262
0
      digest->add (r.inputZ.arrayZ[0]);
3263
0
    }
3264
138
  }
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_first_input_classes(OT::hb_ot_layout_ruleset_digest_t*) const
Line
Count
Source
3252
138
  {
3253
138
    digest->init ();
3254
138
    for (unsigned i = 0; i < rule.len; i++)
3255
19
    {
3256
19
      const RuleType &r = this+rule.arrayZ[i];
3257
19
      if (r.inputCount <= 1)
3258
19
      {
3259
19
  digest->set_full ();
3260
19
  return;
3261
19
      }
3262
0
      digest->add (r.inputZ.arrayZ[0]);
3263
0
    }
3264
138
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_first_input_classes(OT::hb_ot_layout_ruleset_digest_t*) const
3265
3266
  void depend (hb_depend_context_t *c, unsigned value, ContextDependLookupContext &lookup_context) const
3267
0
  {
3268
0
    + hb_iter (rule)
3269
0
    | hb_map (hb_add (this))
3270
0
    | hb_apply ([&] (const RuleType &_) { _.depend (c, value, lookup_context); })
3271
0
    ;
3272
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
3273
3274
  void closure (hb_closure_context_t *c, unsigned value,
3275
    ContextClosureLookupContext &lookup_context) const
3276
0
  {
3277
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
3278
3279
0
    return
3280
0
    + hb_iter (rule)
3281
0
    | hb_map (hb_add (this))
3282
0
    | hb_apply ([&] (const RuleType &_) { _.closure (c, value, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<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
3283
0
    ;
3284
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const
3285
3286
  void closure_lookups (hb_closure_lookups_context_t *c,
3287
                        ContextClosureLookupContext &lookup_context) const
3288
0
  {
3289
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
3290
0
    + hb_iter (rule)
3291
0
    | hb_map (hb_add (this))
3292
0
    | hb_apply ([&] (const RuleType &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<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
3293
0
    ;
3294
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const
3295
3296
  void collect_glyphs (hb_collect_glyphs_context_t *c,
3297
           ContextCollectGlyphsLookupContext &lookup_context) const
3298
0
  {
3299
0
    return
3300
0
    + hb_iter (rule)
3301
0
    | hb_map (hb_add (this))
3302
0
    | hb_apply ([&] (const RuleType &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<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
3303
0
    ;
3304
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const
3305
3306
  void collect_second_glyphs (hb_set_digest_t *digest,
3307
            const ClassDef *class_def = nullptr) const
3308
148
  {
3309
148
    + hb_iter (rule)
3310
148
    | hb_map (hb_add (this))
3311
706
    | hb_apply ([=] (const RuleType &_) { _.collect_second_glyphs (digest, class_def); })
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3311
706
    | hb_apply ([=] (const RuleType &_) { _.collect_second_glyphs (digest, class_def); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
3312
148
    ;
3313
148
  }
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const
Line
Count
Source
3308
148
  {
3309
148
    + hb_iter (rule)
3310
148
    | hb_map (hb_add (this))
3311
148
    | hb_apply ([=] (const RuleType &_) { _.collect_second_glyphs (digest, class_def); })
3312
148
    ;
3313
148
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*) const
3314
3315
  bool would_apply (hb_would_apply_context_t *c,
3316
        const ContextApplyLookupContext &lookup_context) const
3317
0
  {
3318
0
    return
3319
0
    + hb_iter (rule)
3320
0
    | hb_map (hb_add (this))
3321
0
    | hb_map ([&] (const RuleType &_) { return _.would_apply (c, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<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
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<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
3322
0
    | hb_any
3323
0
    ;
3324
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const
3325
3326
  bool apply (hb_ot_apply_context_t *c,
3327
        const ContextApplyLookupContext &lookup_context,
3328
        const hb_ot_layout_ruleset_digest_t *digest = nullptr) const
3329
20
  {
3330
20
    TRACE_APPLY (this);
3331
3332
20
    unsigned num_rules = rule.len;
3333
3334
20
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3335
20
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3336
20
#endif
3337
20
    {
3338
20
    slow:
3339
20
      return_trace (
3340
20
      + hb_iter (rule)
3341
20
      | hb_map (hb_add (this))
3342
20
      | hb_map ([&] (const RuleType &_) { return _.apply (c, lookup_context); })
3343
20
      | hb_any
3344
20
      )
3345
20
      ;
3346
20
    }
3347
3348
    /* This version is optimized for speed by matching the first & second
3349
     * components of the rule here, instead of calling into the matching code.
3350
     *
3351
     * Replicated from LigatureSet::apply(). */
3352
3353
    /* We use the iter_context instead of iter_input, to avoid skipping
3354
     * default-ignorables and such.
3355
     *
3356
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3357
     */
3358
0
    auto &skippy_iter = c->iter_context;
3359
0
    skippy_iter.reset (c->buffer->idx);
3360
0
    skippy_iter.set_match_func (match_always, nullptr);
3361
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3362
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3363
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3364
0
    bool matched = skippy_iter.next (&unsafe_to1);
3365
0
    if (likely (matched))
3366
0
    {
3367
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3368
0
      {
3369
  /* Can't use the fast path if eg. the next char is a default-ignorable
3370
   * or other skippable. */
3371
0
        goto slow;
3372
0
      }
3373
3374
0
      first = &c->buffer->info[skippy_iter.idx];
3375
0
      unsafe_to1 = skippy_iter.idx + 1;
3376
3377
0
      if (digest && lookup_context.get_value &&
3378
0
    !digest->may_have (lookup_context.get_value (*first, lookup_context.match_data)))
3379
0
  {
3380
0
    c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
3381
0
    return_trace (false);
3382
0
  }
3383
0
    }
3384
0
    else
3385
0
    {
3386
0
      bool unsafe_to_concat = false;
3387
0
      bool ret =
3388
0
      + hb_iter (rule)
3389
0
      | hb_map (hb_add (this))
3390
0
      | hb_filter ([&] (const RuleType &_)
3391
0
       {
3392
0
         if (_.inputCount <= 1) return true;
3393
0
         unsafe_to_concat = true;
3394
0
         return false;
3395
0
       })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#2}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#2}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#2}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
3396
0
      | hb_map ([&] (const RuleType &_) { return _.apply (c, lookup_context); })
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#3}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#3}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#3}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) const
3397
0
      | hb_any
3398
0
      ;
3399
0
      if (unsafe_to_concat)
3400
0
  c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
3401
0
      return_trace (ret);
3402
0
    }
3403
0
    matched = skippy_iter.next ();
3404
0
    if (likely (matched))
3405
0
    {
3406
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3407
0
      {
3408
  /* Can't use the fast path if eg. the next char is a default-ignorable
3409
   * or other skippable. */
3410
0
        goto slow;
3411
0
      }
3412
3413
0
      second = &c->buffer->info[skippy_iter.idx];
3414
0
      unsafe_to2 = skippy_iter.idx + 1;
3415
0
    }
3416
3417
0
    auto match_input = lookup_context.funcs.match;
3418
0
    auto *input_data = lookup_context.match_data;
3419
0
    for (unsigned int i = 0; i < num_rules; i++)
3420
0
    {
3421
0
      const auto &r = this+rule.arrayZ[i];
3422
3423
0
      const auto &input = r.inputZ;
3424
3425
0
      if (r.inputCount <= 1 ||
3426
0
    (!match_input ||
3427
0
     match_input (*first, input.arrayZ[0], input_data)))
3428
0
      {
3429
0
        if (!second ||
3430
0
      (r.inputCount <= 2 ||
3431
0
       (!match_input ||
3432
0
        match_input (*second, input.arrayZ[1], input_data)))
3433
0
     )
3434
0
  {
3435
0
    if (r.apply (c, lookup_context))
3436
0
    {
3437
0
      if (unsafe_to != (unsigned) -1)
3438
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3439
0
      return_trace (true);
3440
0
    }
3441
0
  }
3442
0
  else
3443
0
    unsafe_to = unsafe_to2;
3444
0
      }
3445
0
      else
3446
0
      {
3447
0
  if (unsafe_to == (unsigned) -1)
3448
0
    unsafe_to = unsafe_to1;
3449
3450
  // Skip ahead to next possible first glyph match.
3451
0
  for (; i + 1 < num_rules; i++)
3452
0
  {
3453
0
    const auto &r2 = this+rule.arrayZ[i + 1];
3454
0
    const auto &input2 = r2.inputZ;
3455
0
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3456
0
      break;
3457
0
  }
3458
0
      }
3459
0
    }
3460
0
    if (likely (unsafe_to != (unsigned) -1))
3461
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3462
3463
0
    return_trace (false);
3464
0
  }
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
Line
Count
Source
3329
20
  {
3330
20
    TRACE_APPLY (this);
3331
3332
20
    unsigned num_rules = rule.len;
3333
3334
20
#ifndef HB_NO_OT_RULESETS_FAST_PATH
3335
20
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
3336
20
#endif
3337
20
    {
3338
20
    slow:
3339
20
      return_trace (
3340
20
      + hb_iter (rule)
3341
20
      | hb_map (hb_add (this))
3342
20
      | hb_map ([&] (const RuleType &_) { return _.apply (c, lookup_context); })
3343
20
      | hb_any
3344
20
      )
3345
20
      ;
3346
20
    }
3347
3348
    /* This version is optimized for speed by matching the first & second
3349
     * components of the rule here, instead of calling into the matching code.
3350
     *
3351
     * Replicated from LigatureSet::apply(). */
3352
3353
    /* We use the iter_context instead of iter_input, to avoid skipping
3354
     * default-ignorables and such.
3355
     *
3356
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
3357
     */
3358
0
    auto &skippy_iter = c->iter_context;
3359
0
    skippy_iter.reset (c->buffer->idx);
3360
0
    skippy_iter.set_match_func (match_always, nullptr);
3361
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
3362
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
3363
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
3364
0
    bool matched = skippy_iter.next (&unsafe_to1);
3365
0
    if (likely (matched))
3366
0
    {
3367
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3368
0
      {
3369
  /* Can't use the fast path if eg. the next char is a default-ignorable
3370
   * or other skippable. */
3371
0
        goto slow;
3372
0
      }
3373
3374
0
      first = &c->buffer->info[skippy_iter.idx];
3375
0
      unsafe_to1 = skippy_iter.idx + 1;
3376
3377
0
      if (digest && lookup_context.get_value &&
3378
0
    !digest->may_have (lookup_context.get_value (*first, lookup_context.match_data)))
3379
0
  {
3380
0
    c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
3381
0
    return_trace (false);
3382
0
  }
3383
0
    }
3384
0
    else
3385
0
    {
3386
0
      bool unsafe_to_concat = false;
3387
0
      bool ret =
3388
0
      + hb_iter (rule)
3389
0
      | hb_map (hb_add (this))
3390
0
      | hb_filter ([&] (const RuleType &_)
3391
0
       {
3392
0
         if (_.inputCount <= 1) return true;
3393
0
         unsafe_to_concat = true;
3394
0
         return false;
3395
0
       })
3396
0
      | hb_map ([&] (const RuleType &_) { return _.apply (c, lookup_context); })
3397
0
      | hb_any
3398
0
      ;
3399
0
      if (unsafe_to_concat)
3400
0
  c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
3401
0
      return_trace (ret);
3402
0
    }
3403
0
    matched = skippy_iter.next ();
3404
0
    if (likely (matched))
3405
0
    {
3406
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
3407
0
      {
3408
  /* Can't use the fast path if eg. the next char is a default-ignorable
3409
   * or other skippable. */
3410
0
        goto slow;
3411
0
      }
3412
3413
0
      second = &c->buffer->info[skippy_iter.idx];
3414
0
      unsafe_to2 = skippy_iter.idx + 1;
3415
0
    }
3416
3417
0
    auto match_input = lookup_context.funcs.match;
3418
0
    auto *input_data = lookup_context.match_data;
3419
0
    for (unsigned int i = 0; i < num_rules; i++)
3420
0
    {
3421
0
      const auto &r = this+rule.arrayZ[i];
3422
3423
0
      const auto &input = r.inputZ;
3424
3425
0
      if (r.inputCount <= 1 ||
3426
0
    (!match_input ||
3427
0
     match_input (*first, input.arrayZ[0], input_data)))
3428
0
      {
3429
0
        if (!second ||
3430
0
      (r.inputCount <= 2 ||
3431
0
       (!match_input ||
3432
0
        match_input (*second, input.arrayZ[1], input_data)))
3433
0
     )
3434
0
  {
3435
0
    if (r.apply (c, lookup_context))
3436
0
    {
3437
0
      if (unsafe_to != (unsigned) -1)
3438
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3439
0
      return_trace (true);
3440
0
    }
3441
0
  }
3442
0
  else
3443
0
    unsafe_to = unsafe_to2;
3444
0
      }
3445
0
      else
3446
0
      {
3447
0
  if (unsafe_to == (unsigned) -1)
3448
0
    unsafe_to = unsafe_to1;
3449
3450
  // Skip ahead to next possible first glyph match.
3451
0
  for (; i + 1 < num_rules; i++)
3452
0
  {
3453
0
    const auto &r2 = this+rule.arrayZ[i + 1];
3454
0
    const auto &input2 = r2.inputZ;
3455
0
    if (r2.inputCount <= 1 || input2.arrayZ[0] != input.arrayZ[0])
3456
0
      break;
3457
0
  }
3458
0
      }
3459
0
    }
3460
0
    if (likely (unsafe_to != (unsigned) -1))
3461
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
3462
3463
0
    return_trace (false);
3464
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
3465
3466
  bool subset (hb_subset_context_t *c,
3467
         const hb_map_t *lookup_map,
3468
         const hb_map_t *klass_map = nullptr) const
3469
0
  {
3470
0
    TRACE_SUBSET (this);
3471
3472
0
    auto snap = c->serializer->snapshot ();
3473
0
    auto *out = c->serializer->start_embed (*this);
3474
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3475
3476
0
    for (const auto& _ : rule)
3477
0
    {
3478
0
      if (!_) continue;
3479
0
      auto o_snap = c->serializer->snapshot ();
3480
0
      auto *o = out->rule.serialize_append (c->serializer);
3481
0
      if (unlikely (!o)) continue;
3482
3483
0
      if (!o->serialize_subset (c, _, this, lookup_map, klass_map))
3484
0
      {
3485
0
  out->rule.pop ();
3486
0
  c->serializer->revert (o_snap);
3487
0
      }
3488
0
    }
3489
3490
0
    bool ret = bool (out->rule);
3491
0
    if (!ret) c->serializer->revert (snap);
3492
3493
0
    return_trace (ret);
3494
0
  }
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
Unexecuted instantiation: OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const
3495
3496
  bool sanitize (hb_sanitize_context_t *c) const
3497
1.66k
  {
3498
1.66k
    TRACE_SANITIZE (this);
3499
1.66k
    return_trace (rule.sanitize (c, this));
3500
1.66k
  }
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::SmallTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3497
1.55k
  {
3498
1.55k
    TRACE_SANITIZE (this);
3499
1.55k
    return_trace (rule.sanitize (c, this));
3500
1.55k
  }
OT::RuleSetOf<OT::Layout::SmallTypes, OT::Rule<OT::Layout::MediumTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3497
31
  {
3498
31
    TRACE_SANITIZE (this);
3499
31
    return_trace (rule.sanitize (c, this));
3500
31
  }
OT::RuleSetOf<OT::Layout::MediumTypes, OT::Rule<OT::Layout::SmallTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3497
77
  {
3498
77
    TRACE_SANITIZE (this);
3499
77
    return_trace (rule.sanitize (c, this));
3500
77
  }
3501
3502
  protected:
3503
  Array16Of<typename Types::template OffsetTo<RuleType>>
3504
    rule;     /* Array of Rule tables
3505
           * ordered by preference */
3506
  public:
3507
  DEFINE_SIZE_ARRAY (2, rule);
3508
};
3509
3510
template <typename Types>
3511
struct RuleSet : RuleSetOf<SmallTypes, Rule<Types>> {};
3512
3513
template <typename Types>
3514
struct ClassRuleSet : RuleSetOf<Types, Rule<SmallTypes>> {};
3515
3516
3517
template <typename Types>
3518
struct ContextFormat1_4
3519
{
3520
  using RuleSet = OT::RuleSet<Types>;
3521
3522
  bool intersects (const hb_set_t *glyphs) const
3523
0
  {
3524
0
    struct ContextClosureLookupContext lookup_context = {
3525
0
      {intersects_glyph, intersected_glyph},
3526
0
      ContextFormat::SimpleContext,
3527
0
      nullptr
3528
0
    };
3529
3530
0
    return
3531
0
    + hb_zip (this+coverage, ruleSet)
3532
0
    | hb_filter (*glyphs, hb_first)
3533
0
    | hb_map (hb_second)
3534
0
    | hb_map (hb_add (this))
3535
0
    | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
3536
0
    | hb_any
3537
0
    ;
3538
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
3539
3540
  bool may_have_non_1to1 () const
3541
0
  { return true; }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
3542
3543
  void depend (hb_depend_context_t *c) const
3544
0
  {
3545
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3546
0
    if (unlikely (!cur_active_glyphs)) return;
3547
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
3548
0
3549
0
    ContextDependLookupContext lookup_context = {
3550
0
      {intersects_glyph, intersected_glyph},
3551
0
      ContextFormat::SimpleContext,
3552
0
      nullptr,
3553
0
      nullptr,  /* intersects_cache */
3554
0
      nullptr   /* intersected_glyphs_cache */
3555
0
    };
3556
0
3557
0
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3558
0
    | hb_filter ([&] (hb_codepoint_t _) {
3559
0
      return c->parent_active_glyphs ().has (_);
3560
0
    }, hb_first)
3561
0
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
3562
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.depend (c, _.first, lookup_context); })
3563
0
    ;
3564
0
3565
0
    c->pop_cur_done_glyphs ();
3566
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*) const
3567
3568
  void closure (hb_closure_context_t *c) const
3569
0
  {
3570
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3571
0
    if (unlikely (!cur_active_glyphs)) return;
3572
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs);
3573
3574
0
    struct ContextClosureLookupContext lookup_context = {
3575
0
      {intersects_glyph, intersected_glyph},
3576
0
      ContextFormat::SimpleContext,
3577
0
      nullptr
3578
0
    };
3579
3580
0
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
3581
0
    | hb_filter ([&] (hb_codepoint_t _) {
3582
0
      return c->previous_parent_active_glyphs ().has (_);
3583
0
    }, hb_first)
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
3584
0
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::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
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
3585
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&) const
3586
0
    ;
3587
3588
0
    c->pop_cur_done_glyphs ();
3589
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
3590
3591
  void closure_lookups (hb_closure_lookups_context_t *c) const
3592
0
  {
3593
0
    struct ContextClosureLookupContext lookup_context = {
3594
0
      {intersects_glyph, nullptr},
3595
0
      ContextFormat::SimpleContext,
3596
0
      nullptr
3597
0
    };
3598
3599
0
    + hb_zip (this+coverage, ruleSet)
3600
0
    | hb_filter (*c->glyphs, hb_first)
3601
0
    | hb_map (hb_second)
3602
0
    | hb_map (hb_add (this))
3603
0
    | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
3604
0
    ;
3605
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
3606
3607
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
3608
3609
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3610
0
  {
3611
0
    (this+coverage).collect_coverage (c->input);
3612
3613
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
3614
0
      {collect_glyph},
3615
0
      nullptr
3616
0
    };
3617
3618
0
    + hb_iter (ruleSet)
3619
0
    | hb_map (hb_add (this))
3620
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
3621
0
    ;
3622
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
3623
3624
  void collect_second_glyphs (hb_set_digest_t *digest) const
3625
6
  {
3626
6
    + hb_iter (ruleSet)
3627
6
    | hb_map (hb_add (this))
3628
10
    | hb_apply ([digest] (const RuleSet &_) { _.collect_second_glyphs (digest); })
OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3628
10
    | hb_apply ([digest] (const RuleSet &_) { _.collect_second_glyphs (digest); })
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const
3629
6
    ;
3630
6
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
3625
4
  {
3626
4
    + hb_iter (ruleSet)
3627
4
    | hb_map (hb_add (this))
3628
4
    | hb_apply ([digest] (const RuleSet &_) { _.collect_second_glyphs (digest); })
3629
4
    ;
3630
4
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
3625
2
  {
3626
2
    + hb_iter (ruleSet)
3627
2
    | hb_map (hb_add (this))
3628
2
    | hb_apply ([digest] (const RuleSet &_) { _.collect_second_glyphs (digest); })
3629
2
    ;
3630
2
  }
3631
3632
  bool would_apply (hb_would_apply_context_t *c) const
3633
0
  {
3634
0
    const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
3635
0
    struct ContextApplyLookupContext lookup_context = {
3636
0
      {match_glyph},
3637
0
      nullptr
3638
0
    };
3639
0
    return rule_set.would_apply (c, lookup_context);
3640
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
3641
3642
6
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3642
4
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
3642
2
  const Coverage &get_coverage () const { return this+coverage; }
3643
3644
  bool apply (hb_ot_apply_context_t *c) const
3645
8
  {
3646
8
    TRACE_APPLY (this);
3647
8
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3648
8
    if (likely (index == NOT_COVERED))
3649
8
      return_trace (false);
3650
3651
0
    const RuleSet &rule_set = this+ruleSet[index];
3652
0
    struct ContextApplyLookupContext lookup_context = {
3653
0
      {match_glyph},
3654
0
      nullptr
3655
0
    };
3656
0
    return_trace (rule_set.apply (c, lookup_context));
3657
8
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
3645
8
  {
3646
8
    TRACE_APPLY (this);
3647
8
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3648
8
    if (likely (index == NOT_COVERED))
3649
8
      return_trace (false);
3650
3651
0
    const RuleSet &rule_set = this+ruleSet[index];
3652
0
    struct ContextApplyLookupContext lookup_context = {
3653
0
      {match_glyph},
3654
0
      nullptr
3655
0
    };
3656
0
    return_trace (rule_set.apply (c, lookup_context));
3657
8
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
3658
3659
  bool subset (hb_subset_context_t *c) const
3660
0
  {
3661
0
    TRACE_SUBSET (this);
3662
0
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
3663
0
    const hb_map_t &glyph_map = *c->plan->glyph_map;
3664
3665
0
    auto *out = c->serializer->start_embed (*this);
3666
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3667
0
    out->format = format;
3668
3669
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3670
0
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
3671
0
    + hb_zip (this+coverage, ruleSet)
3672
0
    | hb_filter (glyphset, hb_first)
3673
0
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
3674
0
    | hb_map (hb_first)
3675
0
    | hb_map (glyph_map)
3676
0
    | hb_sink (new_coverage)
3677
0
    ;
3678
3679
0
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
3680
0
    return_trace (bool (new_coverage));
3681
0
  }
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
3682
3683
  bool sanitize (hb_sanitize_context_t *c) const
3684
474
  {
3685
474
    TRACE_SANITIZE (this);
3686
474
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3687
474
  }
OT::ContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3684
392
  {
3685
392
    TRACE_SANITIZE (this);
3686
392
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3687
392
  }
OT::ContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3684
82
  {
3685
82
    TRACE_SANITIZE (this);
3686
82
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
3687
82
  }
3688
3689
  protected:
3690
  HBUINT16  format;     /* Format identifier--format = 1 */
3691
  typename Types::template LOffsetTo<Coverage>
3692
    coverage;   /* Offset to Coverage table--from
3693
           * beginning of table */
3694
  typename Types::template ArrayOf<typename Types::template OffsetTo<RuleSet>>
3695
    ruleSet;    /* Array of RuleSet tables
3696
           * ordered by Coverage Index */
3697
  public:
3698
  DEFINE_SIZE_ARRAY (2 + Types::LOffset::static_size + Types::HBUINT::static_size, ruleSet);
3699
};
3700
3701
3702
template <typename Types>
3703
struct ContextFormat2_5
3704
{
3705
  using RuleSet = OT::ClassRuleSet<Types>;
3706
3707
  bool intersects (const hb_set_t *glyphs) const
3708
0
  {
3709
0
    if (!(this+coverage).intersects (glyphs))
3710
0
      return false;
3711
3712
0
    const ClassDef &class_def = this+classDef;
3713
3714
0
    hb_map_t cache;
3715
0
    struct ContextClosureLookupContext lookup_context = {
3716
0
      {intersects_class, nullptr},
3717
0
      ContextFormat::ClassBasedContext,
3718
0
      &class_def,
3719
0
      &cache
3720
0
    };
3721
3722
0
    hb_set_t retained_coverage_glyphs;
3723
0
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
3724
3725
0
    hb_set_t coverage_glyph_classes;
3726
0
    class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3727
3728
3729
0
    return
3730
0
    + hb_iter (ruleSet)
3731
0
    | hb_map (hb_add (this))
3732
0
    | hb_enumerate
3733
0
    | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
3734
0
        { return class_def.intersects_class (glyphs, p.first) &&
3735
0
           coverage_glyph_classes.has (p.first) &&
3736
0
           p.second.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::SmallTypes> const&>) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::MediumTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::MediumTypes> const&>) const
3737
0
    | hb_any
3738
0
    ;
3739
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
3740
3741
  bool may_have_non_1to1 () const
3742
0
  { return true; }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
3743
3744
  void depend (hb_depend_context_t *c) const
3745
0
  {
3746
0
    if (!(this+coverage).intersects (c->glyphs))
3747
0
      return;
3748
0
3749
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3750
0
    if (unlikely (!cur_active_glyphs)) return;
3751
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
3752
0
3753
0
    const ClassDef &class_def = this+classDef;
3754
0
3755
0
    hb_map_t cache;
3756
0
    intersected_class_cache_t intersected_cache;
3757
0
    ContextDependLookupContext lookup_context = {
3758
0
      {intersects_class, intersected_class_glyphs},
3759
0
      ContextFormat::ClassBasedContext,
3760
0
      &class_def,
3761
0
      &cache,
3762
0
      &intersected_cache
3763
0
    };
3764
0
3765
0
    + hb_enumerate (ruleSet)
3766
0
    | hb_filter ([&] (unsigned _)
3767
0
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
3768
0
     hb_first)
3769
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
3770
0
                {
3771
0
                  const RuleSet& rule_set = this+_.second;
3772
0
                  rule_set.depend (c, _.first, lookup_context);
3773
0
                })
3774
0
    ;
3775
0
3776
0
    c->pop_cur_done_glyphs ();
3777
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*) const
3778
3779
  void closure (hb_closure_context_t *c) const
3780
0
  {
3781
0
    if (!(this+coverage).intersects (c->glyphs))
3782
0
      return;
3783
3784
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
3785
0
    if (unlikely (!cur_active_glyphs)) return;
3786
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
3787
0
           *cur_active_glyphs);
3788
3789
0
    const ClassDef &class_def = this+classDef;
3790
3791
0
    hb_map_t cache;
3792
0
    intersected_class_cache_t intersected_cache;
3793
0
    struct ContextClosureLookupContext lookup_context = {
3794
0
      {intersects_class, intersected_class_glyphs},
3795
0
      ContextFormat::ClassBasedContext,
3796
0
      &class_def,
3797
0
      &cache,
3798
0
      &intersected_cache
3799
0
    };
3800
3801
0
    + hb_enumerate (ruleSet)
3802
0
    | hb_filter ([&] (unsigned _)
3803
0
    { return class_def.intersects_class (&c->parent_active_glyphs (), _); },
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
3804
0
     hb_first)
3805
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _)
3806
0
                {
3807
0
                  const RuleSet& rule_set = this+_.second;
3808
0
                  rule_set.closure (c, _.first, lookup_context);
3809
0
                })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ClassRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ClassRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ClassRuleSet<OT::Layout::MediumTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ClassRuleSet<OT::Layout::MediumTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const
3810
0
    ;
3811
3812
0
    c->pop_cur_done_glyphs ();
3813
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
3814
3815
  void closure_lookups (hb_closure_lookups_context_t *c) const
3816
0
  {
3817
0
    if (!(this+coverage).intersects (c->glyphs))
3818
0
      return;
3819
3820
0
    const ClassDef &class_def = this+classDef;
3821
3822
0
    hb_map_t cache;
3823
0
    struct ContextClosureLookupContext lookup_context = {
3824
0
      {intersects_class, nullptr},
3825
0
      ContextFormat::ClassBasedContext,
3826
0
      &class_def,
3827
0
      &cache
3828
0
    };
3829
3830
0
    + hb_iter (ruleSet)
3831
0
    | hb_map (hb_add (this))
3832
0
    | hb_enumerate
3833
0
    | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p)
3834
0
    { return class_def.intersects_class (c->glyphs, p.first); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::SmallTypes> const&>) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::MediumTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ClassRuleSet<OT::Layout::MediumTypes> const&>) const
3835
0
    | hb_map (hb_second)
3836
0
    | hb_apply ([&] (const RuleSet & _)
3837
0
    { _.closure_lookups (c, lookup_context); });
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::MediumTypes> const&) const
3838
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
3839
3840
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
3841
3842
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
3843
0
  {
3844
0
    (this+coverage).collect_coverage (c->input);
3845
3846
0
    const ClassDef &class_def = this+classDef;
3847
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
3848
0
      {collect_class},
3849
0
      &class_def
3850
0
    };
3851
3852
0
    + hb_iter (ruleSet)
3853
0
    | hb_map (hb_add (this))
3854
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::ClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::MediumTypes> const&) const
3855
0
    ;
3856
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
3857
3858
  void collect_second_glyphs (hb_set_digest_t *digest) const
3859
16
  {
3860
16
    const ClassDef &class_def = this+classDef;
3861
16
    + hb_iter (ruleSet)
3862
16
    | hb_map (hb_add (this))
3863
138
    | hb_apply ([=, &class_def] (const RuleSet &_) { _.collect_second_glyphs (digest, &class_def); })
OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
3863
138
    | hb_apply ([=, &class_def] (const RuleSet &_) { _.collect_second_glyphs (digest, &class_def); })
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ClassRuleSet<OT::Layout::MediumTypes> const&) const
3864
16
    ;
3865
16
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
3859
16
  {
3860
16
    const ClassDef &class_def = this+classDef;
3861
16
    + hb_iter (ruleSet)
3862
16
    | hb_map (hb_add (this))
3863
16
    | hb_apply ([=, &class_def] (const RuleSet &_) { _.collect_second_glyphs (digest, &class_def); })
3864
16
    ;
3865
16
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const
3866
3867
  bool would_apply (hb_would_apply_context_t *c) const
3868
0
  {
3869
0
    const ClassDef &class_def = this+classDef;
3870
0
    unsigned int index = class_def.get_class (c->glyphs[0]);
3871
0
    const RuleSet &rule_set = this+ruleSet[index];
3872
0
    struct ContextApplyLookupContext lookup_context = {
3873
0
      {match_class},
3874
0
      &class_def
3875
0
    };
3876
0
    return rule_set.would_apply (c, lookup_context);
3877
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
3878
3879
16
  const Coverage &get_coverage () const { return this+coverage; }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
3879
16
  const Coverage &get_coverage () const { return this+coverage; }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
3880
3881
  unsigned cache_cost () const
3882
16
  {
3883
16
    return (this+classDef).cost ();
3884
16
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Line
Count
Source
3882
16
  {
3883
16
    return (this+classDef).cost ();
3884
16
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
3885
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
3886
64
  {
3887
64
    return context_cache_func (c, op);
3888
64
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
3886
64
  {
3887
64
    return context_cache_func (c, op);
3888
64
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
3889
3890
  struct external_cache_t
3891
  {
3892
    hb_ot_layout_binary_cache_t coverage;
3893
    hb_ot_layout_ruleset_digest_t rule_sets[HB_VAR_ARRAY];
3894
  };
3895
  void *external_cache_create () const
3896
16
  {
3897
16
    unsigned count = ruleSet.len;
3898
16
    unsigned size = sizeof (external_cache_t) -
3899
16
        HB_VAR_ARRAY * sizeof (hb_ot_layout_ruleset_digest_t) +
3900
16
        count * sizeof (hb_ot_layout_ruleset_digest_t);
3901
16
    external_cache_t *cache = (external_cache_t *) hb_malloc (size);
3902
16
    if (likely (cache))
3903
16
    {
3904
16
      cache->coverage.clear ();
3905
154
      for (unsigned i = 0; i < count; i++)
3906
138
  (this+ruleSet[i]).collect_first_input_classes (&cache->rule_sets[i]);
3907
16
    }
3908
16
    return cache;
3909
16
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Line
Count
Source
3896
16
  {
3897
16
    unsigned count = ruleSet.len;
3898
16
    unsigned size = sizeof (external_cache_t) -
3899
16
        HB_VAR_ARRAY * sizeof (hb_ot_layout_ruleset_digest_t) +
3900
16
        count * sizeof (hb_ot_layout_ruleset_digest_t);
3901
16
    external_cache_t *cache = (external_cache_t *) hb_malloc (size);
3902
16
    if (likely (cache))
3903
16
    {
3904
16
      cache->coverage.clear ();
3905
154
      for (unsigned i = 0; i < count; i++)
3906
138
  (this+ruleSet[i]).collect_first_input_classes (&cache->rule_sets[i]);
3907
16
    }
3908
16
    return cache;
3909
16
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
3910
32
  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
3910
32
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
3911
0
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
3912
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
3913
32
  {
3914
32
    TRACE_APPLY (this);
3915
32
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
3916
32
    external_cache_t *cache = (external_cache_t *) external_cache;
3917
32
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
3918
#else
3919
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3920
#endif
3921
32
    if (index == NOT_COVERED) return_trace (false);
3922
3923
20
    const ClassDef &class_def = this+classDef;
3924
3925
20
    struct ContextApplyLookupContext lookup_context = {
3926
20
      {cached ? match_class_cached : match_class},
3927
20
      &class_def,
3928
20
      cached ? get_class_cached_value : get_class_value
3929
20
    };
3930
3931
20
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
3932
20
    const RuleSet &rule_set = this+ruleSet[index];
3933
20
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
3934
20
    const hb_ot_layout_ruleset_digest_t *digest = cache && index < ruleSet.len ? &cache->rule_sets[index] : nullptr;
3935
#else
3936
    const hb_ot_layout_ruleset_digest_t *digest = nullptr;
3937
#endif
3938
20
    return_trace (rule_set.apply (c, lookup_context, digest));
3939
32
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
3913
32
  {
3914
32
    TRACE_APPLY (this);
3915
32
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
3916
32
    external_cache_t *cache = (external_cache_t *) external_cache;
3917
32
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
3918
#else
3919
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
3920
#endif
3921
32
    if (index == NOT_COVERED) return_trace (false);
3922
3923
20
    const ClassDef &class_def = this+classDef;
3924
3925
20
    struct ContextApplyLookupContext lookup_context = {
3926
20
      {cached ? match_class_cached : match_class},
3927
20
      &class_def,
3928
20
      cached ? get_class_cached_value : get_class_value
3929
20
    };
3930
3931
20
    index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint);
3932
20
    const RuleSet &rule_set = this+ruleSet[index];
3933
20
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
3934
20
    const hb_ot_layout_ruleset_digest_t *digest = cache && index < ruleSet.len ? &cache->rule_sets[index] : nullptr;
3935
#else
3936
    const hb_ot_layout_ruleset_digest_t *digest = nullptr;
3937
#endif
3938
20
    return_trace (rule_set.apply (c, lookup_context, digest));
3939
32
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
3940
3941
  bool subset (hb_subset_context_t *c) const
3942
0
  {
3943
0
    TRACE_SUBSET (this);
3944
0
    auto *out = c->serializer->start_embed (*this);
3945
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
3946
0
    out->format = format;
3947
0
    if (unlikely (!out->coverage.serialize_subset (c, coverage, this)))
3948
0
      return_trace (false);
3949
3950
0
    hb_map_t klass_map;
3951
0
    out->classDef.serialize_subset (c, classDef, this, &klass_map);
3952
3953
0
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
3954
0
    hb_set_t retained_coverage_glyphs;
3955
0
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
3956
3957
0
    hb_set_t coverage_glyph_classes;
3958
0
    (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
3959
3960
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
3961
0
    bool ret = true;
3962
0
    int non_zero_index = -1, index = 0;
3963
0
    auto snapshot = c->serializer->snapshot();
3964
0
    for (const auto& _ : + hb_enumerate (ruleSet)
3965
0
       | hb_filter (klass_map, hb_first))
3966
0
    {
3967
0
      auto *o = out->ruleSet.serialize_append (c->serializer);
3968
0
      if (unlikely (!o))
3969
0
      {
3970
0
  ret = false;
3971
0
  break;
3972
0
      }
3973
3974
0
      if (coverage_glyph_classes.has (_.first) &&
3975
0
    o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
3976
0
  non_zero_index = index;
3977
0
        snapshot = c->serializer->snapshot();
3978
0
      }
3979
3980
0
      index++;
3981
0
    }
3982
3983
0
    if (!ret || non_zero_index == -1) return_trace (false);
3984
3985
    //prune empty trailing ruleSets
3986
0
    --index;
3987
0
    while (index > non_zero_index)
3988
0
    {
3989
0
      out->ruleSet.pop ();
3990
0
      index--;
3991
0
    }
3992
0
    c->serializer->revert (snapshot);
3993
3994
0
    return_trace (bool (out->ruleSet));
3995
0
  }
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
3996
3997
  bool sanitize (hb_sanitize_context_t *c) const
3998
341
  {
3999
341
    TRACE_SANITIZE (this);
4000
341
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
4001
341
  }
OT::ContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3998
260
  {
3999
260
    TRACE_SANITIZE (this);
4000
260
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
4001
260
  }
OT::ContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
3998
81
  {
3999
81
    TRACE_SANITIZE (this);
4000
81
    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
4001
81
  }
4002
4003
  protected:
4004
  HBUINT16  format;     /* Format identifier--format = 2 */
4005
  typename Types::template LOffsetTo<Coverage>
4006
    coverage;   /* Offset to Coverage table--from
4007
           * beginning of table */
4008
  typename Types::template LOffsetTo<ClassDef>
4009
    classDef;   /* Offset to glyph ClassDef table--from
4010
           * beginning of table */
4011
  typename Types::template ArrayOf<typename Types::template OffsetTo<RuleSet>>
4012
    ruleSet;    /* Array of RuleSet tables
4013
           * ordered by class */
4014
  public:
4015
  DEFINE_SIZE_ARRAY (2 + 2 * Types::LOffset::static_size + Types::HBUINT::static_size, ruleSet);
4016
};
4017
4018
4019
template <typename Types>
4020
struct ContextFormat3_6
4021
{
4022
  using RuleSet = OT::RuleSet<SmallTypes>;
4023
4024
  bool intersects (const hb_set_t *glyphs) const
4025
0
  {
4026
0
    if (!(this+coverageZ[0]).intersects (glyphs))
4027
0
      return false;
4028
4029
0
    struct ContextClosureLookupContext lookup_context = {
4030
0
      {intersects_coverage, nullptr},
4031
0
      ContextFormat::CoverageBasedContext,
4032
0
      this
4033
0
    };
4034
0
    return context_intersects (glyphs,
4035
0
             glyphCount, coverageZ.arrayZ + 1,
4036
0
             lookup_context);
4037
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
4038
4039
  bool may_have_non_1to1 () const
4040
0
  { return true; }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::may_have_non_1to1() const
4041
4042
  void depend (hb_depend_context_t *c) const
4043
0
  {
4044
0
    if (!(this+coverageZ[0]).intersects (c->glyphs))
4045
0
      return;
4046
0
4047
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
4048
0
    if (unlikely (!cur_active_glyphs)) return;
4049
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
4050
0
4051
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4052
0
    ContextDependLookupContext lookup_context = {
4053
0
      {intersects_coverage, intersected_coverage_glyphs},
4054
0
      ContextFormat::CoverageBasedContext,
4055
0
      this,
4056
0
      nullptr,  /* intersects_cache */
4057
0
      nullptr   /* intersected_glyphs_cache */
4058
0
    };
4059
0
    context_depend_lookup (c,
4060
0
         glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1),
4061
0
         lookupCount, lookupRecord,
4062
0
         this,
4063
0
         coverageZ[0], lookup_context);
4064
0
4065
0
    c->pop_cur_done_glyphs ();
4066
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*) const
4067
4068
  void closure (hb_closure_context_t *c) const
4069
0
  {
4070
0
    if (!(this+coverageZ[0]).intersects (c->glyphs))
4071
0
      return;
4072
4073
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
4074
0
    if (unlikely (!cur_active_glyphs)) return;
4075
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
4076
0
           *cur_active_glyphs);
4077
4078
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4079
0
    struct ContextClosureLookupContext lookup_context = {
4080
0
      {intersects_coverage, intersected_coverage_glyphs},
4081
0
      ContextFormat::CoverageBasedContext,
4082
0
      this
4083
0
    };
4084
0
    context_closure_lookup (c,
4085
0
          glyphCount, coverageZ.arrayZ + 1,
4086
0
          lookupCount, lookupRecord,
4087
0
          0, lookup_context);
4088
4089
0
    c->pop_cur_done_glyphs ();
4090
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
4091
4092
  void closure_lookups (hb_closure_lookups_context_t *c) const
4093
0
  {
4094
0
    if (!intersects (c->glyphs))
4095
0
      return;
4096
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4097
0
    recurse_lookups (c, lookupCount, lookupRecord);
4098
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
4099
4100
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
4101
4102
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
4103
0
  {
4104
0
    (this+coverageZ[0]).collect_coverage (c->input);
4105
4106
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4107
0
    struct ContextCollectGlyphsLookupContext lookup_context = {
4108
0
      {collect_coverage},
4109
0
      this
4110
0
    };
4111
4112
0
    context_collect_glyphs_lookup (c,
4113
0
           glyphCount, coverageZ.arrayZ + 1,
4114
0
           lookupCount, lookupRecord,
4115
0
           lookup_context);
4116
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const
4117
4118
  void collect_second_glyphs (hb_set_digest_t *digest) const
4119
30
  {
4120
30
    if (glyphCount <= 1)
4121
26
      *digest = hb_set_digest_t::full ();
4122
4
    else
4123
4
      (this+coverageZ[1]).collect_coverage (digest);
4124
30
  }
OT::ContextFormat3_6<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
4119
29
  {
4120
29
    if (glyphCount <= 1)
4121
26
      *digest = hb_set_digest_t::full ();
4122
3
    else
4123
3
      (this+coverageZ[1]).collect_coverage (digest);
4124
29
  }
OT::ContextFormat3_6<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
4119
1
  {
4120
1
    if (glyphCount <= 1)
4121
0
      *digest = hb_set_digest_t::full ();
4122
1
    else
4123
1
      (this+coverageZ[1]).collect_coverage (digest);
4124
1
  }
4125
4126
  bool would_apply (hb_would_apply_context_t *c) const
4127
0
  {
4128
0
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4129
0
    struct ContextApplyLookupContext lookup_context = {
4130
0
      {match_coverage},
4131
0
      this
4132
0
    };
4133
0
    return context_would_apply_lookup (c,
4134
0
               glyphCount, coverageZ.arrayZ + 1,
4135
0
               lookupCount, lookupRecord,
4136
0
               lookup_context);
4137
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
4138
4139
30
  const Coverage &get_coverage () const { return this+coverageZ[0]; }
OT::ContextFormat3_6<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
4139
29
  const Coverage &get_coverage () const { return this+coverageZ[0]; }
OT::ContextFormat3_6<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
4139
1
  const Coverage &get_coverage () const { return this+coverageZ[0]; }
4140
4141
  bool apply (hb_ot_apply_context_t *c) const
4142
1.12k
  {
4143
1.12k
    TRACE_APPLY (this);
4144
1.12k
    unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
4145
1.12k
    if (index == NOT_COVERED) return_trace (false);
4146
4147
1.12k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4148
1.12k
    struct ContextApplyLookupContext lookup_context = {
4149
1.12k
      {match_coverage},
4150
1.12k
      this
4151
1.12k
    };
4152
1.12k
    return_trace (context_apply_lookup (c,
4153
1.12k
          glyphCount,
4154
1.12k
          coverageZ.arrayZ + 1,
4155
1.12k
          lookupCount, lookupRecord,
4156
1.12k
          lookup_context));
4157
1.12k
  }
OT::ContextFormat3_6<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
4142
1.12k
  {
4143
1.12k
    TRACE_APPLY (this);
4144
1.12k
    unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
4145
1.12k
    if (index == NOT_COVERED) return_trace (false);
4146
4147
1.12k
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4148
1.12k
    struct ContextApplyLookupContext lookup_context = {
4149
1.12k
      {match_coverage},
4150
1.12k
      this
4151
1.12k
    };
4152
1.12k
    return_trace (context_apply_lookup (c,
4153
1.12k
          glyphCount,
4154
1.12k
          coverageZ.arrayZ + 1,
4155
1.12k
          lookupCount, lookupRecord,
4156
1.12k
          lookup_context));
4157
1.12k
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
4158
4159
  bool subset (hb_subset_context_t *c) const
4160
0
  {
4161
0
    TRACE_SUBSET (this);
4162
0
    auto *out = c->serializer->start_embed (this);
4163
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
4164
4165
0
    out->format = format;
4166
0
    out->glyphCount = glyphCount;
4167
4168
0
    auto coverages = coverageZ.as_array (glyphCount);
4169
4170
0
    for (const auto& offset : coverages)
4171
0
    {
4172
      /* TODO(subset) This looks like should not be necessary to write this way. */
4173
0
      auto *o = c->serializer->allocate_size<typename Types::template OffsetTo<Coverage>> (Types::Offset::static_size);
4174
0
      if (unlikely (!o)) return_trace (false);
4175
0
      if (!o->serialize_subset (c, offset, this)) return_trace (false);
4176
0
    }
4177
4178
0
    const auto& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount));
4179
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
4180
4181
4182
0
    unsigned count = serialize_lookuprecord_array (c->serializer, lookupRecord.as_array (lookupCount), lookup_map);
4183
0
    return_trace (c->serializer->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
4184
0
  }
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ContextFormat3_6<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
4185
4186
  bool sanitize (hb_sanitize_context_t *c) const
4187
191
  {
4188
191
    TRACE_SANITIZE (this);
4189
191
    if (unlikely (!c->check_struct (this))) return_trace (false);
4190
191
    hb_barrier ();
4191
191
    unsigned int count = glyphCount;
4192
191
    if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */
4193
189
    if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false);
4194
2.17k
    for (unsigned int i = 0; i < count; i++)
4195
2.02k
      if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false);
4196
148
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4197
148
    return_trace (likely (c->check_array (lookupRecord, lookupCount)));
4198
178
  }
OT::ContextFormat3_6<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4187
125
  {
4188
125
    TRACE_SANITIZE (this);
4189
125
    if (unlikely (!c->check_struct (this))) return_trace (false);
4190
125
    hb_barrier ();
4191
125
    unsigned int count = glyphCount;
4192
125
    if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */
4193
124
    if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false);
4194
1.96k
    for (unsigned int i = 0; i < count; i++)
4195
1.87k
      if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false);
4196
95
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4197
95
    return_trace (likely (c->check_array (lookupRecord, lookupCount)));
4198
114
  }
OT::ContextFormat3_6<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4187
66
  {
4188
66
    TRACE_SANITIZE (this);
4189
66
    if (unlikely (!c->check_struct (this))) return_trace (false);
4190
66
    hb_barrier ();
4191
66
    unsigned int count = glyphCount;
4192
66
    if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */
4193
65
    if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false);
4194
202
    for (unsigned int i = 0; i < count; i++)
4195
149
      if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false);
4196
53
    const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount));
4197
53
    return_trace (likely (c->check_array (lookupRecord, lookupCount)));
4198
64
  }
4199
4200
  protected:
4201
  HBUINT16  format;     /* Format identifier--format = 3 */
4202
  HBUINT16  glyphCount;   /* Number of glyphs in the input glyph
4203
           * sequence */
4204
  HBUINT16  lookupCount;    /* Number of LookupRecords */
4205
  UnsizedArrayOf<typename Types::template OffsetTo<Coverage>>
4206
    coverageZ;    /* Array of offsets to Coverage
4207
           * table in glyph sequence order */
4208
/*UnsizedArrayOf<LookupRecord>
4209
    lookupRecordX;*/  /* Array of LookupRecords--in
4210
           * design order */
4211
  public:
4212
  DEFINE_SIZE_ARRAY (6, coverageZ);
4213
};
4214
4215
struct Context
4216
{
4217
  template <typename context_t, typename ...Ts>
4218
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
4219
7.35k
  {
4220
7.35k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4221
7.31k
    TRACE_DISPATCH (this, u.format.v);
4222
7.31k
    switch (u.format.v) {
4223
396
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4224
276
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4225
154
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4226
0
#ifndef HB_NO_BEYOND_64K
4227
84
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4228
81
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4229
67
    case 6: hb_barrier (); return_trace (c->dispatch (u.format6, std::forward<Ts> (ds)...));
4230
0
#endif
4231
6.25k
    default:return_trace (c->default_return_value ());
4232
7.31k
    }
4233
7.31k
  }
hb_sanitize_context_t::return_t OT::Context::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
4219
7.19k
  {
4220
7.19k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4221
7.16k
    TRACE_DISPATCH (this, u.format.v);
4222
7.16k
    switch (u.format.v) {
4223
392
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4224
260
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4225
125
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4226
0
#ifndef HB_NO_BEYOND_64K
4227
82
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4228
81
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4229
66
    case 6: hb_barrier (); return_trace (c->dispatch (u.format6, std::forward<Ts> (ds)...));
4230
0
#endif
4231
6.15k
    default:return_trace (c->default_return_value ());
4232
7.16k
    }
4233
7.16k
  }
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
4219
157
  {
4220
157
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
4221
157
    TRACE_DISPATCH (this, u.format.v);
4222
157
    switch (u.format.v) {
4223
4
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
4224
16
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
4225
29
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
4226
0
#ifndef HB_NO_BEYOND_64K
4227
2
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
4228
0
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
4229
1
    case 6: hb_barrier (); return_trace (c->dispatch (u.format6, std::forward<Ts> (ds)...));
4230
0
#endif
4231
105
    default:return_trace (c->default_return_value ());
4232
157
    }
4233
157
  }
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::Context::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::hb_depend_context_t::return_t OT::Context::dispatch<OT::hb_depend_context_t>(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Context::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Context::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const
4234
4235
  protected:
4236
  union {
4237
  struct { HBUINT16 v; }  format;   /* Format identifier */
4238
  ContextFormat1_4<SmallTypes>  format1;
4239
  ContextFormat2_5<SmallTypes>  format2;
4240
  ContextFormat3_6<SmallTypes>  format3;
4241
#ifndef HB_NO_BEYOND_64K
4242
  ContextFormat1_4<MediumTypes> format4;
4243
  ContextFormat2_5<MediumTypes> format5;
4244
  ContextFormat3_6<MediumTypes> format6;
4245
#endif
4246
  } u;
4247
};
4248
4249
4250
/* Chaining Contextual lookups */
4251
4252
struct ChainContextClosureLookupContext
4253
{
4254
  ContextClosureFuncs funcs;
4255
  ContextFormat context_format;
4256
  const void *intersects_data[3];
4257
  void *intersects_cache[3];
4258
  void *intersected_glyphs_cache;
4259
};
4260
4261
typedef ChainContextClosureLookupContext ChainContextDependLookupContext;
4262
4263
struct ChainContextCollectGlyphsLookupContext
4264
{
4265
  ContextCollectGlyphsFuncs funcs;
4266
  const void *collect_data[3];
4267
};
4268
4269
struct ChainContextApplyLookupContext
4270
{
4271
  ChainContextApplyFuncs funcs;
4272
  const void *match_data[3];
4273
  get_value_func_t get_input_value;
4274
};
4275
4276
static inline bool chain_context_intersects (const hb_set_t *glyphs,
4277
               unsigned int backtrackCount,
4278
               glyph_data_t backtrack,
4279
               unsigned int inputCount, /* Including the first glyph (not matched) */
4280
               glyph_data_t input, /* Array of input values--start with second glyph */
4281
               unsigned int lookaheadCount,
4282
               glyph_data_t lookahead,
4283
               ChainContextClosureLookupContext &lookup_context)
4284
0
{
4285
0
  bool bt_ok = array_is_subset_of (glyphs,
4286
0
           backtrackCount, backtrack,
4287
0
           lookup_context.funcs.intersects,
4288
0
           lookup_context.intersects_data[0],
4289
0
           lookup_context.intersects_cache[0]);
4290
0
  bool in_ok = array_is_subset_of (glyphs,
4291
0
           inputCount ? inputCount - 1 : 0, input,
4292
0
           lookup_context.funcs.intersects,
4293
0
           lookup_context.intersects_data[1],
4294
0
           lookup_context.intersects_cache[1]);
4295
0
  bool la_ok = array_is_subset_of (glyphs,
4296
0
           lookaheadCount, lookahead,
4297
0
           lookup_context.funcs.intersects,
4298
0
           lookup_context.intersects_data[2],
4299
0
           lookup_context.intersects_cache[2]);
4300
4301
0
  return bt_ok && in_ok && la_ok;
4302
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_intersects(hb_set_t const*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, OT::ChainContextClosureLookupContext&)
4303
4304
static inline void chain_context_closure_lookup (hb_closure_context_t *c,
4305
             unsigned int backtrackCount,
4306
             glyph_data_t backtrack,
4307
             unsigned int inputCount, /* Including the first glyph (not matched) */
4308
             glyph_data_t input, /* Array of input values--start with second glyph */
4309
             unsigned int lookaheadCount,
4310
             glyph_data_t lookahead,
4311
             unsigned int lookupCount,
4312
             const LookupRecord lookupRecord[],
4313
             unsigned value,
4314
             ChainContextClosureLookupContext &lookup_context)
4315
0
{
4316
0
  if (chain_context_intersects (c->glyphs,
4317
0
        backtrackCount, backtrack,
4318
0
        inputCount, input,
4319
0
        lookaheadCount, lookahead,
4320
0
        lookup_context))
4321
0
    context_closure_recurse_lookups (c,
4322
0
         inputCount, input,
4323
0
         lookupCount, lookupRecord,
4324
0
         value,
4325
0
         lookup_context.context_format,
4326
0
         lookup_context.intersects_data[1],
4327
0
         lookup_context.funcs.intersected_glyphs,
4328
0
         lookup_context.intersected_glyphs_cache);
4329
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_closure_lookup(OT::hb_closure_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&)
4330
4331
static inline void chain_context_depend_lookup (hb_depend_context_t *c,
4332
            unsigned int backtrackCount,
4333
            glyph_data_t backtrack,
4334
            unsigned int inputCount, /* Including the first glyph (not matched) */
4335
            glyph_data_t input, /* Array of input values--start with second glyph */
4336
            unsigned int lookaheadCount,
4337
            glyph_data_t lookahead,
4338
            unsigned int lookupCount,
4339
            const LookupRecord lookupRecord[],
4340
            const void *rule,
4341
            unsigned value,
4342
            ChainContextDependLookupContext &lookup_context)
4343
0
{
4344
0
  if (!chain_context_intersects (c->glyphs,
4345
0
         backtrackCount, backtrack,
4346
0
         inputCount, input,
4347
0
         lookaheadCount, lookahead,
4348
0
         lookup_context))
4349
0
    return;
4350
0
4351
0
  hb_depend_context_t::depend_scratch_t *scratch = c->acquire_depend_scratch ();
4352
0
  if (unlikely (!scratch))
4353
0
    return;
4354
0
  HB_SCOPE_GUARD (c->release_depend_scratch (scratch));
4355
0
4356
0
  bool context_sets_cached = context_depend_sets_are_cached (
4357
0
    c, inputCount, lookupCount, lookupRecord, rule, value,
4358
0
    lookup_context.context_format, lookup_context.intersects_data[1],
4359
0
    &scratch->cached_context_sets);
4360
0
  if (unlikely (!c->depend_data->successful))
4361
0
    return;
4362
0
  if (context_sets_cached)
4363
0
  {
4364
0
    context_depend_recurse_lookups (c,
4365
0
            inputCount, input,
4366
0
            lookupCount, lookupRecord,
4367
0
            rule,
4368
0
            value,
4369
0
            lookup_context.context_format,
4370
0
            lookup_context.intersects_data[1],
4371
0
            lookup_context.funcs.intersected_glyphs,
4372
0
            lookup_context.intersected_glyphs_cache,
4373
0
            scratch->preliminary_context,
4374
0
            nullptr,
4375
0
            &scratch->cached_context_sets,
4376
0
            scratch);
4377
0
    return;
4378
0
  }
4379
0
4380
0
  /* Cache misses and rules without valid records still perform the original
4381
0
   * dependency-set interning in its observable order. */
4382
0
  hb_set_t &position_scratch = scratch->position_scratch;
4383
0
  hb_vector_t<const hb_set_t *> &backtrack_sets = scratch->backtrack_sets;
4384
0
  hb_vector_t<const hb_set_t *> &lookahead_sets = scratch->lookahead_sets;
4385
0
4386
0
  /* Extract backtrack glyphs */
4387
0
  for (unsigned i = 0; i < backtrackCount; i++)
4388
0
  {
4389
0
    const hb_set_t *pos_glyphs = depend_position_glyphs (
4390
0
      c, lookup_context.context_format, lookup_context.intersects_data[0],
4391
0
      backtrack[i], false, &position_scratch);
4392
0
    if (unlikely (!pos_glyphs))
4393
0
      return;
4394
0
    if (!pos_glyphs->is_empty ())
4395
0
    {
4396
0
      if (unlikely (!backtrack_sets.push_or_fail (pos_glyphs)))
4397
0
      {
4398
0
        c->depend_data->fail ();
4399
0
        return;
4400
0
      }
4401
0
    }
4402
0
  }
4403
0
4404
0
  /* Extract lookahead glyphs */
4405
0
  for (unsigned i = 0; i < lookaheadCount; i++)
4406
0
  {
4407
0
    const hb_set_t *pos_glyphs = depend_position_glyphs (
4408
0
      c, lookup_context.context_format, lookup_context.intersects_data[2],
4409
0
      lookahead[i], false, &position_scratch);
4410
0
    if (unlikely (!pos_glyphs))
4411
0
      return;
4412
0
    if (!pos_glyphs->is_empty ())
4413
0
    {
4414
0
      if (unlikely (!lookahead_sets.push_or_fail (pos_glyphs)))
4415
0
      {
4416
0
        c->depend_data->fail ();
4417
0
        return;
4418
0
      }
4419
0
    }
4420
0
  }
4421
0
4422
0
  /* Build preliminary_context with backtrack + lookahead encoded */
4423
0
  hb_set_t &preliminary_context = scratch->preliminary_context;
4424
0
  for (const hb_set_t *back_set : backtrack_sets)
4425
0
  {
4426
0
    if (back_set->get_population () == 1) {
4427
0
      preliminary_context.add (back_set->get_min ());  // Direct glyph
4428
0
    } else if (back_set->get_population () > 1) {
4429
0
      hb_codepoint_t set_idx = lookup_context.context_format == ContextFormat::SimpleContext
4430
0
        ? c->depend_data->find_or_create_context_set (*back_set)
4431
0
        : c->find_or_create_cached_context_set (back_set);
4432
0
      if (unlikely (set_idx == HB_CODEPOINT_INVALID))
4433
0
        return;
4434
0
      preliminary_context.add (HB_DEPEND_CONTEXT_SET_FLAG | set_idx);  // Encoded set reference
4435
0
    }
4436
0
  }
4437
0
  for (const hb_set_t *look_set : lookahead_sets)
4438
0
  {
4439
0
    if (look_set->get_population () == 1) {
4440
0
      preliminary_context.add (look_set->get_min ());  // Direct glyph
4441
0
    } else if (look_set->get_population () > 1) {
4442
0
      hb_codepoint_t set_idx = lookup_context.context_format == ContextFormat::SimpleContext
4443
0
        ? c->depend_data->find_or_create_context_set (*look_set)
4444
0
        : c->find_or_create_cached_context_set (look_set);
4445
0
      if (unlikely (set_idx == HB_CODEPOINT_INVALID))
4446
0
        return;
4447
0
      preliminary_context.add (HB_DEPEND_CONTEXT_SET_FLAG | set_idx);  // Encoded set reference
4448
0
    }
4449
0
  }
4450
0
  if (unlikely (preliminary_context.in_error ()))
4451
0
  {
4452
0
    c->depend_data->fail ();
4453
0
    return;
4454
0
  }
4455
0
4456
0
  /* Build glyph sets for ALL input positions */
4457
0
  hb_vector_t<const hb_set_t *> &input_position_glyphs = scratch->input_position_glyphs;
4458
0
4459
0
  if (!context_sets_cached)
4460
0
  {
4461
0
    /* Position 0 (first input coverage/class/glyph) — must be in both the
4462
0
     * class AND the coverage, so intersect with parent_active_glyphs. */
4463
0
    const hb_set_t *pos0_glyphs = depend_position_glyphs (
4464
0
      c, lookup_context.context_format, lookup_context.intersects_data[1], value,
4465
0
      true, &position_scratch, &scratch->compact_workspace);
4466
0
    if (unlikely (!pos0_glyphs ||
4467
0
      !input_position_glyphs.push_or_fail (pos0_glyphs)))
4468
0
    {
4469
0
      c->depend_data->fail ();
4470
0
      return;
4471
0
    }
4472
0
4473
0
    /* Positions 1+ (Input array) */
4474
0
    for (unsigned i = 0; i + 1 < inputCount; i++)
4475
0
    {
4476
0
      const hb_set_t *pos_glyphs = depend_position_glyphs (
4477
0
  c, lookup_context.context_format, lookup_context.intersects_data[1],
4478
0
  input[i], false, &position_scratch);
4479
0
      if (unlikely (!pos_glyphs ||
4480
0
        !input_position_glyphs.push_or_fail (pos_glyphs)))
4481
0
      {
4482
0
  c->depend_data->fail ();
4483
0
  return;
4484
0
      }
4485
0
    }
4486
0
  }
4487
0
4488
0
  context_depend_recurse_lookups (c,
4489
0
          inputCount, input,
4490
0
          lookupCount, lookupRecord,
4491
0
          rule,
4492
0
          value,
4493
0
          lookup_context.context_format,
4494
0
          lookup_context.intersects_data[1],
4495
0
          lookup_context.funcs.intersected_glyphs,
4496
0
          lookup_context.intersected_glyphs_cache,
4497
0
          preliminary_context,
4498
0
          context_sets_cached ? nullptr : &input_position_glyphs,
4499
0
          context_sets_cached ? &scratch->cached_context_sets : nullptr,
4500
0
          scratch);
4501
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_depend_lookup(OT::hb_depend_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, void const*, unsigned int, OT::ChainContextClosureLookupContext&)
4502
4503
static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
4504
              unsigned int backtrackCount,
4505
              glyph_data_t backtrack,
4506
              unsigned int inputCount, /* Including the first glyph (not matched) */
4507
              glyph_data_t input, /* Array of input values--start with second glyph */
4508
              unsigned int lookaheadCount,
4509
              glyph_data_t lookahead,
4510
              unsigned int lookupCount,
4511
              const LookupRecord lookupRecord[],
4512
              ChainContextCollectGlyphsLookupContext &lookup_context)
4513
0
{
4514
0
  collect_array (c, c->before,
4515
0
     backtrackCount, backtrack,
4516
0
     lookup_context.funcs.collect, lookup_context.collect_data[0]);
4517
0
  collect_array (c, c->input,
4518
0
     inputCount ? inputCount - 1 : 0, input,
4519
0
     lookup_context.funcs.collect, lookup_context.collect_data[1]);
4520
0
  collect_array (c, c->after,
4521
0
     lookaheadCount, lookahead,
4522
0
     lookup_context.funcs.collect, lookup_context.collect_data[2]);
4523
0
  recurse_lookups (c,
4524
0
       lookupCount, lookupRecord);
4525
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-layout.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_collect_glyphs_lookup(OT::hb_collect_glyphs_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&)
4526
4527
static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c,
4528
                 unsigned int backtrackCount,
4529
                 glyph_data_t backtrack HB_UNUSED,
4530
                 unsigned int inputCount, /* Including the first glyph (not matched) */
4531
                 glyph_data_t input, /* Array of input values--start with second glyph */
4532
                 unsigned int lookaheadCount,
4533
                 glyph_data_t lookahead HB_UNUSED,
4534
                 unsigned int lookupCount HB_UNUSED,
4535
                 const LookupRecord lookupRecord[] HB_UNUSED,
4536
                 const ChainContextApplyLookupContext &lookup_context)
4537
0
{
4538
0
  return (c->zero_context ? !backtrackCount && !lookaheadCount : true)
4539
0
      && would_match_input (c,
4540
0
          inputCount, input,
4541
0
          lookup_context.funcs.match[1], lookup_context.match_data[1]);
4542
0
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-layout.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_would_apply_lookup(OT::hb_would_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
4543
4544
static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
4545
                 unsigned int backtrackCount,
4546
                 glyph_data_t backtrack,
4547
                 unsigned int inputCount, /* Including the first glyph (not matched) */
4548
                 glyph_data_t input, /* Array of input values--start with second glyph */
4549
                 unsigned int lookaheadCount,
4550
                 glyph_data_t lookahead,
4551
                 unsigned int lookupCount,
4552
                 const LookupRecord lookupRecord[],
4553
                 const ChainContextApplyLookupContext &lookup_context)
4554
2.08M
{
4555
2.08M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
4556
4557
2.08M
  unsigned start_index = c->buffer->out_len;
4558
2.08M
  unsigned end_index = c->buffer->idx;
4559
2.08M
  unsigned match_end = 0;
4560
2.08M
  bool ret = true;
4561
2.08M
  if (!(match_input (c,
4562
2.08M
         inputCount, input,
4563
2.08M
         lookup_context.funcs.match[1], lookup_context.match_data[1],
4564
2.08M
         &match_end) && (end_index = match_end)
4565
1.90M
       && match_lookahead (c,
4566
1.90M
         lookaheadCount, lookahead,
4567
1.90M
         lookup_context.funcs.match[2], lookup_context.match_data[2],
4568
1.90M
         match_end, &end_index)))
4569
710k
  {
4570
710k
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
4571
710k
    return false;
4572
710k
  }
4573
4574
1.37M
  if (!match_backtrack (c,
4575
1.37M
      backtrackCount, backtrack,
4576
1.37M
      lookup_context.funcs.match[0], lookup_context.match_data[0],
4577
1.37M
      &start_index))
4578
1.30M
  {
4579
1.30M
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
4580
1.30M
    return false;
4581
1.30M
  }
4582
4583
70.9k
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
4584
70.9k
  apply_lookup (c,
4585
70.9k
    inputCount,
4586
70.9k
    lookupCount, lookupRecord,
4587
70.9k
    match_end);
4588
4589
70.9k
  return ret;
4590
1.37M
}
Unexecuted instantiation: hb-aat-layout.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-face.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
hb-ot-layout.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Line
Count
Source
4554
2.08M
{
4555
2.08M
  if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
4556
4557
2.08M
  unsigned start_index = c->buffer->out_len;
4558
2.08M
  unsigned end_index = c->buffer->idx;
4559
2.08M
  unsigned match_end = 0;
4560
2.08M
  bool ret = true;
4561
2.08M
  if (!(match_input (c,
4562
2.08M
         inputCount, input,
4563
2.08M
         lookup_context.funcs.match[1], lookup_context.match_data[1],
4564
2.08M
         &match_end) && (end_index = match_end)
4565
1.90M
       && match_lookahead (c,
4566
1.90M
         lookaheadCount, lookahead,
4567
1.90M
         lookup_context.funcs.match[2], lookup_context.match_data[2],
4568
1.90M
         match_end, &end_index)))
4569
710k
  {
4570
710k
    c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
4571
710k
    return false;
4572
710k
  }
4573
4574
1.37M
  if (!match_backtrack (c,
4575
1.37M
      backtrackCount, backtrack,
4576
1.37M
      lookup_context.funcs.match[0], lookup_context.match_data[0],
4577
1.37M
      &start_index))
4578
1.30M
  {
4579
1.30M
    c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
4580
1.30M
    return false;
4581
1.30M
  }
4582
4583
70.9k
  c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
4584
70.9k
  apply_lookup (c,
4585
70.9k
    inputCount,
4586
70.9k
    lookupCount, lookupRecord,
4587
70.9k
    match_end);
4588
4589
70.9k
  return ret;
4590
1.37M
}
Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-plan-layout.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-layout.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-var.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-cff.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-color.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: hb-subset-table-other.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
Unexecuted instantiation: gsubgpos-context.cc:OT::chain_context_apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::glyph_data_t, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&)
4591
4592
template <typename Types>
4593
struct ChainRule
4594
{
4595
  template <typename SetTypes, typename ChainRuleType>
4596
  friend struct ChainRuleSetOf;
4597
4598
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
4599
0
  {
4600
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4601
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4602
0
    return chain_context_intersects (glyphs,
4603
0
             backtrack.len, backtrack.arrayZ,
4604
0
             input.lenP1, input.arrayZ,
4605
0
             lookahead.len, lookahead.arrayZ,
4606
0
             lookup_context);
4607
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
4608
4609
  void depend (hb_depend_context_t *c, unsigned value, ChainContextDependLookupContext &lookup_context) const
4610
0
  {
4611
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4612
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4613
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4614
0
    chain_context_depend_lookup (c,
4615
0
         backtrack.len, backtrack.arrayZ,
4616
0
         input.lenP1, input.arrayZ,
4617
0
         lookahead.len, lookahead.arrayZ,
4618
0
         lookup.len, lookup.arrayZ,
4619
0
         this,
4620
0
         value,
4621
0
         lookup_context);
4622
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
4623
4624
  void closure (hb_closure_context_t *c, unsigned value,
4625
    ChainContextClosureLookupContext &lookup_context) const
4626
0
  {
4627
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
4628
4629
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4630
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4631
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4632
0
    chain_context_closure_lookup (c,
4633
0
          backtrack.len, backtrack.arrayZ,
4634
0
          input.lenP1, input.arrayZ,
4635
0
          lookahead.len, lookahead.arrayZ,
4636
0
          lookup.len, lookup.arrayZ,
4637
0
          value,
4638
0
          lookup_context);
4639
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
4640
4641
  void closure_lookups (hb_closure_lookups_context_t *c,
4642
                        ChainContextClosureLookupContext &lookup_context) const
4643
0
  {
4644
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
4645
0
    if (!intersects (c->glyphs, lookup_context)) return;
4646
4647
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4648
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4649
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4650
0
    recurse_lookups (c, lookup.len, lookup.arrayZ);
4651
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
4652
4653
  void collect_glyphs (hb_collect_glyphs_context_t *c,
4654
           ChainContextCollectGlyphsLookupContext &lookup_context) const
4655
0
  {
4656
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4657
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4658
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4659
0
    chain_context_collect_glyphs_lookup (c,
4660
0
           backtrack.len, backtrack.arrayZ,
4661
0
           input.lenP1, input.arrayZ,
4662
0
           lookahead.len, lookahead.arrayZ,
4663
0
           lookup.len, lookup.arrayZ,
4664
0
           lookup_context);
4665
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
4666
4667
  void collect_second_glyphs (hb_set_digest_t *digest,
4668
            const ClassDef *input_class_def = nullptr,
4669
            const ClassDef *lookahead_class_def = nullptr) const
4670
171
  {
4671
171
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4672
171
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4673
4674
171
    unsigned second;
4675
171
    const ClassDef *class_def;
4676
171
    if (input.lenP1 > 1)
4677
41
    {
4678
41
      second = input.arrayZ[0];
4679
41
      class_def = input_class_def;
4680
41
    }
4681
130
    else if (lookahead.len)
4682
45
    {
4683
45
      second = lookahead.arrayZ[0];
4684
45
      class_def = lookahead_class_def;
4685
45
    }
4686
85
    else
4687
85
    {
4688
85
      *digest = hb_set_digest_t::full ();
4689
85
      return;
4690
85
    }
4691
4692
86
    if (!class_def)
4693
69
      digest->add (second);
4694
17
    else if (!second)
4695
5
      *digest = hb_set_digest_t::full ();
4696
12
    else
4697
12
      class_def->collect_class (digest, second);
4698
86
  }
OT::ChainRule<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const
Line
Count
Source
4670
171
  {
4671
171
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4672
171
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4673
4674
171
    unsigned second;
4675
171
    const ClassDef *class_def;
4676
171
    if (input.lenP1 > 1)
4677
41
    {
4678
41
      second = input.arrayZ[0];
4679
41
      class_def = input_class_def;
4680
41
    }
4681
130
    else if (lookahead.len)
4682
45
    {
4683
45
      second = lookahead.arrayZ[0];
4684
45
      class_def = lookahead_class_def;
4685
45
    }
4686
85
    else
4687
85
    {
4688
85
      *digest = hb_set_digest_t::full ();
4689
85
      return;
4690
85
    }
4691
4692
86
    if (!class_def)
4693
69
      digest->add (second);
4694
17
    else if (!second)
4695
5
      *digest = hb_set_digest_t::full ();
4696
12
    else
4697
12
      class_def->collect_class (digest, second);
4698
86
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const
4699
4700
  bool would_apply (hb_would_apply_context_t *c,
4701
        const ChainContextApplyLookupContext &lookup_context) const
4702
0
  {
4703
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4704
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4705
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4706
0
    return chain_context_would_apply_lookup (c,
4707
0
               backtrack.len, backtrack.arrayZ,
4708
0
               input.lenP1, input.arrayZ,
4709
0
               lookahead.len, lookahead.arrayZ, lookup.len,
4710
0
               lookup.arrayZ, lookup_context);
4711
0
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
4712
4713
  bool apply (hb_ot_apply_context_t *c,
4714
        const ChainContextApplyLookupContext &lookup_context) const
4715
1.80k
  {
4716
1.80k
    TRACE_APPLY (this);
4717
1.80k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4718
1.80k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4719
1.80k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4720
1.80k
    return_trace (chain_context_apply_lookup (c,
4721
1.80k
                backtrack.len, backtrack.arrayZ,
4722
1.80k
                input.lenP1, input.arrayZ,
4723
1.80k
                lookahead.len, lookahead.arrayZ, lookup.len,
4724
1.80k
                lookup.arrayZ, lookup_context));
4725
1.80k
  }
OT::ChainRule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Line
Count
Source
4715
1.80k
  {
4716
1.80k
    TRACE_APPLY (this);
4717
1.80k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4718
1.80k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4719
1.80k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4720
1.80k
    return_trace (chain_context_apply_lookup (c,
4721
1.80k
                backtrack.len, backtrack.arrayZ,
4722
1.80k
                input.lenP1, input.arrayZ,
4723
1.80k
                lookahead.len, lookahead.arrayZ, lookup.len,
4724
1.80k
                lookup.arrayZ, lookup_context));
4725
1.80k
  }
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
4726
4727
  template<typename Iterator,
4728
     hb_requires (hb_is_iterator (Iterator))>
4729
  void serialize_array (hb_serialize_context_t *c,
4730
      HBUINT16 len,
4731
      Iterator it) const
4732
0
  {
4733
0
    c->copy (len);
4734
0
    for (const auto g : it)
4735
0
    {
4736
0
      typename Types::HBUINT d;
4737
0
      d = g;
4738
0
      c->copy (d);
4739
0
    }
4740
0
  }
Unexecuted instantiation: _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_
Unexecuted instantiation: _ZNK2OT9ChainRuleINS_6Layout11MediumTypesEE15serialize_arrayI13hb_map_iter_tI10hb_array_tIKNS_7NumTypeILb1EjLj3EEEERPK8hb_map_tL24hb_function_sortedness_t0ELPv0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSJ_6item_tEEE5valueEvE4typeELSG_0EEEvP22hb_serialize_context_tNS7_ILb1EtLj2EEESJ_
4741
4742
  bool serialize (hb_serialize_context_t *c,
4743
      const hb_map_t *lookup_map,
4744
      const hb_map_t *backtrack_map,
4745
      const hb_map_t *input_map = nullptr,
4746
      const hb_map_t *lookahead_map = nullptr) const
4747
0
  {
4748
0
    TRACE_SERIALIZE (this);
4749
4750
0
    const hb_map_t *mapping = backtrack_map;
4751
0
    serialize_array (c, backtrack.len, + backtrack.iter ()
4752
0
               | hb_map (mapping));
4753
4754
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4755
0
    if (input_map) mapping = input_map;
4756
0
    serialize_array (c, input.lenP1, + input.iter ()
4757
0
             | hb_map (mapping));
4758
4759
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4760
0
    if (lookahead_map) mapping = lookahead_map;
4761
0
    serialize_array (c, lookahead.len, + lookahead.iter ()
4762
0
               | hb_map (mapping));
4763
4764
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4765
4766
0
    HBUINT16* lookupCount = c->embed (&(lookup.len));
4767
0
    if (!lookupCount) return_trace (false);
4768
4769
0
    unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map);
4770
0
    return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
4771
0
  }
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
4772
4773
  bool subset (hb_subset_context_t *c,
4774
         const hb_map_t *lookup_map,
4775
         const hb_map_t *backtrack_map = nullptr,
4776
         const hb_map_t *input_map = nullptr,
4777
         const hb_map_t *lookahead_map = nullptr) const
4778
0
  {
4779
0
    TRACE_SUBSET (this);
4780
4781
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4782
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4783
4784
0
    if (!backtrack_map)
4785
0
    {
4786
0
      const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
4787
0
      if (!hb_all (backtrack, glyphset) ||
4788
0
    !hb_all (input, glyphset) ||
4789
0
    !hb_all (lookahead, glyphset))
4790
0
  return_trace (false);
4791
4792
0
      serialize (c->serializer, lookup_map, c->plan->glyph_map);
4793
0
    }
4794
0
    else
4795
0
    {
4796
0
      if (!hb_all (backtrack, backtrack_map) ||
4797
0
    !hb_all (input, input_map) ||
4798
0
    !hb_all (lookahead, lookahead_map))
4799
0
  return_trace (false);
4800
4801
0
      serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map);
4802
0
    }
4803
4804
0
    return_trace (true);
4805
0
  }
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const
4806
4807
  bool sanitize (hb_sanitize_context_t *c) const
4808
359k
  {
4809
359k
    TRACE_SANITIZE (this);
4810
    /* Hyper-optimized sanitized because this is really hot. */
4811
359k
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
4812
359k
    hb_barrier ();
4813
359k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4814
359k
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
4815
359k
    hb_barrier ();
4816
359k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4817
359k
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
4818
359k
    hb_barrier ();
4819
359k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4820
359k
    return_trace (likely (lookup.sanitize (c)));
4821
359k
  }
OT::ChainRule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4808
359k
  {
4809
359k
    TRACE_SANITIZE (this);
4810
    /* Hyper-optimized sanitized because this is really hot. */
4811
359k
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
4812
359k
    hb_barrier ();
4813
359k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4814
359k
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
4815
359k
    hb_barrier ();
4816
359k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4817
359k
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
4818
359k
    hb_barrier ();
4819
359k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4820
359k
    return_trace (likely (lookup.sanitize (c)));
4821
359k
  }
OT::ChainRule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
4808
17
  {
4809
17
    TRACE_SANITIZE (this);
4810
    /* Hyper-optimized sanitized because this is really hot. */
4811
17
    if (unlikely (!backtrack.len.sanitize (c))) return_trace (false);
4812
15
    hb_barrier ();
4813
15
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
4814
15
    if (unlikely (!input.lenP1.sanitize (c))) return_trace (false);
4815
14
    hb_barrier ();
4816
14
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
4817
14
    if (unlikely (!lookahead.len.sanitize (c))) return_trace (false);
4818
13
    hb_barrier ();
4819
13
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
4820
13
    return_trace (likely (lookup.sanitize (c)));
4821
14
  }
4822
4823
  protected:
4824
  Array16Of<typename Types::HBUINT>
4825
    backtrack;    /* Array of backtracking values
4826
           * (to be matched before the input
4827
           * sequence) */
4828
  HeadlessArray16Of<typename Types::HBUINT>
4829
    inputX;     /* Array of input values (start with
4830
           * second glyph) */
4831
  Array16Of<typename Types::HBUINT>
4832
    lookaheadX;   /* Array of lookahead values's (to be
4833
           * matched after the input sequence) */
4834
  Array16Of<LookupRecord>
4835
    lookupX;    /* Array of LookupRecords--in
4836
           * design order) */
4837
  public:
4838
  DEFINE_SIZE_MIN (8);
4839
};
4840
4841
template <typename Types, typename ChainRuleType>
4842
struct ChainRuleSetOf
4843
{
4844
  bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
4845
0
  {
4846
0
    return
4847
0
    + hb_iter (rule)
4848
0
    | hb_map (hb_add (this))
4849
0
    | hb_map ([&] (const ChainRuleType &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
4850
0
    | hb_any
4851
0
    ;
4852
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const
4853
4854
  void collect_first_input_classes (hb_ot_layout_ruleset_digest_t *digest) const
4855
9
  {
4856
9
    digest->init ();
4857
13
    for (unsigned i = 0; i < rule.len; i++)
4858
10
    {
4859
10
      const ChainRuleType &r = this+rule.arrayZ[i];
4860
10
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
4861
10
      if (input.lenP1 <= 1)
4862
6
      {
4863
6
  digest->set_full ();
4864
6
  return;
4865
6
      }
4866
4
      digest->add (input.arrayZ[0]);
4867
4
    }
4868
9
  }
OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_first_input_classes(OT::hb_ot_layout_ruleset_digest_t*) const
Line
Count
Source
4855
8
  {
4856
8
    digest->init ();
4857
12
    for (unsigned i = 0; i < rule.len; i++)
4858
10
    {
4859
10
      const ChainRuleType &r = this+rule.arrayZ[i];
4860
10
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
4861
10
      if (input.lenP1 <= 1)
4862
6
      {
4863
6
  digest->set_full ();
4864
6
  return;
4865
6
      }
4866
4
      digest->add (input.arrayZ[0]);
4867
4
    }
4868
8
  }
OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_first_input_classes(OT::hb_ot_layout_ruleset_digest_t*) const
Line
Count
Source
4855
1
  {
4856
1
    digest->init ();
4857
1
    for (unsigned i = 0; i < rule.len; i++)
4858
0
    {
4859
0
      const ChainRuleType &r = this+rule.arrayZ[i];
4860
0
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
4861
0
      if (input.lenP1 <= 1)
4862
0
      {
4863
0
  digest->set_full ();
4864
0
  return;
4865
0
      }
4866
0
      digest->add (input.arrayZ[0]);
4867
0
    }
4868
1
  }
4869
  void depend (hb_depend_context_t *c, unsigned value, ChainContextDependLookupContext &lookup_context) const
4870
0
  {
4871
0
    + hb_iter (rule)
4872
0
    | hb_map (hb_add (this))
4873
0
    | hb_apply ([&] (const ChainRuleType &_) { _.depend (c, value, lookup_context); })
4874
0
    ;
4875
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::depend(OT::hb_depend_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
4876
  void closure (hb_closure_context_t *c, unsigned value, ChainContextClosureLookupContext &lookup_context) const
4877
0
  {
4878
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
4879
4880
0
    return
4881
0
    + hb_iter (rule)
4882
0
    | hb_map (hb_add (this))
4883
0
    | hb_apply ([&] (const ChainRuleType &_) { _.closure (c, value, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
4884
0
    ;
4885
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const
4886
4887
  void closure_lookups (hb_closure_lookups_context_t *c,
4888
                        ChainContextClosureLookupContext &lookup_context) const
4889
0
  {
4890
0
    if (unlikely (c->lookup_limit_exceeded ())) return;
4891
4892
0
    + hb_iter (rule)
4893
0
    | hb_map (hb_add (this))
4894
0
    | hb_apply ([&] (const ChainRuleType &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
4895
0
    ;
4896
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const
4897
4898
  void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const
4899
0
  {
4900
0
    return
4901
0
    + hb_iter (rule)
4902
0
    | hb_map (hb_add (this))
4903
0
    | hb_apply ([&] (const ChainRuleType &_) { _.collect_glyphs (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<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::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
4904
0
    ;
4905
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const
4906
4907
  void collect_second_glyphs (hb_set_digest_t *digest,
4908
            const ClassDef *input_class_def = nullptr,
4909
            const ClassDef *lookahead_class_def = nullptr) const
4910
150
  {
4911
150
    + hb_iter (rule)
4912
150
    | hb_map (hb_add (this))
4913
150
    | hb_apply ([=] (const ChainRuleType &_)
4914
171
    { _.collect_second_glyphs (digest, input_class_def, lookahead_class_def); })
OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Line
Count
Source
4914
171
    { _.collect_second_glyphs (digest, input_class_def, lookahead_class_def); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
4915
150
    ;
4916
150
  }
OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const
Line
Count
Source
4910
149
  {
4911
149
    + hb_iter (rule)
4912
149
    | hb_map (hb_add (this))
4913
149
    | hb_apply ([=] (const ChainRuleType &_)
4914
149
    { _.collect_second_glyphs (digest, input_class_def, lookahead_class_def); })
4915
149
    ;
4916
149
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const
OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::collect_second_glyphs(hb_set_digest_t*, OT::ClassDef const*, OT::ClassDef const*) const
Line
Count
Source
4910
1
  {
4911
1
    + hb_iter (rule)
4912
1
    | hb_map (hb_add (this))
4913
1
    | hb_apply ([=] (const ChainRuleType &_)
4914
1
    { _.collect_second_glyphs (digest, input_class_def, lookahead_class_def); })
4915
1
    ;
4916
1
  }
4917
4918
  bool would_apply (hb_would_apply_context_t *c,
4919
        const ChainContextApplyLookupContext &lookup_context) const
4920
0
  {
4921
0
    return
4922
0
    + hb_iter (rule)
4923
0
    | hb_map (hb_add (this))
4924
0
    | hb_map ([&] (const ChainRuleType &_) { return _.would_apply (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<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
4925
0
    | hb_any
4926
0
    ;
4927
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const
4928
4929
  bool apply (hb_ot_apply_context_t *c,
4930
        const ChainContextApplyLookupContext &lookup_context,
4931
        const hb_ot_layout_ruleset_digest_t *digest = nullptr) const
4932
139k
  {
4933
139k
    TRACE_APPLY (this);
4934
4935
139k
    unsigned num_rules = rule.len;
4936
4937
139k
#ifndef HB_NO_OT_RULESETS_FAST_PATH
4938
139k
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
4939
139k
#endif
4940
139k
    {
4941
139k
    slow:
4942
139k
      return_trace (
4943
139k
      + hb_iter (rule)
4944
139k
      | hb_map (hb_add (this))
4945
139k
      | hb_map ([&] (const ChainRuleType &_) { return _.apply (c, lookup_context); })
4946
139k
      | hb_any
4947
139k
      )
4948
139k
      ;
4949
139k
    }
4950
4951
    /* This version is optimized for speed by matching the first & second
4952
     * components of the rule here, instead of calling into the matching code.
4953
     *
4954
     * Replicated from LigatureSet::apply(). */
4955
4956
    /* We use the iter_context instead of iter_input, to avoid skipping
4957
     * default-ignorables and such.
4958
     *
4959
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
4960
     */
4961
0
    auto &skippy_iter = c->iter_context;
4962
0
    skippy_iter.reset (c->buffer->idx);
4963
0
    skippy_iter.set_match_func (match_always, nullptr);
4964
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
4965
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
4966
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
4967
0
    bool matched = skippy_iter.next (&unsafe_to1);
4968
0
    if (likely (matched))
4969
0
    {
4970
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
4971
0
      {
4972
  /* Can't use the fast path if eg. the next char is a default-ignorable
4973
   * or other skippable. */
4974
0
        goto slow;
4975
0
      }
4976
4977
0
      first = &c->buffer->info[skippy_iter.idx];
4978
0
      unsafe_to1 = skippy_iter.idx + 1;
4979
4980
0
      if (digest && lookup_context.get_input_value &&
4981
0
    !digest->may_have (lookup_context.get_input_value (*first, lookup_context.match_data[1])))
4982
0
  {
4983
0
    c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
4984
0
    return_trace (false);
4985
0
  }
4986
0
    }
4987
0
    else
4988
0
    {
4989
0
      bool unsafe_to_concat = false;
4990
0
      bool ret =
4991
0
      + hb_iter (rule)
4992
0
      | hb_map (hb_add (this))
4993
0
      | hb_filter ([&] (const ChainRuleType &_)
4994
0
       {
4995
0
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
4996
0
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
4997
0
         if (input.lenP1 <= 1 && lookahead.len == 0) return true;
4998
0
         unsafe_to_concat = true;
4999
0
         return false;
5000
0
       })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#2}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#2}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#2}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
5001
0
      | hb_map ([&] (const ChainRuleType &_) { return _.apply (c, lookup_context); })
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#3}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#3}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#3}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) const
5002
0
      | hb_any
5003
0
      ;
5004
0
      if (unsafe_to_concat)
5005
0
  c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
5006
0
      return_trace (ret);
5007
0
    }
5008
0
    matched = skippy_iter.next ();
5009
0
    if (likely (matched))
5010
0
    {
5011
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
5012
0
      {
5013
  /* Can't use the fast path if eg. the next char is a default-ignorable
5014
   * or other skippable. */
5015
0
        goto slow;
5016
0
      }
5017
5018
0
      second = &c->buffer->info[skippy_iter.idx];
5019
0
      unsafe_to2 = skippy_iter.idx + 1;
5020
0
    }
5021
5022
0
    auto match_input = lookup_context.funcs.match[1];
5023
0
    auto match_lookahead = lookup_context.funcs.match[2];
5024
0
    auto *input_data = lookup_context.match_data[1];
5025
0
    auto *lookahead_data = lookup_context.match_data[2];
5026
0
    for (unsigned int i = 0; i < num_rules; i++)
5027
0
    {
5028
0
      const auto &r = this+rule.arrayZ[i];
5029
5030
0
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
5031
0
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
5032
5033
0
      unsigned lenP1 = input.lenP1;
5034
0
      if (lenP1 > 1 ?
5035
0
     (!match_input ||
5036
0
      match_input (*first, input.arrayZ[0], input_data))
5037
0
    :
5038
0
     (!lookahead.len || !match_lookahead ||
5039
0
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
5040
0
      {
5041
0
  lenP1 = hb_max (lenP1, 1u);
5042
0
        if (!second ||
5043
0
      (lenP1 > 2 ?
5044
0
       (!match_input ||
5045
0
        match_input (*second, input.arrayZ[1], input_data))
5046
0
       :
5047
0
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
5048
0
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
5049
0
  {
5050
0
    if (r.apply (c, lookup_context))
5051
0
    {
5052
0
      if (unsafe_to != (unsigned) -1)
5053
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
5054
0
      return_trace (true);
5055
0
    }
5056
0
  }
5057
0
  else
5058
0
    unsafe_to = unsafe_to2;
5059
0
      }
5060
0
      else
5061
0
      {
5062
0
  if (unsafe_to == (unsigned) -1)
5063
0
    unsafe_to = unsafe_to1;
5064
5065
0
  if (lenP1 > 1)
5066
0
  {
5067
    // Skip ahead to next possible first glyph match.
5068
0
    for (; i + 1 < num_rules; i++)
5069
0
    {
5070
0
      const auto &r2 = this+rule.arrayZ[i + 1];
5071
0
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
5072
0
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
5073
0
        break;
5074
0
    }
5075
0
  }
5076
0
      }
5077
0
    }
5078
0
    if (likely (unsafe_to != (unsigned) -1))
5079
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
5080
5081
0
    return_trace (false);
5082
0
  }
OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
Line
Count
Source
4932
139k
  {
4933
139k
    TRACE_APPLY (this);
4934
4935
139k
    unsigned num_rules = rule.len;
4936
4937
139k
#ifndef HB_NO_OT_RULESETS_FAST_PATH
4938
139k
    if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4)
4939
139k
#endif
4940
139k
    {
4941
139k
    slow:
4942
139k
      return_trace (
4943
139k
      + hb_iter (rule)
4944
139k
      | hb_map (hb_add (this))
4945
139k
      | hb_map ([&] (const ChainRuleType &_) { return _.apply (c, lookup_context); })
4946
139k
      | hb_any
4947
139k
      )
4948
139k
      ;
4949
139k
    }
4950
4951
    /* This version is optimized for speed by matching the first & second
4952
     * components of the rule here, instead of calling into the matching code.
4953
     *
4954
     * Replicated from LigatureSet::apply(). */
4955
4956
    /* We use the iter_context instead of iter_input, to avoid skipping
4957
     * default-ignorables and such.
4958
     *
4959
     * Related: https://github.com/harfbuzz/harfbuzz/issues/4813
4960
     */
4961
0
    auto &skippy_iter = c->iter_context;
4962
0
    skippy_iter.reset (c->buffer->idx);
4963
0
    skippy_iter.set_match_func (match_always, nullptr);
4964
0
    skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
4965
0
    unsigned unsafe_to = (unsigned) -1, unsafe_to1, unsafe_to2 = 0;
4966
0
    hb_glyph_info_t *first = nullptr, *second = nullptr;
4967
0
    bool matched = skippy_iter.next (&unsafe_to1);
4968
0
    if (likely (matched))
4969
0
    {
4970
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
4971
0
      {
4972
  /* Can't use the fast path if eg. the next char is a default-ignorable
4973
   * or other skippable. */
4974
0
        goto slow;
4975
0
      }
4976
4977
0
      first = &c->buffer->info[skippy_iter.idx];
4978
0
      unsafe_to1 = skippy_iter.idx + 1;
4979
4980
0
      if (digest && lookup_context.get_input_value &&
4981
0
    !digest->may_have (lookup_context.get_input_value (*first, lookup_context.match_data[1])))
4982
0
  {
4983
0
    c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
4984
0
    return_trace (false);
4985
0
  }
4986
0
    }
4987
0
    else
4988
0
    {
4989
0
      bool unsafe_to_concat = false;
4990
0
      bool ret =
4991
0
      + hb_iter (rule)
4992
0
      | hb_map (hb_add (this))
4993
0
      | hb_filter ([&] (const ChainRuleType &_)
4994
0
       {
4995
0
         const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
4996
0
         const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
4997
0
         if (input.lenP1 <= 1 && lookahead.len == 0) return true;
4998
0
         unsafe_to_concat = true;
4999
0
         return false;
5000
0
       })
5001
0
      | hb_map ([&] (const ChainRuleType &_) { return _.apply (c, lookup_context); })
5002
0
      | hb_any
5003
0
      ;
5004
0
      if (unsafe_to_concat)
5005
0
  c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to1);
5006
0
      return_trace (ret);
5007
0
    }
5008
0
    matched = skippy_iter.next ();
5009
0
    if (likely (matched))
5010
0
    {
5011
0
      if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))
5012
0
      {
5013
  /* Can't use the fast path if eg. the next char is a default-ignorable
5014
   * or other skippable. */
5015
0
        goto slow;
5016
0
      }
5017
5018
0
      second = &c->buffer->info[skippy_iter.idx];
5019
0
      unsafe_to2 = skippy_iter.idx + 1;
5020
0
    }
5021
5022
0
    auto match_input = lookup_context.funcs.match[1];
5023
0
    auto match_lookahead = lookup_context.funcs.match[2];
5024
0
    auto *input_data = lookup_context.match_data[1];
5025
0
    auto *lookahead_data = lookup_context.match_data[2];
5026
0
    for (unsigned int i = 0; i < num_rules; i++)
5027
0
    {
5028
0
      const auto &r = this+rule.arrayZ[i];
5029
5030
0
      const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack);
5031
0
      const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input);
5032
5033
0
      unsigned lenP1 = input.lenP1;
5034
0
      if (lenP1 > 1 ?
5035
0
     (!match_input ||
5036
0
      match_input (*first, input.arrayZ[0], input_data))
5037
0
    :
5038
0
     (!lookahead.len || !match_lookahead ||
5039
0
      match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
5040
0
      {
5041
0
  lenP1 = hb_max (lenP1, 1u);
5042
0
        if (!second ||
5043
0
      (lenP1 > 2 ?
5044
0
       (!match_input ||
5045
0
        match_input (*second, input.arrayZ[1], input_data))
5046
0
       :
5047
0
       (lookahead.len <= 2 - lenP1 || !match_lookahead ||
5048
0
        match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
5049
0
  {
5050
0
    if (r.apply (c, lookup_context))
5051
0
    {
5052
0
      if (unsafe_to != (unsigned) -1)
5053
0
        c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
5054
0
      return_trace (true);
5055
0
    }
5056
0
  }
5057
0
  else
5058
0
    unsafe_to = unsafe_to2;
5059
0
      }
5060
0
      else
5061
0
      {
5062
0
  if (unsafe_to == (unsigned) -1)
5063
0
    unsafe_to = unsafe_to1;
5064
5065
0
  if (lenP1 > 1)
5066
0
  {
5067
    // Skip ahead to next possible first glyph match.
5068
0
    for (; i + 1 < num_rules; i++)
5069
0
    {
5070
0
      const auto &r2 = this+rule.arrayZ[i + 1];
5071
0
      const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
5072
0
      if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
5073
0
        break;
5074
0
    }
5075
0
  }
5076
0
      }
5077
0
    }
5078
0
    if (likely (unsafe_to != (unsigned) -1))
5079
0
      c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to);
5080
5081
0
    return_trace (false);
5082
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&, OT::hb_ot_layout_ruleset_digest_t const*) const
5083
5084
  bool subset (hb_subset_context_t *c,
5085
         const hb_map_t *lookup_map,
5086
         const hb_map_t *backtrack_klass_map = nullptr,
5087
         const hb_map_t *input_klass_map = nullptr,
5088
         const hb_map_t *lookahead_klass_map = nullptr) const
5089
0
  {
5090
0
    TRACE_SUBSET (this);
5091
5092
0
    auto snap = c->serializer->snapshot ();
5093
0
    auto *out = c->serializer->start_embed (*this);
5094
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
5095
5096
0
    for (const auto& _ : rule)
5097
0
    {
5098
0
      if (!_) continue;
5099
0
      auto o_snap = c->serializer->snapshot ();
5100
0
      auto *o = out->rule.serialize_append (c->serializer);
5101
0
      if (unlikely (!o)) continue;
5102
5103
0
      if (!o->serialize_subset (c, _, this,
5104
0
        lookup_map,
5105
0
        backtrack_klass_map,
5106
0
        input_klass_map,
5107
0
        lookahead_klass_map))
5108
0
      {
5109
0
  out->rule.pop ();
5110
0
  c->serializer->revert (o_snap);
5111
0
      }
5112
0
    }
5113
5114
0
    bool ret = bool (out->rule);
5115
0
    if (!ret) c->serializer->revert (snap);
5116
5117
0
    return_trace (ret);
5118
0
  }
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::SmallTypes, 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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, 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
Unexecuted instantiation: OT::ChainRuleSetOf<OT::Layout::MediumTypes, 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
5119
5120
  bool sanitize (hb_sanitize_context_t *c) const
5121
1.70k
  {
5122
1.70k
    TRACE_SANITIZE (this);
5123
1.70k
    return_trace (rule.sanitize (c, this));
5124
1.70k
  }
OT::ChainRuleSetOf<OT::Layout::SmallTypes, OT::ChainRule<OT::Layout::SmallTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5121
1.63k
  {
5122
1.63k
    TRACE_SANITIZE (this);
5123
1.63k
    return_trace (rule.sanitize (c, this));
5124
1.63k
  }
OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::MediumTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5121
28
  {
5122
28
    TRACE_SANITIZE (this);
5123
28
    return_trace (rule.sanitize (c, this));
5124
28
  }
OT::ChainRuleSetOf<OT::Layout::MediumTypes, OT::ChainRule<OT::Layout::SmallTypes> >::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5121
42
  {
5122
42
    TRACE_SANITIZE (this);
5123
42
    return_trace (rule.sanitize (c, this));
5124
42
  }
5125
5126
  protected:
5127
  Array16Of<typename Types::template OffsetTo<ChainRuleType>>
5128
    rule;     /* Array of ChainRule tables
5129
           * ordered by preference */
5130
  public:
5131
  DEFINE_SIZE_ARRAY (2, rule);
5132
};
5133
5134
template <typename Types>
5135
struct ChainRuleSet : ChainRuleSetOf<Types, ChainRule<Types>> {};
5136
5137
static_assert (sizeof (ChainRuleSet<MediumTypes>) ==
5138
         HBUINT16::static_size + Offset24::static_size, "");
5139
5140
template <typename Types>
5141
struct ChainClassRuleSet : ChainRuleSetOf<Types, ChainRule<SmallTypes>> {};
5142
5143
template <typename Types>
5144
struct ChainContextFormat1_4
5145
{
5146
  using ChainRuleSet = OT::ChainRuleSet<Types>;
5147
5148
  bool intersects (const hb_set_t *glyphs) const
5149
0
  {
5150
0
    struct ChainContextClosureLookupContext lookup_context = {
5151
0
      {intersects_glyph, intersected_glyph},
5152
0
      ContextFormat::SimpleContext,
5153
0
      {nullptr, nullptr, nullptr}
5154
0
    };
5155
5156
0
    return
5157
0
    + hb_zip (this+coverage, ruleSet)
5158
0
    | hb_filter (*glyphs, hb_first)
5159
0
    | hb_map (hb_second)
5160
0
    | hb_map (hb_add (this))
5161
0
    | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
5162
0
    | hb_any
5163
0
    ;
5164
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
5165
5166
  bool may_have_non_1to1 () const
5167
0
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const
5168
5169
  void depend (hb_depend_context_t *c) const
5170
0
  {
5171
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5172
0
    if (unlikely (!cur_active_glyphs)) return;
5173
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
5174
0
5175
0
    ChainContextDependLookupContext lookup_context = {
5176
0
      {intersects_glyph, intersected_glyph},
5177
0
      ContextFormat::SimpleContext,
5178
0
      {nullptr, nullptr, nullptr},
5179
0
      {nullptr, nullptr, nullptr},  /* intersects_cache */
5180
0
      nullptr                        /* intersected_glyphs_cache */
5181
0
    };
5182
0
5183
0
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
5184
0
    | hb_filter ([&] (hb_codepoint_t _) {
5185
0
      return c->parent_active_glyphs ().has (_);
5186
0
    }, hb_first)
5187
0
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
5188
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.depend (c, _.first, lookup_context); })
5189
0
    ;
5190
0
5191
0
    c->pop_cur_done_glyphs ();
5192
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*) const
5193
5194
  void closure (hb_closure_context_t *c) const
5195
0
  {
5196
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5197
0
    if (unlikely (!cur_active_glyphs)) return;
5198
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
5199
0
           *cur_active_glyphs);
5200
5201
0
    struct ChainContextClosureLookupContext lookup_context = {
5202
0
      {intersects_glyph, intersected_glyph},
5203
0
      ContextFormat::SimpleContext,
5204
0
      {nullptr, nullptr, nullptr}
5205
0
    };
5206
5207
0
    + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len))
5208
0
    | hb_filter ([&] (hb_codepoint_t _) {
5209
0
      return c->previous_parent_active_glyphs ().has (_);
5210
0
    }, hb_first)
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
5211
0
    | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::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
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const
5212
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&) const
5213
0
    ;
5214
5215
0
    c->pop_cur_done_glyphs ();
5216
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
5217
5218
  void closure_lookups (hb_closure_lookups_context_t *c) const
5219
0
  {
5220
0
    struct ChainContextClosureLookupContext lookup_context = {
5221
0
      {intersects_glyph, nullptr},
5222
0
      ContextFormat::SimpleContext,
5223
0
      {nullptr, nullptr, nullptr}
5224
0
    };
5225
5226
0
    + hb_zip (this+coverage, ruleSet)
5227
0
    | hb_filter (*c->glyphs, hb_first)
5228
0
    | hb_map (hb_second)
5229
0
    | hb_map (hb_add (this))
5230
0
    | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: 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
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
5231
0
    ;
5232
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
5233
5234
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const
5235
5236
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
5237
0
  {
5238
0
    (this+coverage).collect_coverage (c->input);
5239
5240
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
5241
0
      {collect_glyph},
5242
0
      {nullptr, nullptr, nullptr}
5243
0
    };
5244
5245
0
    + hb_iter (ruleSet)
5246
0
    | hb_map (hb_add (this))
5247
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
5248
0
    ;
5249
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
5250
5251
  void collect_second_glyphs (hb_set_digest_t *digest) const
5252
143
  {
5253
143
    + hb_iter (ruleSet)
5254
143
    | hb_map (hb_add (this))
5255
143
    | hb_apply ([digest] (const ChainRuleSet &_) { _.collect_second_glyphs (digest); })
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
5255
141
    | hb_apply ([digest] (const ChainRuleSet &_) { _.collect_second_glyphs (digest); })
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const
5256
143
    ;
5257
143
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
5252
139
  {
5253
139
    + hb_iter (ruleSet)
5254
139
    | hb_map (hb_add (this))
5255
139
    | hb_apply ([digest] (const ChainRuleSet &_) { _.collect_second_glyphs (digest); })
5256
139
    ;
5257
139
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
5252
4
  {
5253
4
    + hb_iter (ruleSet)
5254
4
    | hb_map (hb_add (this))
5255
4
    | hb_apply ([digest] (const ChainRuleSet &_) { _.collect_second_glyphs (digest); })
5256
4
    ;
5257
4
  }
5258
5259
  bool would_apply (hb_would_apply_context_t *c) const
5260
0
  {
5261
0
    const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
5262
0
    struct ChainContextApplyLookupContext lookup_context = {
5263
0
      {{match_glyph, match_glyph, match_glyph}},
5264
0
      {nullptr, nullptr, nullptr}
5265
0
    };
5266
0
    return rule_set.would_apply (c, lookup_context);
5267
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
5268
5269
143
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
5269
139
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
5269
4
  const Coverage &get_coverage () const { return this+coverage; }
5270
5271
  bool apply (hb_ot_apply_context_t *c) const
5272
80.1k
  {
5273
80.1k
    TRACE_APPLY (this);
5274
80.1k
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
5275
80.1k
    if (index == NOT_COVERED) return_trace (false);
5276
5277
3.20k
    const ChainRuleSet &rule_set = this+ruleSet[index];
5278
3.20k
    struct ChainContextApplyLookupContext lookup_context = {
5279
3.20k
      {{match_glyph, match_glyph, match_glyph}},
5280
3.20k
      {nullptr, nullptr, nullptr}
5281
3.20k
    };
5282
3.20k
    return_trace (rule_set.apply (c, lookup_context));
5283
80.1k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const
Line
Count
Source
5272
80.1k
  {
5273
80.1k
    TRACE_APPLY (this);
5274
80.1k
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
5275
80.1k
    if (index == NOT_COVERED) return_trace (false);
5276
5277
3.20k
    const ChainRuleSet &rule_set = this+ruleSet[index];
5278
3.20k
    struct ChainContextApplyLookupContext lookup_context = {
5279
3.20k
      {{match_glyph, match_glyph, match_glyph}},
5280
3.20k
      {nullptr, nullptr, nullptr}
5281
3.20k
    };
5282
3.20k
    return_trace (rule_set.apply (c, lookup_context));
5283
80.1k
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const
5284
5285
  bool subset (hb_subset_context_t *c) const
5286
0
  {
5287
0
    TRACE_SUBSET (this);
5288
0
    const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
5289
0
    const hb_map_t &glyph_map = *c->plan->glyph_map;
5290
5291
0
    auto *out = c->serializer->start_embed (*this);
5292
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
5293
0
    out->format = format;
5294
5295
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
5296
0
    hb_sorted_vector_t<hb_codepoint_t> new_coverage;
5297
0
    + hb_zip (this+coverage, ruleSet)
5298
0
    | hb_filter (glyphset, hb_first)
5299
0
    | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second)
5300
0
    | hb_map (hb_first)
5301
0
    | hb_map (glyph_map)
5302
0
    | hb_sink (new_coverage)
5303
0
    ;
5304
5305
0
    out->coverage.serialize_serialize (c->serializer, new_coverage.iter ());
5306
0
    return_trace (bool (new_coverage));
5307
0
  }
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
5308
5309
  bool sanitize (hb_sanitize_context_t *c) const
5310
1.25k
  {
5311
1.25k
    TRACE_SANITIZE (this);
5312
1.25k
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
5313
1.25k
  }
OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5310
846
  {
5311
846
    TRACE_SANITIZE (this);
5312
846
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
5313
846
  }
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5310
406
  {
5311
406
    TRACE_SANITIZE (this);
5312
406
    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
5313
406
  }
5314
5315
  protected:
5316
  HBUINT16  format;     /* Format identifier--format = 1 */
5317
  typename Types::template LOffsetTo<Coverage>
5318
    coverage;   /* Offset to Coverage table--from
5319
           * beginning of table */
5320
  typename Types::template ArrayOf<typename Types::template OffsetTo<ChainRuleSet>>
5321
    ruleSet;    /* Array of ChainRuleSet tables
5322
           * ordered by Coverage Index */
5323
  public:
5324
  DEFINE_SIZE_ARRAY (2 + Types::LOffset::static_size + Types::HBUINT::static_size, ruleSet);
5325
};
5326
5327
template <typename Types>
5328
struct ChainContextFormat2_5
5329
{
5330
  using ChainRuleSet = OT::ChainClassRuleSet<Types>;
5331
5332
  bool intersects (const hb_set_t *glyphs) const
5333
0
  {
5334
0
    if (!(this+coverage).intersects (glyphs))
5335
0
      return false;
5336
5337
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5338
0
    const ClassDef &input_class_def = this+inputClassDef;
5339
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5340
5341
0
    hb_map_t caches[3] = {};
5342
0
    struct ChainContextClosureLookupContext lookup_context = {
5343
0
      {intersects_class, nullptr},
5344
0
      ContextFormat::ClassBasedContext,
5345
0
      {&backtrack_class_def,
5346
0
       &input_class_def,
5347
0
       &lookahead_class_def},
5348
0
      {&caches[0], &caches[1], &caches[2]}
5349
0
    };
5350
5351
0
    hb_set_t retained_coverage_glyphs;
5352
0
    (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs);
5353
5354
0
    hb_set_t coverage_glyph_classes;
5355
0
    input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
5356
5357
0
    return
5358
0
    + hb_iter (ruleSet)
5359
0
    | hb_map (hb_add (this))
5360
0
    | hb_enumerate
5361
0
    | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p)
5362
0
        { return input_class_def.intersects_class (glyphs, p.first) &&
5363
0
           coverage_glyph_classes.has (p.first) &&
5364
0
           p.second.intersects (glyphs, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&>) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const::{lambda(hb_pair_t<unsigned int, OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&>) const
5365
0
    | hb_any
5366
0
    ;
5367
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const
5368
5369
  bool may_have_non_1to1 () const
5370
0
  { return true; }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const
5371
5372
  void depend (hb_depend_context_t *c) const
5373
0
  {
5374
0
    if (!(this+coverage).intersects (c->glyphs))
5375
0
      return;
5376
0
5377
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5378
0
    if (unlikely (!cur_active_glyphs)) return;
5379
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
5380
0
5381
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5382
0
    const ClassDef &input_class_def = this+inputClassDef;
5383
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5384
0
5385
0
    hb_map_t caches[3] = {};
5386
0
    intersected_class_cache_t intersected_cache;
5387
0
    ChainContextDependLookupContext lookup_context = {
5388
0
      {intersects_class, intersected_class_glyphs},
5389
0
      ContextFormat::ClassBasedContext,
5390
0
      {&backtrack_class_def,
5391
0
       &input_class_def,
5392
0
       &lookahead_class_def},
5393
0
      {&caches[0], &caches[1], &caches[2]},
5394
0
      &intersected_cache
5395
0
    };
5396
0
5397
0
    + hb_enumerate (ruleSet)
5398
0
    | hb_filter ([&] (unsigned _)
5399
0
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
5400
0
     hb_first)
5401
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
5402
0
                {
5403
0
                  const ChainRuleSet& chainrule_set = this+_.second;
5404
0
                  chainrule_set.depend (c, _.first, lookup_context);
5405
0
                })
5406
0
    ;
5407
0
5408
0
    c->pop_cur_done_glyphs ();
5409
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::depend(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::depend(OT::hb_depend_context_t*) const
5410
5411
  void closure (hb_closure_context_t *c) const
5412
0
  {
5413
0
    if (!(this+coverage).intersects (c->glyphs))
5414
0
      return;
5415
5416
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5417
0
    if (unlikely (!cur_active_glyphs)) return;
5418
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
5419
0
           *cur_active_glyphs);
5420
5421
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5422
0
    const ClassDef &input_class_def = this+inputClassDef;
5423
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5424
5425
0
    hb_map_t caches[3] = {};
5426
0
    intersected_class_cache_t intersected_cache;
5427
0
    struct ChainContextClosureLookupContext lookup_context = {
5428
0
      {intersects_class, intersected_class_glyphs},
5429
0
      ContextFormat::ClassBasedContext,
5430
0
      {&backtrack_class_def,
5431
0
       &input_class_def,
5432
0
       &lookahead_class_def},
5433
0
      {&caches[0], &caches[1], &caches[2]},
5434
0
      &intersected_cache
5435
0
    };
5436
5437
0
    + hb_enumerate (ruleSet)
5438
0
    | hb_filter ([&] (unsigned _)
5439
0
    { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
5440
0
     hb_first)
5441
0
    | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _)
5442
0
                {
5443
0
                  const ChainRuleSet& chainrule_set = this+_.second;
5444
0
                  chainrule_set.closure (c, _.first, lookup_context);
5445
0
                })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainClassRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainClassRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainClassRuleSet<OT::Layout::MediumTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainClassRuleSet<OT::Layout::MediumTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const
5446
0
    ;
5447
5448
0
    c->pop_cur_done_glyphs ();
5449
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const
5450
5451
  void closure_lookups (hb_closure_lookups_context_t *c) const
5452
0
  {
5453
0
    if (!(this+coverage).intersects (c->glyphs))
5454
0
      return;
5455
5456
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5457
0
    const ClassDef &input_class_def = this+inputClassDef;
5458
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5459
5460
0
    hb_map_t caches[3] = {};
5461
0
    struct ChainContextClosureLookupContext lookup_context = {
5462
0
      {intersects_class, nullptr},
5463
0
      ContextFormat::ClassBasedContext,
5464
0
      {&backtrack_class_def,
5465
0
       &input_class_def,
5466
0
       &lookahead_class_def},
5467
0
      {&caches[0], &caches[1], &caches[2]}
5468
0
    };
5469
5470
0
    + hb_iter (ruleSet)
5471
0
    | hb_map (hb_add (this))
5472
0
    | hb_enumerate
5473
0
    | hb_filter([&] (unsigned klass)
5474
0
    { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first)
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const
5475
0
    | hb_map (hb_second)
5476
0
    | hb_apply ([&] (const ChainRuleSet &_)
5477
0
    { _.closure_lookups (c, lookup_context); })
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const::{lambda(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&) const
5478
0
    ;
5479
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const
5480
5481
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
5482
5483
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
5484
0
  {
5485
0
    (this+coverage).collect_coverage (c->input);
5486
5487
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5488
0
    const ClassDef &input_class_def = this+inputClassDef;
5489
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5490
5491
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
5492
0
      {collect_class},
5493
0
      {&backtrack_class_def,
5494
0
       &input_class_def,
5495
0
       &lookahead_class_def}
5496
0
    };
5497
5498
0
    + hb_iter (ruleSet)
5499
0
    | hb_map (hb_add (this))
5500
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::ChainClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&) const
5501
0
    ;
5502
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
5503
5504
  void collect_second_glyphs (hb_set_digest_t *digest) const
5505
94
  {
5506
94
    const ClassDef &input_class_def = this+inputClassDef;
5507
94
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5508
94
    + hb_iter (ruleSet)
5509
94
    | hb_map (hb_add (this))
5510
94
    | hb_apply ([digest, &input_class_def, &lookahead_class_def] (const ChainRuleSet &_)
5511
94
    { _.collect_second_glyphs (digest, &input_class_def, &lookahead_class_def); })
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::SmallTypes> const&) const
Line
Count
Source
5511
8
    { _.collect_second_glyphs (digest, &input_class_def, &lookahead_class_def); })
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const::{lambda(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainClassRuleSet<OT::Layout::MediumTypes> const&) const
Line
Count
Source
5511
1
    { _.collect_second_glyphs (digest, &input_class_def, &lookahead_class_def); })
5512
94
    ;
5513
94
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
5505
90
  {
5506
90
    const ClassDef &input_class_def = this+inputClassDef;
5507
90
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5508
90
    + hb_iter (ruleSet)
5509
90
    | hb_map (hb_add (this))
5510
90
    | hb_apply ([digest, &input_class_def, &lookahead_class_def] (const ChainRuleSet &_)
5511
90
    { _.collect_second_glyphs (digest, &input_class_def, &lookahead_class_def); })
5512
90
    ;
5513
90
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_second_glyphs(hb_set_digest_t*) const
Line
Count
Source
5505
4
  {
5506
4
    const ClassDef &input_class_def = this+inputClassDef;
5507
4
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5508
4
    + hb_iter (ruleSet)
5509
4
    | hb_map (hb_add (this))
5510
4
    | hb_apply ([digest, &input_class_def, &lookahead_class_def] (const ChainRuleSet &_)
5511
4
    { _.collect_second_glyphs (digest, &input_class_def, &lookahead_class_def); })
5512
4
    ;
5513
4
  }
5514
5515
  bool would_apply (hb_would_apply_context_t *c) const
5516
0
  {
5517
0
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5518
0
    const ClassDef &input_class_def = this+inputClassDef;
5519
0
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5520
5521
0
    unsigned int index = input_class_def.get_class (c->glyphs[0]);
5522
0
    const ChainRuleSet &rule_set = this+ruleSet[index];
5523
0
    struct ChainContextApplyLookupContext lookup_context = {
5524
0
      {{match_class, match_class, match_class}},
5525
0
      {&backtrack_class_def,
5526
0
       &input_class_def,
5527
0
       &lookahead_class_def}
5528
0
    };
5529
0
    return rule_set.would_apply (c, lookup_context);
5530
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const
5531
5532
94
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const
Line
Count
Source
5532
90
  const Coverage &get_coverage () const { return this+coverage; }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const
Line
Count
Source
5532
4
  const Coverage &get_coverage () const { return this+coverage; }
5533
5534
  unsigned cache_cost () const
5535
94
  {
5536
94
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
5537
94
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const
Line
Count
Source
5535
90
  {
5536
90
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
5537
90
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const
Line
Count
Source
5535
4
  {
5536
4
    return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost ();
5537
4
  }
5538
  static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op)
5539
184
  {
5540
184
    return context_cache_func (c, op);
5541
184
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
Line
Count
Source
5539
184
  {
5540
184
    return context_cache_func (c, op);
5541
184
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t)
5542
5543
  struct external_cache_t
5544
  {
5545
    hb_ot_layout_binary_cache_t coverage;
5546
    hb_ot_layout_mapping_cache_t input_class;
5547
    hb_ot_layout_mapping_cache_t lookahead_class;
5548
    hb_ot_layout_ruleset_digest_t rule_sets[HB_VAR_ARRAY];
5549
  };
5550
  void *external_cache_create () const
5551
94
  {
5552
94
    unsigned count = ruleSet.len;
5553
94
    unsigned size = sizeof (external_cache_t) -
5554
94
        HB_VAR_ARRAY * sizeof (hb_ot_layout_ruleset_digest_t) +
5555
94
        count * sizeof (hb_ot_layout_ruleset_digest_t);
5556
94
    external_cache_t *cache = (external_cache_t *) hb_malloc (size);
5557
94
    if (likely (cache))
5558
94
    {
5559
94
      cache->coverage.clear ();
5560
94
      cache->input_class.clear ();
5561
94
      cache->lookahead_class.clear ();
5562
103
      for (unsigned i = 0; i < count; i++)
5563
9
  (this+ruleSet[i]).collect_first_input_classes (&cache->rule_sets[i]);
5564
94
    }
5565
94
    return cache;
5566
94
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::external_cache_create() const
Line
Count
Source
5551
90
  {
5552
90
    unsigned count = ruleSet.len;
5553
90
    unsigned size = sizeof (external_cache_t) -
5554
90
        HB_VAR_ARRAY * sizeof (hb_ot_layout_ruleset_digest_t) +
5555
90
        count * sizeof (hb_ot_layout_ruleset_digest_t);
5556
90
    external_cache_t *cache = (external_cache_t *) hb_malloc (size);
5557
90
    if (likely (cache))
5558
90
    {
5559
90
      cache->coverage.clear ();
5560
90
      cache->input_class.clear ();
5561
90
      cache->lookahead_class.clear ();
5562
98
      for (unsigned i = 0; i < count; i++)
5563
8
  (this+ruleSet[i]).collect_first_input_classes (&cache->rule_sets[i]);
5564
90
    }
5565
90
    return cache;
5566
90
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::external_cache_create() const
Line
Count
Source
5551
4
  {
5552
4
    unsigned count = ruleSet.len;
5553
4
    unsigned size = sizeof (external_cache_t) -
5554
4
        HB_VAR_ARRAY * sizeof (hb_ot_layout_ruleset_digest_t) +
5555
4
        count * sizeof (hb_ot_layout_ruleset_digest_t);
5556
4
    external_cache_t *cache = (external_cache_t *) hb_malloc (size);
5557
4
    if (likely (cache))
5558
4
    {
5559
4
      cache->coverage.clear ();
5560
4
      cache->input_class.clear ();
5561
4
      cache->lookahead_class.clear ();
5562
5
      for (unsigned i = 0; i < count; i++)
5563
1
  (this+ruleSet[i]).collect_first_input_classes (&cache->rule_sets[i]);
5564
4
    }
5565
4
    return cache;
5566
4
  }
5567
147k
  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
5567
147k
  bool apply_cached (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, true, external_cache); }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const
5568
12
  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
5568
12
  bool apply (hb_ot_apply_context_t *c, void *external_cache) const { return _apply (c, false, external_cache); }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, void*) const
5569
  bool _apply (hb_ot_apply_context_t *c, bool cached, void *external_cache) const
5570
147k
  {
5571
147k
    TRACE_APPLY (this);
5572
147k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5573
147k
    external_cache_t *cache = (external_cache_t *) external_cache;
5574
147k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
5575
#else
5576
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
5577
#endif
5578
147k
    if (index == NOT_COVERED) return_trace (false);
5579
5580
135k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5581
135k
    const ClassDef &input_class_def = this+inputClassDef;
5582
135k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5583
5584
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5585
135k
    match_class_cache_data_t input_cache_data = {
5586
135k
      &input_class_def,
5587
135k
      cache ? &cache->input_class : nullptr
5588
135k
    };
5589
135k
    match_class_cache_data_t lookahead_cache_data = {
5590
135k
      &lookahead_class_def,
5591
135k
      cache ? &cache->lookahead_class : nullptr
5592
135k
    };
5593
135k
    const void *input_match_data = cached
5594
135k
      ? static_cast<const void *> (&input_class_def)
5595
135k
      : static_cast<const void *> (&input_cache_data);
5596
135k
    const void *lookahead_match_data = cached
5597
135k
      ? static_cast<const void *> (&lookahead_class_def)
5598
135k
      : static_cast<const void *> (&lookahead_cache_data);
5599
135k
    bool backtrack_uses_lookahead_cache =
5600
135k
      !cached && &backtrack_class_def == &lookahead_class_def;
5601
135k
    const void *backtrack_match_data = backtrack_uses_lookahead_cache
5602
135k
      ? static_cast<const void *> (&lookahead_cache_data)
5603
135k
      : static_cast<const void *> (&backtrack_class_def);
5604
135k
#endif
5605
5606
    /* match_class_caches1 is slightly faster. Use it for lookahead,
5607
     * which is typically longer. */
5608
135k
    struct ChainContextApplyLookupContext lookup_context = {
5609
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5610
135k
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 :
5611
135k
        backtrack_uses_lookahead_cache ? match_class_cache : match_class,
5612
135k
        cached ? match_class_cached2 : match_class_cache,
5613
135k
        cached ? match_class_cached1 : match_class_cache}},
5614
135k
      {backtrack_match_data,
5615
135k
       input_match_data,
5616
135k
       lookahead_match_data},
5617
135k
      cached ? get_class_cached2_value : get_class_cache_value
5618
#else
5619
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
5620
        cached ? match_class_cached2 : match_class,
5621
        cached ? match_class_cached1 : match_class}},
5622
      {&backtrack_class_def,
5623
       &input_class_def,
5624
       &lookahead_class_def},
5625
      cached ? get_class_cached2_value : get_class_value
5626
#endif
5627
135k
    };
5628
5629
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5630
135k
    index = cached
5631
135k
         ? get_class_cached2 (input_class_def, c->buffer->cur())
5632
135k
         : input_class_def.get_class (c->buffer->cur().codepoint, input_cache_data.cache);
5633
#else
5634
    index = cached
5635
         ? get_class_cached2 (input_class_def, c->buffer->cur())
5636
          : input_class_def.get_class (c->buffer->cur().codepoint);
5637
#endif
5638
135k
    const ChainRuleSet &rule_set = this+ruleSet[index];
5639
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5640
135k
    const hb_ot_layout_ruleset_digest_t *digest = cache && index < ruleSet.len ? &cache->rule_sets[index] : nullptr;
5641
#else
5642
    const hb_ot_layout_ruleset_digest_t *digest = nullptr;
5643
#endif
5644
135k
    return_trace (rule_set.apply (c, lookup_context, digest));
5645
147k
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
Line
Count
Source
5570
147k
  {
5571
147k
    TRACE_APPLY (this);
5572
147k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5573
147k
    external_cache_t *cache = (external_cache_t *) external_cache;
5574
147k
    unsigned int index = (this+coverage).get_coverage_binary (c->buffer->cur().codepoint, cache ? &cache->coverage : nullptr);
5575
#else
5576
    unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
5577
#endif
5578
147k
    if (index == NOT_COVERED) return_trace (false);
5579
5580
135k
    const ClassDef &backtrack_class_def = this+backtrackClassDef;
5581
135k
    const ClassDef &input_class_def = this+inputClassDef;
5582
135k
    const ClassDef &lookahead_class_def = this+lookaheadClassDef;
5583
5584
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5585
135k
    match_class_cache_data_t input_cache_data = {
5586
135k
      &input_class_def,
5587
135k
      cache ? &cache->input_class : nullptr
5588
135k
    };
5589
135k
    match_class_cache_data_t lookahead_cache_data = {
5590
135k
      &lookahead_class_def,
5591
135k
      cache ? &cache->lookahead_class : nullptr
5592
135k
    };
5593
135k
    const void *input_match_data = cached
5594
135k
      ? static_cast<const void *> (&input_class_def)
5595
135k
      : static_cast<const void *> (&input_cache_data);
5596
135k
    const void *lookahead_match_data = cached
5597
135k
      ? static_cast<const void *> (&lookahead_class_def)
5598
135k
      : static_cast<const void *> (&lookahead_cache_data);
5599
135k
    bool backtrack_uses_lookahead_cache =
5600
135k
      !cached && &backtrack_class_def == &lookahead_class_def;
5601
135k
    const void *backtrack_match_data = backtrack_uses_lookahead_cache
5602
135k
      ? static_cast<const void *> (&lookahead_cache_data)
5603
135k
      : static_cast<const void *> (&backtrack_class_def);
5604
135k
#endif
5605
5606
    /* match_class_caches1 is slightly faster. Use it for lookahead,
5607
     * which is typically longer. */
5608
135k
    struct ChainContextApplyLookupContext lookup_context = {
5609
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5610
135k
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 :
5611
135k
        backtrack_uses_lookahead_cache ? match_class_cache : match_class,
5612
135k
        cached ? match_class_cached2 : match_class_cache,
5613
135k
        cached ? match_class_cached1 : match_class_cache}},
5614
135k
      {backtrack_match_data,
5615
135k
       input_match_data,
5616
135k
       lookahead_match_data},
5617
135k
      cached ? get_class_cached2_value : get_class_cache_value
5618
#else
5619
      {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class,
5620
        cached ? match_class_cached2 : match_class,
5621
        cached ? match_class_cached1 : match_class}},
5622
      {&backtrack_class_def,
5623
       &input_class_def,
5624
       &lookahead_class_def},
5625
      cached ? get_class_cached2_value : get_class_value
5626
#endif
5627
135k
    };
5628
5629
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5630
135k
    index = cached
5631
135k
         ? get_class_cached2 (input_class_def, c->buffer->cur())
5632
135k
         : input_class_def.get_class (c->buffer->cur().codepoint, input_cache_data.cache);
5633
#else
5634
    index = cached
5635
         ? get_class_cached2 (input_class_def, c->buffer->cur())
5636
          : input_class_def.get_class (c->buffer->cur().codepoint);
5637
#endif
5638
135k
    const ChainRuleSet &rule_set = this+ruleSet[index];
5639
135k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
5640
135k
    const hb_ot_layout_ruleset_digest_t *digest = cache && index < ruleSet.len ? &cache->rule_sets[index] : nullptr;
5641
#else
5642
    const hb_ot_layout_ruleset_digest_t *digest = nullptr;
5643
#endif
5644
135k
    return_trace (rule_set.apply (c, lookup_context, digest));
5645
147k
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool, void*) const
5646
5647
  bool subset (hb_subset_context_t *c) const
5648
0
  {
5649
0
    TRACE_SUBSET (this);
5650
0
    auto *out = c->serializer->start_embed (*this);
5651
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
5652
0
    out->format = format;
5653
0
    out->coverage.serialize_subset (c, coverage, this);
5654
5655
0
    hb_map_t backtrack_klass_map;
5656
0
    hb_map_t input_klass_map;
5657
0
    hb_map_t lookahead_klass_map;
5658
5659
0
    out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map);
5660
    // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting
5661
0
    out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map);
5662
0
    out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map);
5663
5664
0
    if (unlikely (!c->serializer->propagate_error (backtrack_klass_map,
5665
0
               input_klass_map,
5666
0
               lookahead_klass_map)))
5667
0
      return_trace (false);
5668
5669
0
    const hb_set_t* glyphset = c->plan->glyphset_gsub ();
5670
0
    hb_set_t retained_coverage_glyphs;
5671
0
    (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs);
5672
5673
0
    hb_set_t coverage_glyph_classes;
5674
0
    (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes);
5675
5676
0
    int non_zero_index = -1, index = 0;
5677
0
    bool ret = true;
5678
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
5679
0
    auto last_non_zero = c->serializer->snapshot ();
5680
0
    for (const auto& _ : + hb_enumerate (ruleSet)
5681
0
       | hb_filter (input_klass_map, hb_first))
5682
0
    {
5683
0
      auto *o = out->ruleSet.serialize_append (c->serializer);
5684
0
      if (unlikely (!o))
5685
0
      {
5686
0
  ret = false;
5687
0
  break;
5688
0
      }
5689
0
      if (coverage_glyph_classes.has (_.first) &&
5690
0
          o->serialize_subset (c, _.second, this,
5691
0
             lookup_map,
5692
0
             &backtrack_klass_map,
5693
0
             &input_klass_map,
5694
0
             &lookahead_klass_map))
5695
0
      {
5696
0
        last_non_zero = c->serializer->snapshot ();
5697
0
  non_zero_index = index;
5698
0
      }
5699
5700
0
      index++;
5701
0
    }
5702
5703
0
    if (!ret || non_zero_index == -1) return_trace (false);
5704
5705
    // prune empty trailing ruleSets
5706
0
    if (index > non_zero_index) {
5707
0
      c->serializer->revert (last_non_zero);
5708
0
      out->ruleSet.len = non_zero_index + 1;
5709
0
    }
5710
5711
0
    return_trace (bool (out->ruleSet));
5712
0
  }
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const
5713
5714
  bool sanitize (hb_sanitize_context_t *c) const
5715
898
  {
5716
898
    TRACE_SANITIZE (this);
5717
898
    return_trace (coverage.sanitize (c, this) &&
5718
898
      backtrackClassDef.sanitize (c, this) &&
5719
898
      inputClassDef.sanitize (c, this) &&
5720
898
      lookaheadClassDef.sanitize (c, this) &&
5721
898
      ruleSet.sanitize (c, this));
5722
898
  }
OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5715
810
  {
5716
810
    TRACE_SANITIZE (this);
5717
810
    return_trace (coverage.sanitize (c, this) &&
5718
810
      backtrackClassDef.sanitize (c, this) &&
5719
810
      inputClassDef.sanitize (c, this) &&
5720
810
      lookaheadClassDef.sanitize (c, this) &&
5721
810
      ruleSet.sanitize (c, this));
5722
810
  }
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
5715
88
  {
5716
88
    TRACE_SANITIZE (this);
5717
88
    return_trace (coverage.sanitize (c, this) &&
5718
88
      backtrackClassDef.sanitize (c, this) &&
5719
88
      inputClassDef.sanitize (c, this) &&
5720
88
      lookaheadClassDef.sanitize (c, this) &&
5721
88
      ruleSet.sanitize (c, this));
5722
88
  }
5723
5724
  protected:
5725
  HBUINT16  format;     /* Format identifier--format = 2 */
5726
  typename Types::template LOffsetTo<Coverage>
5727
    coverage;   /* Offset to Coverage table--from
5728
           * beginning of table */
5729
  typename Types::template LOffsetTo<ClassDef>
5730
    backtrackClassDef;  /* Offset to glyph ClassDef table
5731
           * containing backtrack sequence
5732
           * data--from beginning of table */
5733
  typename Types::template LOffsetTo<ClassDef>
5734
    inputClassDef;    /* Offset to glyph ClassDef
5735
           * table containing input sequence
5736
           * data--from beginning of table */
5737
  typename Types::template LOffsetTo<ClassDef>
5738
    lookaheadClassDef;  /* Offset to glyph ClassDef table
5739
           * containing lookahead sequence
5740
           * data--from beginning of table */
5741
  Array16Of<typename Types::template OffsetTo<ChainRuleSet>>
5742
    ruleSet;    /* Array of ChainRuleSet tables
5743
           * ordered by class */
5744
  public:
5745
  DEFINE_SIZE_ARRAY (4 + 4 * Types::LOffset::static_size, ruleSet);
5746
};
5747
5748
template <typename Types>
5749
struct ChainContextFormat3
5750
{
5751
  using RuleSet = OT::RuleSet<SmallTypes>;
5752
5753
  bool intersects (const hb_set_t *glyphs) const
5754
0
  {
5755
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5756
5757
0
    if (!(this+input[0]).intersects (glyphs))
5758
0
      return false;
5759
5760
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5761
0
    struct ChainContextClosureLookupContext lookup_context = {
5762
0
      {intersects_coverage, nullptr},
5763
0
      ContextFormat::CoverageBasedContext,
5764
0
      {this, this, this}
5765
0
    };
5766
0
    return chain_context_intersects (glyphs,
5767
0
             backtrack.len, backtrack.arrayZ,
5768
0
             input.len, input.arrayZ + 1,
5769
0
             lookahead.len, lookahead.arrayZ,
5770
0
             lookup_context);
5771
0
  }
5772
5773
  bool may_have_non_1to1 () const
5774
0
  { return true; }
5775
5776
  void depend (hb_depend_context_t *c) const
5777
0
  {
5778
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5779
0
5780
0
    if (!(this+input[0]).intersects (c->glyphs))
5781
0
      return;
5782
0
5783
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5784
0
    if (unlikely (!cur_active_glyphs))
5785
0
      return;
5786
0
    get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs);
5787
0
5788
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5789
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5790
0
    ChainContextDependLookupContext lookup_context = {
5791
0
      {intersects_coverage, intersected_coverage_glyphs},
5792
0
      ContextFormat::CoverageBasedContext,
5793
0
      {this, this, this},
5794
0
      {nullptr, nullptr, nullptr},  /* intersects_cache */
5795
0
      nullptr                        /* intersected_glyphs_cache */
5796
0
    };
5797
0
    chain_context_depend_lookup (c,
5798
0
         backtrack.len, (const HBUINT16 *) backtrack.arrayZ,
5799
0
         input.len, (const HBUINT16 *) input.arrayZ + 1,
5800
0
         lookahead.len, (const HBUINT16 *) lookahead.arrayZ,
5801
0
         lookup.len, lookup.arrayZ,
5802
0
         this,
5803
0
         input[0], lookup_context);
5804
0
5805
0
    c->pop_cur_done_glyphs ();
5806
0
  }
5807
5808
  void closure (hb_closure_context_t *c) const
5809
0
  {
5810
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5811
5812
0
    if (!(this+input[0]).intersects (c->glyphs))
5813
0
      return;
5814
5815
0
    hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs ();
5816
0
    if (unlikely (!cur_active_glyphs))
5817
0
      return;
5818
0
    get_coverage ().intersect_set (c->previous_parent_active_glyphs (),
5819
0
           *cur_active_glyphs);
5820
5821
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5822
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5823
0
    struct ChainContextClosureLookupContext lookup_context = {
5824
0
      {intersects_coverage, intersected_coverage_glyphs},
5825
0
      ContextFormat::CoverageBasedContext,
5826
0
      {this, this, this}
5827
0
    };
5828
0
    chain_context_closure_lookup (c,
5829
0
          backtrack.len, backtrack.arrayZ,
5830
0
          input.len, input.arrayZ + 1,
5831
0
          lookahead.len, lookahead.arrayZ,
5832
0
          lookup.len, lookup.arrayZ,
5833
0
          0, lookup_context);
5834
5835
0
    c->pop_cur_done_glyphs ();
5836
0
  }
5837
5838
  void closure_lookups (hb_closure_lookups_context_t *c) const
5839
0
  {
5840
0
    if (!intersects (c->glyphs))
5841
0
      return;
5842
5843
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5844
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5845
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5846
0
    recurse_lookups (c, lookup.len, lookup.arrayZ);
5847
0
  }
5848
5849
0
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}
5850
5851
  void collect_glyphs (hb_collect_glyphs_context_t *c) const
5852
0
  {
5853
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5854
5855
0
    (this+input[0]).collect_coverage (c->input);
5856
5857
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5858
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5859
5860
0
    struct ChainContextCollectGlyphsLookupContext lookup_context = {
5861
0
      {collect_coverage},
5862
0
      {this, this, this}
5863
0
    };
5864
0
    chain_context_collect_glyphs_lookup (c,
5865
0
           backtrack.len, backtrack.arrayZ,
5866
0
           input.len, input.arrayZ + 1,
5867
0
           lookahead.len, lookahead.arrayZ,
5868
0
           lookup.len, lookup.arrayZ,
5869
0
           lookup_context);
5870
0
  }
5871
5872
  void collect_second_glyphs (hb_set_digest_t *digest) const
5873
789
  {
5874
789
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5875
789
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5876
789
    if (input.len > 1)
5877
60
      (this+input[1]).collect_coverage (digest);
5878
729
    else if (lookahead.len)
5879
156
      (this+lookahead[0]).collect_coverage (digest);
5880
573
    else
5881
573
      *digest = hb_set_digest_t::full ();
5882
789
  }
5883
5884
  bool would_apply (hb_would_apply_context_t *c) const
5885
0
  {
5886
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5887
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5888
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5889
0
    struct ChainContextApplyLookupContext lookup_context = {
5890
0
      {{match_coverage, match_coverage, match_coverage}},
5891
0
      {this, this, this}
5892
0
    };
5893
0
    return chain_context_would_apply_lookup (c,
5894
0
               backtrack.len, backtrack.arrayZ,
5895
0
               input.len, input.arrayZ + 1,
5896
0
               lookahead.len, lookahead.arrayZ,
5897
0
               lookup.len, lookup.arrayZ, lookup_context);
5898
0
  }
5899
5900
  const Coverage &get_coverage () const
5901
789
  {
5902
789
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5903
789
    return this+input[0];
5904
789
  }
5905
5906
  bool apply (hb_ot_apply_context_t *c) const
5907
2.64M
  {
5908
2.64M
    TRACE_APPLY (this);
5909
2.64M
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5910
5911
2.64M
    unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
5912
2.64M
    if (index == NOT_COVERED) return_trace (false);
5913
5914
2.08M
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5915
2.08M
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5916
2.08M
    struct ChainContextApplyLookupContext lookup_context = {
5917
2.08M
      {{match_coverage, match_coverage, match_coverage}},
5918
2.08M
      {this, this, this}
5919
2.08M
    };
5920
2.08M
    return_trace (chain_context_apply_lookup (c,
5921
2.64M
                backtrack.len, backtrack.arrayZ,
5922
2.64M
                input.len, input.arrayZ + 1,
5923
2.64M
                lookahead.len, lookahead.arrayZ,
5924
2.64M
                lookup.len, lookup.arrayZ, lookup_context));
5925
2.64M
  }
5926
5927
  template<typename Iterator,
5928
     hb_requires (hb_is_iterator (Iterator))>
5929
  bool serialize_coverage_offsets (hb_subset_context_t *c, Iterator it, const void* base) const
5930
0
  {
5931
0
    TRACE_SERIALIZE (this);
5932
0
    auto *out = c->serializer->start_embed<Array16Of<typename Types::template OffsetTo<Coverage>>> ();
5933
0
    if (unlikely (!out->serialize (c->serializer, 0u))) return_trace (false);
5934
5935
0
    for (auto& offset : it) {
5936
0
      auto *o = out->serialize_append (c->serializer);
5937
0
      if (unlikely (!o) || !o->serialize_subset (c, offset, base))
5938
0
        return_trace (false);
5939
0
    }
5940
5941
0
    return_trace (true);
5942
0
  }
5943
5944
  bool subset (hb_subset_context_t *c) const
5945
0
  {
5946
0
    TRACE_SUBSET (this);
5947
5948
0
    if (unlikely (!c->serializer->embed (this->format))) return_trace (false);
5949
5950
0
    if (!serialize_coverage_offsets (c, backtrack.iter (), this))
5951
0
      return_trace (false);
5952
5953
0
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5954
0
    if (!serialize_coverage_offsets (c, input.iter (), this))
5955
0
      return_trace (false);
5956
5957
0
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5958
0
    if (!serialize_coverage_offsets (c, lookahead.iter (), this))
5959
0
      return_trace (false);
5960
5961
0
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5962
0
    const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups;
5963
5964
0
    HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookup.len);
5965
0
    if (!lookupCount) return_trace (false);
5966
5967
0
    unsigned count = serialize_lookuprecord_array (c->serializer, lookup.as_array (), lookup_map);
5968
0
    return_trace (c->serializer->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
5969
0
  }
5970
5971
  bool sanitize (hb_sanitize_context_t *c) const
5972
2.31k
  {
5973
2.31k
    TRACE_SANITIZE (this);
5974
2.31k
    if (unlikely (!backtrack.sanitize (c, this))) return_trace (false);
5975
2.30k
    hb_barrier ();
5976
2.30k
    const auto &input = StructAfter<decltype (inputX)> (backtrack);
5977
2.30k
    if (unlikely (!input.sanitize (c, this))) return_trace (false);
5978
2.28k
    hb_barrier ();
5979
2.28k
    if (unlikely (!input.len)) return_trace (false); /* To be consistent with Context. */
5980
2.28k
    const auto &lookahead = StructAfter<decltype (lookaheadX)> (input);
5981
2.28k
    if (unlikely (!lookahead.sanitize (c, this))) return_trace (false);
5982
2.26k
    hb_barrier ();
5983
2.26k
    const auto &lookup = StructAfter<decltype (lookupX)> (lookahead);
5984
2.26k
    return_trace (likely (lookup.sanitize (c)));
5985
2.28k
  }
5986
5987
  protected:
5988
  HBUINT16  format;     /* Format identifier--format = 3 */
5989
  Array16Of<typename Types::template OffsetTo<Coverage>>
5990
    backtrack;    /* Array of coverage tables
5991
           * in backtracking sequence, in  glyph
5992
           * sequence order */
5993
  Array16Of<typename Types::template OffsetTo<Coverage>>
5994
    inputX    ; /* Array of coverage
5995
           * tables in input sequence, in glyph
5996
           * sequence order */
5997
  Array16Of<typename Types::template OffsetTo<Coverage>>
5998
    lookaheadX;   /* Array of coverage tables
5999
           * in lookahead sequence, in glyph
6000
           * sequence order */
6001
  Array16Of<LookupRecord>
6002
    lookupX;    /* Array of LookupRecords--in
6003
           * design order) */
6004
  public:
6005
  DEFINE_SIZE_MIN (10);
6006
};
6007
6008
struct ChainContext
6009
{
6010
  template <typename context_t, typename ...Ts>
6011
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
6012
29.6k
  {
6013
29.6k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6014
29.5k
    TRACE_DISPATCH (this, u.format.v);
6015
29.5k
    switch (u.format.v) {
6016
985
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
6017
900
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
6018
3.10k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
6019
0
#ifndef HB_NO_BEYOND_64K
6020
410
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
6021
92
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
6022
0
#endif
6023
24.0k
    default:return_trace (c->default_return_value ());
6024
29.5k
    }
6025
29.5k
  }
hb_sanitize_context_t::return_t OT::ChainContext::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const
Line
Count
Source
6012
25.1k
  {
6013
25.1k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6014
25.1k
    TRACE_DISPATCH (this, u.format.v);
6015
25.1k
    switch (u.format.v) {
6016
846
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
6017
810
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
6018
2.31k
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
6019
0
#ifndef HB_NO_BEYOND_64K
6020
406
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
6021
88
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
6022
0
#endif
6023
20.6k
    default:return_trace (c->default_return_value ());
6024
25.1k
    }
6025
25.1k
  }
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
6012
4.46k
  {
6013
4.46k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6014
4.46k
    TRACE_DISPATCH (this, u.format.v);
6015
4.46k
    switch (u.format.v) {
6016
139
    case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
6017
90
    case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
6018
789
    case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
6019
0
#ifndef HB_NO_BEYOND_64K
6020
4
    case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
6021
4
    case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
6022
0
#endif
6023
3.44k
    default:return_trace (c->default_return_value ());
6024
4.46k
    }
6025
4.46k
  }
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const
Unexecuted instantiation: OT::hb_depend_context_t::return_t OT::ChainContext::dispatch<OT::hb_depend_context_t>(OT::hb_depend_context_t*) const
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::ChainContext::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const
Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::ChainContext::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const
6026
6027
  protected:
6028
  union {
6029
  struct { HBUINT16 v; }    format; /* Format identifier */
6030
  ChainContextFormat1_4<SmallTypes> format1;
6031
  ChainContextFormat2_5<SmallTypes> format2;
6032
  ChainContextFormat3<SmallTypes> format3;
6033
#ifndef HB_NO_BEYOND_64K
6034
  ChainContextFormat1_4<MediumTypes>  format4;
6035
  ChainContextFormat2_5<MediumTypes>  format5;
6036
  /* The beyond-64k spec adds sequence-context format 6, but no
6037
   * corresponding chained-context coverage format. */
6038
#endif
6039
  } u;
6040
};
6041
6042
6043
template <typename T>
6044
struct ExtensionFormat1
6045
{
6046
354
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
6046
219
  unsigned int get_type () const { return extensionLookupType; }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
6046
135
  unsigned int get_type () const { return extensionLookupType; }
6047
6048
  template <typename X>
6049
  const X& get_subtable () const
6050
232
  { 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
6050
120
  { 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
6050
112
  { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }
6051
6052
  template <typename context_t, typename ...Ts>
6053
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
6054
232
  {
6055
232
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
6056
232
    TRACE_DISPATCH (this, format);
6057
232
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
6058
232
  }
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
6054
116
  {
6055
116
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
6056
116
    TRACE_DISPATCH (this, format);
6057
116
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
6058
116
  }
Unexecuted instantiation: 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
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
Unexecuted instantiation: 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
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
6054
112
  {
6055
112
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
6056
112
    TRACE_DISPATCH (this, format);
6057
112
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
6058
112
  }
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_depend_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_depend_context_t>(OT::hb_depend_context_t*) const
Unexecuted instantiation: 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
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
6054
4
  {
6055
4
    if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
6056
4
    TRACE_DISPATCH (this, format);
6057
4
    return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
6058
4
  }
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
6059
6060
  void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
6061
  { dispatch (c); }
6062
6063
  /* This is called from may_dispatch() above with hb_sanitize_context_t. */
6064
  bool sanitize (hb_sanitize_context_t *c) const
6065
228
  {
6066
228
    TRACE_SANITIZE (this);
6067
228
    return_trace (c->check_struct (this) &&
6068
228
      hb_barrier () &&
6069
228
      extensionLookupType != T::SubTable::Extension);
6070
228
  }
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
6065
116
  {
6066
116
    TRACE_SANITIZE (this);
6067
116
    return_trace (c->check_struct (this) &&
6068
116
      hb_barrier () &&
6069
116
      extensionLookupType != T::SubTable::Extension);
6070
116
  }
OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::sanitize(hb_sanitize_context_t*) const
Line
Count
Source
6065
112
  {
6066
112
    TRACE_SANITIZE (this);
6067
112
    return_trace (c->check_struct (this) &&
6068
112
      hb_barrier () &&
6069
112
      extensionLookupType != T::SubTable::Extension);
6070
112
  }
6071
6072
  bool subset (hb_subset_context_t *c) const
6073
0
  {
6074
0
    TRACE_SUBSET (this);
6075
6076
0
    auto *out = c->serializer->start_embed (this);
6077
0
    if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
6078
6079
0
    out->format = format;
6080
0
    out->extensionLookupType = extensionLookupType;
6081
6082
0
    const auto& src_offset =
6083
0
        reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset);
6084
0
    auto& dest_offset =
6085
0
        reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset);
6086
6087
0
    return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ()));
6088
0
  }
Unexecuted instantiation: OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::subset(hb_subset_context_t*) const
Unexecuted instantiation: OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::subset(hb_subset_context_t*) const
6089
6090
  protected:
6091
  HBUINT16  format;     /* Format identifier. Set to 1. */
6092
  HBUINT16  extensionLookupType;  /* Lookup type of subtable referenced
6093
           * by ExtensionOffset (i.e. the
6094
           * extension subtable). */
6095
  Offset32  extensionOffset;  /* Offset to the extension subtable,
6096
           * of lookup type subtable. */
6097
  public:
6098
  DEFINE_SIZE_STATIC (8);
6099
};
6100
6101
template <typename T>
6102
struct Extension
6103
{
6104
  unsigned int get_type () const
6105
2.23k
  {
6106
2.23k
    switch (u.format.v) {
6107
122
    case 1: hb_barrier (); return u.format1.get_type ();
6108
2.11k
    default:return 0;
6109
2.23k
    }
6110
2.23k
  }
OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const
Line
Count
Source
6105
1.15k
  {
6106
1.15k
    switch (u.format.v) {
6107
99
    case 1: hb_barrier (); return u.format1.get_type ();
6108
1.05k
    default:return 0;
6109
1.15k
    }
6110
1.15k
  }
OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const
Line
Count
Source
6105
1.08k
  {
6106
1.08k
    switch (u.format.v) {
6107
23
    case 1: hb_barrier (); return u.format1.get_type ();
6108
1.06k
    default:return 0;
6109
1.08k
    }
6110
1.08k
  }
6111
  template <typename X>
6112
  const X& get_subtable () const
6113
  {
6114
    switch (u.format.v) {
6115
    case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> ();
6116
    default:return Null (typename T::SubTable);
6117
    }
6118
  }
6119
6120
  // Specialization of dispatch for subset. dispatch() normally just
6121
  // dispatches to the sub table this points too, but for subset
6122
  // we need to run subset on this subtable too.
6123
  template <typename ...Ts>
6124
  typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const
6125
0
  {
6126
0
    switch (u.format.v) {
6127
0
    case 1: hb_barrier (); return u.format1.subset (c);
6128
0
    default: return c->default_return_value ();
6129
0
    }
6130
0
  }
Unexecuted instantiation: bool OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<>(hb_subset_context_t*) const
Unexecuted instantiation: bool OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<>(hb_subset_context_t*) const
6131
6132
  template <typename context_t, typename ...Ts>
6133
  typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
6134
3.03k
  {
6135
3.03k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6136
3.00k
    TRACE_DISPATCH (this, u.format.v);
6137
3.00k
    switch (u.format.v) {
6138
232
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
6139
2.77k
    default:return_trace (c->default_return_value ());
6140
3.00k
    }
6141
3.00k
  }
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
6134
961
  {
6135
961
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6136
951
    TRACE_DISPATCH (this, u.format.v);
6137
951
    switch (u.format.v) {
6138
116
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
6139
835
    default:return_trace (c->default_return_value ());
6140
951
    }
6141
951
  }
Unexecuted instantiation: 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
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
Unexecuted instantiation: 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
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
6134
1.84k
  {
6135
1.84k
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6136
1.82k
    TRACE_DISPATCH (this, u.format.v);
6137
1.82k
    switch (u.format.v) {
6138
112
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
6139
1.71k
    default:return_trace (c->default_return_value ());
6140
1.82k
    }
6141
1.82k
  }
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const
Unexecuted instantiation: 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
Unexecuted instantiation: OT::hb_depend_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_depend_context_t>(OT::hb_depend_context_t*) const
Unexecuted instantiation: 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
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
6134
229
  {
6135
229
    if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
6136
229
    TRACE_DISPATCH (this, u.format.v);
6137
229
    switch (u.format.v) {
6138
4
    case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
6139
225
    default:return_trace (c->default_return_value ());
6140
229
    }
6141
229
  }
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
6142
6143
  protected:
6144
  union {
6145
  struct { HBUINT16 v; }  format;   /* Format identifier */
6146
  ExtensionFormat1<T> format1;
6147
  } u;
6148
};
6149
6150
6151
/*
6152
 * GSUB/GPOS Common
6153
 */
6154
6155
struct hb_ot_layout_lookup_accelerator_t
6156
{
6157
  template <typename TLookup>
6158
  static hb_ot_layout_lookup_accelerator_t *create (const TLookup &lookup)
6159
6.12k
  {
6160
6.12k
    unsigned count = lookup.get_subtable_count ();
6161
6162
6.12k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
6163
6.12k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
6164
6.12k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
6165
6166
    /* The following is a calloc because when we are collecting subtables,
6167
     * some of them might be invalid and hence not collect; as a result,
6168
     * we might not fill in all the count entries of the subtables array.
6169
     * Zeroing it allows the set digest to gatekeep it without having to
6170
     * initialize it further. */
6171
6.12k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
6172
6.12k
    if (unlikely (!thiz))
6173
0
      return nullptr;
6174
6175
6.12k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
6176
6.12k
    lookup.dispatch (&c_accelerate_subtables);
6177
6178
    /* Invalid subtables do not collect and leave zeroed tail entries
6179
     * (see the calloc note above); trim them so the apply paths never
6180
     * see a null apply func. */
6181
148k
    while (count && !thiz->subtables[count - 1].apply_func)
6182
142k
      count--;
6183
6184
6.12k
    thiz->digest.init ();
6185
6.12k
    for (auto& subtable : hb_iter (thiz->subtables, count))
6186
2.87k
      thiz->digest.union_ (subtable.digest);
6187
6.12k
    thiz->digest_second = c_accelerate_subtables.digest_second;
6188
6189
6.12k
    thiz->count = count;
6190
6191
6.12k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6192
6.12k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
6193
6194
9.00k
    for (unsigned i = 0; i < count; i++)
6195
2.87k
      if (i != thiz->subtable_cache_user_idx)
6196
2.84k
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
6197
6.12k
#endif
6198
6199
6.12k
    return thiz;
6200
6.12k
  }
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
6159
1.13k
  {
6160
1.13k
    unsigned count = lookup.get_subtable_count ();
6161
6162
1.13k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
6163
1.13k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
6164
1.13k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
6165
6166
    /* The following is a calloc because when we are collecting subtables,
6167
     * some of them might be invalid and hence not collect; as a result,
6168
     * we might not fill in all the count entries of the subtables array.
6169
     * Zeroing it allows the set digest to gatekeep it without having to
6170
     * initialize it further. */
6171
1.13k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
6172
1.13k
    if (unlikely (!thiz))
6173
0
      return nullptr;
6174
6175
1.13k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
6176
1.13k
    lookup.dispatch (&c_accelerate_subtables);
6177
6178
    /* Invalid subtables do not collect and leave zeroed tail entries
6179
     * (see the calloc note above); trim them so the apply paths never
6180
     * see a null apply func. */
6181
33.4k
    while (count && !thiz->subtables[count - 1].apply_func)
6182
32.3k
      count--;
6183
6184
1.13k
    thiz->digest.init ();
6185
1.13k
    for (auto& subtable : hb_iter (thiz->subtables, count))
6186
1.43k
      thiz->digest.union_ (subtable.digest);
6187
1.13k
    thiz->digest_second = c_accelerate_subtables.digest_second;
6188
6189
1.13k
    thiz->count = count;
6190
6191
1.13k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6192
1.13k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
6193
6194
2.57k
    for (unsigned i = 0; i < count; i++)
6195
1.43k
      if (i != thiz->subtable_cache_user_idx)
6196
1.43k
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
6197
1.13k
#endif
6198
6199
1.13k
    return thiz;
6200
1.13k
  }
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
6159
4.99k
  {
6160
4.99k
    unsigned count = lookup.get_subtable_count ();
6161
6162
4.99k
    unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) -
6163
4.99k
        HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
6164
4.99k
        count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
6165
6166
    /* The following is a calloc because when we are collecting subtables,
6167
     * some of them might be invalid and hence not collect; as a result,
6168
     * we might not fill in all the count entries of the subtables array.
6169
     * Zeroing it allows the set digest to gatekeep it without having to
6170
     * initialize it further. */
6171
4.99k
    auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size);
6172
4.99k
    if (unlikely (!thiz))
6173
0
      return nullptr;
6174
6175
4.99k
    hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables);
6176
4.99k
    lookup.dispatch (&c_accelerate_subtables);
6177
6178
    /* Invalid subtables do not collect and leave zeroed tail entries
6179
     * (see the calloc note above); trim them so the apply paths never
6180
     * see a null apply func. */
6181
115k
    while (count && !thiz->subtables[count - 1].apply_func)
6182
110k
      count--;
6183
6184
4.99k
    thiz->digest.init ();
6185
4.99k
    for (auto& subtable : hb_iter (thiz->subtables, count))
6186
1.43k
      thiz->digest.union_ (subtable.digest);
6187
4.99k
    thiz->digest_second = c_accelerate_subtables.digest_second;
6188
6189
4.99k
    thiz->count = count;
6190
6191
4.99k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6192
4.99k
    thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx;
6193
6194
6.43k
    for (unsigned i = 0; i < count; i++)
6195
1.43k
      if (i != thiz->subtable_cache_user_idx)
6196
1.40k
       thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func;
6197
4.99k
#endif
6198
6199
4.99k
    return thiz;
6200
4.99k
  }
6201
6202
  void fini ()
6203
5.28k
  {
6204
5.28k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6205
6.72k
    for (unsigned i = 0; i < count; i++)
6206
1.43k
      hb_free (subtables[i].external_cache);
6207
5.28k
#endif
6208
5.28k
  }
6209
6210
  bool may_have (hb_codepoint_t g) const
6211
0
  { return digest.may_have (g); }
6212
6213
#ifndef HB_OPTIMIZE_SIZE
6214
  HB_ALWAYS_INLINE
6215
#endif
6216
  bool apply (hb_ot_apply_context_t *c, bool use_cache) const
6217
174M
  {
6218
174M
    if (count == 1)
6219
173M
    {
6220
      /* The accelerator digest is the union of the subtable digests, so
6221
       * for a single subtable it equals that subtable's digest, which the
6222
       * caller has already tested; skip the redundant retest. Zeroed
6223
       * invalid entries were trimmed at create time, so the subtable is
6224
       * always valid here. */
6225
173M
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6226
173M
      if (use_cache)
6227
147k
  return subtables[0].apply_cached_no_digest (c);
6228
173M
#endif
6229
173M
      return subtables[0].apply_no_digest (c);
6230
173M
    }
6231
607k
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6232
607k
    if (use_cache)
6233
0
    {
6234
0
      return
6235
0
      + hb_iter (hb_iter (subtables, count))
6236
0
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply_cached (c); })
6237
0
      | hb_any
6238
0
      ;
6239
0
    }
6240
607k
    else
6241
607k
#endif
6242
607k
    {
6243
607k
      return
6244
607k
      + hb_iter (hb_iter (subtables, count))
6245
2.38M
      | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply (c); })
6246
607k
      | hb_any
6247
607k
      ;
6248
607k
    }
6249
0
    return false;
6250
607k
  }
6251
6252
  bool cache_enter (hb_ot_apply_context_t *c) const
6253
5.89M
  {
6254
5.89M
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6255
5.89M
    return subtable_cache_user_idx != (unsigned) -1 &&
6256
124
     subtables[subtable_cache_user_idx].cache_enter (c);
6257
#else
6258
    return false;
6259
#endif
6260
5.89M
  }
6261
  void cache_leave (hb_ot_apply_context_t *c) const
6262
124
  {
6263
124
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6264
124
    subtables[subtable_cache_user_idx].cache_leave (c);
6265
124
#endif
6266
124
  }
6267
6268
6269
  hb_set_digest_t digest;
6270
  hb_set_digest_t digest_second;
6271
  private:
6272
  unsigned count = 0; /* Number of subtables in the array. */
6273
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
6274
  unsigned subtable_cache_user_idx = (unsigned) -1;
6275
#endif
6276
  hb_accelerate_subtables_context_t::hb_applicable_t subtables[HB_VAR_ARRAY];
6277
};
6278
6279
struct GSUBGPOS
6280
{
6281
  using LookupListT = LookupList<SmallTypes>;
6282
  using LookupList2T = LookupList<MediumTypes>;
6283
  template <typename TLookup>
6284
  using TLookupList = List16OfOffsetTo<TLookup, typename SmallTypes::HBLUINT>;
6285
  template <typename TLookup>
6286
  using TLookupList2 = List16OfOffsetTo<TLookup, typename MediumTypes::HBLUINT>;
6287
  template <typename TLookup>
6288
  using TLookupOffsetList = LookupOffsetList<TLookup, typename SmallTypes::HBLUINT>;
6289
  template <typename TLookup>
6290
  using TLookupOffsetList2 = LookupOffsetList<TLookup, typename MediumTypes::HBLUINT>;
6291
6292
  size_t get_size () const
6293
3.31k
  {
6294
3.31k
    if (version.major != 1) return version.static_size;
6295
6296
3.31k
    return min_size +
6297
3.31k
     (version.to_int () >= 0x00010001u ? featureVars.static_size : 0) +
6298
3.31k
#ifndef HB_NO_BEYOND_64K
6299
3.31k
     (version.to_int () >= 0x00010002u ? 3 * Offset32::static_size : 0)
6300
#else
6301
     0
6302
#endif
6303
3.31k
     ;
6304
3.31k
  }
6305
6306
  const ScriptList &get_script_list () const
6307
225k
  {
6308
225k
#ifndef HB_NO_BEYOND_64K
6309
225k
    if (version.to_int () >= 0x00010002u && scriptList2) return this + scriptList2;
6310
225k
#endif
6311
225k
    return this + scriptList;
6312
225k
  }
6313
  const FeatureList &get_feature_list () const
6314
180k
  {
6315
180k
#ifndef HB_NO_BEYOND_64K
6316
180k
    if (version.to_int () >= 0x00010002u && featureList2) return this + featureList2;
6317
180k
#endif
6318
180k
    return this + featureList;
6319
180k
  }
6320
  template <typename TLookup>
6321
  bool sanitize (hb_sanitize_context_t *c) const
6322
4.08k
  {
6323
4.08k
    TRACE_SANITIZE (this);
6324
4.08k
    if (unlikely (!version.sanitize (c) ||
6325
4.08k
      version.major != 1 ||
6326
4.08k
      !c->check_range (this, get_size ())))
6327
779
      return_trace (false);
6328
3.30k
    hb_barrier ();
6329
6330
3.30k
    bool script_list_ok = scriptList.sanitize (c, this);
6331
3.30k
    bool feature_list_ok = featureList.sanitize (c, this);
6332
3.30k
    bool lookup_list_ok = typed_lookup_list_offset<TLookup> ().sanitize (c, this);
6333
6334
3.30k
#ifndef HB_NO_BEYOND_64K
6335
3.30k
    if (version.to_int () >= 0x00010002u)
6336
789
    {
6337
789
      if (scriptList2) script_list_ok = scriptList2.sanitize (c, this);
6338
789
      if (featureList2) feature_list_ok = featureList2.sanitize (c, this);
6339
789
      if (lookupList2) lookup_list_ok = typed_lookup_list2_offset<TLookup> ().sanitize (c, this);
6340
789
    }
6341
3.30k
#endif
6342
6343
3.30k
    if (unlikely (!(script_list_ok && feature_list_ok && lookup_list_ok)))
6344
2.26k
      return_trace (false);
6345
6346
1.04k
#ifndef HB_NO_VAR
6347
1.04k
    if (unlikely (!(version.to_int () < 0x00010001u ||
6348
1.04k
        featureVars.sanitize (c, this, &get_feature_list ()))))
6349
84
      return_trace (false);
6350
957
#endif
6351
6352
1.04k
    return_trace (true);
6353
1.04k
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const
Line
Count
Source
6322
2.80k
  {
6323
2.80k
    TRACE_SANITIZE (this);
6324
2.80k
    if (unlikely (!version.sanitize (c) ||
6325
2.80k
      version.major != 1 ||
6326
2.80k
      !c->check_range (this, get_size ())))
6327
644
      return_trace (false);
6328
2.16k
    hb_barrier ();
6329
6330
2.16k
    bool script_list_ok = scriptList.sanitize (c, this);
6331
2.16k
    bool feature_list_ok = featureList.sanitize (c, this);
6332
2.16k
    bool lookup_list_ok = typed_lookup_list_offset<TLookup> ().sanitize (c, this);
6333
6334
2.16k
#ifndef HB_NO_BEYOND_64K
6335
2.16k
    if (version.to_int () >= 0x00010002u)
6336
269
    {
6337
269
      if (scriptList2) script_list_ok = scriptList2.sanitize (c, this);
6338
269
      if (featureList2) feature_list_ok = featureList2.sanitize (c, this);
6339
269
      if (lookupList2) lookup_list_ok = typed_lookup_list2_offset<TLookup> ().sanitize (c, this);
6340
269
    }
6341
2.16k
#endif
6342
6343
2.16k
    if (unlikely (!(script_list_ok && feature_list_ok && lookup_list_ok)))
6344
1.36k
      return_trace (false);
6345
6346
801
#ifndef HB_NO_VAR
6347
801
    if (unlikely (!(version.to_int () < 0x00010001u ||
6348
801
        featureVars.sanitize (c, this, &get_feature_list ()))))
6349
5
      return_trace (false);
6350
796
#endif
6351
6352
796
    return_trace (true);
6353
801
  }
bool OT::GSUBGPOS::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const
Line
Count
Source
6322
1.28k
  {
6323
1.28k
    TRACE_SANITIZE (this);
6324
1.28k
    if (unlikely (!version.sanitize (c) ||
6325
1.28k
      version.major != 1 ||
6326
1.28k
      !c->check_range (this, get_size ())))
6327
135
      return_trace (false);
6328
1.14k
    hb_barrier ();
6329
6330
1.14k
    bool script_list_ok = scriptList.sanitize (c, this);
6331
1.14k
    bool feature_list_ok = featureList.sanitize (c, this);
6332
1.14k
    bool lookup_list_ok = typed_lookup_list_offset<TLookup> ().sanitize (c, this);
6333
6334
1.14k
#ifndef HB_NO_BEYOND_64K
6335
1.14k
    if (version.to_int () >= 0x00010002u)
6336
520
    {
6337
520
      if (scriptList2) script_list_ok = scriptList2.sanitize (c, this);
6338
520
      if (featureList2) feature_list_ok = featureList2.sanitize (c, this);
6339
520
      if (lookupList2) lookup_list_ok = typed_lookup_list2_offset<TLookup> ().sanitize (c, this);
6340
520
    }
6341
1.14k
#endif
6342
6343
1.14k
    if (unlikely (!(script_list_ok && feature_list_ok && lookup_list_ok)))
6344
906
      return_trace (false);
6345
6346
240
#ifndef HB_NO_VAR
6347
240
    if (unlikely (!(version.to_int () < 0x00010001u ||
6348
240
        featureVars.sanitize (c, this, &get_feature_list ()))))
6349
79
      return_trace (false);
6350
161
#endif
6351
6352
161
    return_trace (true);
6353
240
  }
6354
6355
  template <typename TLookup>
6356
  bool subset (hb_subset_layout_context_t *c) const
6357
0
  {
6358
0
    TRACE_SUBSET (this);
6359
0
    if (version.major != 1) return_trace (false);
6360
6361
0
    auto *out = c->subset_context->serializer->start_embed (this);
6362
0
    if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false);
6363
6364
0
    out->version = version;
6365
6366
0
#ifndef HB_NO_BEYOND_64K
6367
0
    if (version.to_int () >= 0x00010002u)
6368
0
    {
6369
0
      if (unlikely (!c->subset_context->serializer->extend_size (out, get_size ())))
6370
0
        return_trace (false);
6371
6372
0
      out->scriptList = 0;
6373
0
      out->featureList = 0;
6374
0
      out->lookupList = 0;
6375
6376
0
      if (lookupList2)
6377
0
  serialize_subset_offset (c->subset_context, out->lookupList2,
6378
0
         subset_lookup_list2_offset<TLookup> (),
6379
0
         this, c);
6380
0
      else
6381
0
  serialize_subset_offset (c->subset_context, out->lookupList2,
6382
0
         subset_lookup_list_offset<TLookup> (),
6383
0
         this, c);
6384
6385
0
      if (featureList2)
6386
0
  serialize_subset_offset (c->subset_context, out->featureList2,
6387
0
         subset_feature_list2_offset (),
6388
0
         this, c);
6389
0
      else
6390
0
  serialize_subset_offset (c->subset_context, out->featureList2,
6391
0
         subset_feature_list_offset (),
6392
0
         this, c);
6393
6394
0
      if (scriptList2)
6395
0
  serialize_subset_offset (c->subset_context, out->scriptList2, scriptList2, this, c);
6396
0
      else
6397
0
  serialize_subset_offset (c->subset_context, out->scriptList2, scriptList, this, c);
6398
0
    }
6399
0
    else
6400
0
#endif
6401
0
    {
6402
0
      out->subset_lookup_list_offset<TLookup> ()
6403
0
    .serialize_subset (c->subset_context,
6404
0
           subset_lookup_list_offset<TLookup> (),
6405
0
           this,
6406
0
           c);
6407
6408
0
      out->subset_feature_list_offset ()
6409
0
    .serialize_subset (c->subset_context,
6410
0
           subset_feature_list_offset (),
6411
0
           this,
6412
0
           c);
6413
6414
0
      out->scriptList.serialize_subset (c->subset_context,
6415
0
          scriptList,
6416
0
          this,
6417
0
          c);
6418
0
    }
6419
6420
0
#ifndef HB_NO_VAR
6421
0
    if (version.to_int () >= 0x00010001u)
6422
0
    {
6423
0
      auto snapshot = c->subset_context->serializer->snapshot ();
6424
0
      if (version.to_int () < 0x00010002u &&
6425
0
    !c->subset_context->serializer->extend_min (&out->featureVars))
6426
0
        return_trace (false);
6427
6428
      // if all axes are pinned all feature vars are dropped.
6429
0
      bool ret = !c->subset_context->plan->all_axes_pinned
6430
0
                 && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c);
6431
0
      if (!ret)
6432
0
      {
6433
0
        out->featureVars = 0;
6434
0
  if (version.to_int () < 0x00010002u)
6435
0
  {
6436
0
    c->subset_context->serializer->revert (snapshot);
6437
0
    out->version.major = 1;
6438
0
    out->version.minor = 0;
6439
0
  }
6440
0
      }
6441
0
    }
6442
0
#endif
6443
6444
0
    return_trace (true);
6445
0
  }
Unexecuted instantiation: bool OT::GSUBGPOS::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const
Unexecuted instantiation: bool OT::GSUBGPOS::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const
6446
6447
  unsigned int get_lookup_count () const
6448
64.0k
  {
6449
64.0k
#ifndef HB_NO_BEYOND_64K
6450
64.0k
    if (version.to_int () >= 0x00010002u && lookupList2)
6451
10
      return (this + lookupList2).len;
6452
64.0k
#endif
6453
64.0k
    return (this + lookupList).len;
6454
64.0k
  }
6455
  const Lookup& get_lookup (unsigned int i) const
6456
6.05M
  {
6457
6.05M
#ifndef HB_NO_BEYOND_64K
6458
6.05M
    if (version.to_int () >= 0x00010002u && lookupList2)
6459
0
      return (this + lookupList2)[i];
6460
6.05M
#endif
6461
6.05M
    return (this + lookupList)[i];
6462
6.05M
  }
6463
  const FeatureVariations &get_feature_variations () const
6464
101M
  {
6465
101M
    return (version.to_int () >= 0x00010001u && hb_barrier ()) ? this+featureVars : Null (FeatureVariations);
6466
101M
  }
6467
6468
36.0k
  bool has_data () const { return version.to_int (); }
6469
  unsigned int get_script_count () const
6470
120
  { return get_script_list ().len; }
6471
  const Tag& get_script_tag (unsigned int i) const
6472
0
  { return get_script_list ().get_tag (i); }
6473
  unsigned int get_script_tags (unsigned int start_offset,
6474
        unsigned int *script_count /* IN/OUT */,
6475
        hb_tag_t     *script_tags /* OUT */) const
6476
0
  { return get_script_list ().get_tags (start_offset, script_count, script_tags); }
6477
  const Script& get_script (unsigned int i) const
6478
109k
  { return get_script_list ()[i]; }
6479
  bool find_script_index (hb_tag_t tag, unsigned int *index) const
6480
116k
  { return get_script_list ().find_index (tag, index); }
6481
6482
  unsigned int get_feature_count () const
6483
1.19k
  { return get_feature_list ().len; }
6484
  hb_tag_t get_feature_tag (unsigned int i) const
6485
110k
  { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : get_feature_list ().get_tag (i); }
6486
  unsigned int get_feature_tags (unsigned int start_offset,
6487
         unsigned int *feature_count /* IN/OUT */,
6488
         hb_tag_t     *feature_tags /* OUT */) const
6489
0
  { return get_feature_list ().get_tags (start_offset, feature_count, feature_tags); }
6490
  const Feature& get_feature (unsigned int i) const
6491
106k
  { return get_feature_list ()[i]; }
6492
  bool find_feature_index (hb_tag_t tag, unsigned int *index) const
6493
0
  { return get_feature_list ().find_index (tag, index); }
6494
6495
  bool find_variations_index (const int *coords, unsigned int num_coords,
6496
            unsigned int *index,
6497
            ItemVarStoreInstancer *instancer) const
6498
50.9M
  {
6499
#ifdef HB_NO_VAR
6500
    *index = FeatureVariations::NOT_FOUND_INDEX;
6501
    return false;
6502
#endif
6503
50.9M
    return get_feature_variations ().find_index (coords, num_coords, index, instancer);
6504
50.9M
  }
6505
  bool get_feature_variations_state (const int *coords,
6506
             unsigned int num_coords,
6507
             unsigned int *index,
6508
             ItemVarStoreInstancer *instancer,
6509
             hb_vector_t<unsigned> *lookup_conditions) const
6510
50.9M
  {
6511
50.9M
    lookup_conditions->reset ();
6512
#ifdef HB_NO_VAR
6513
    *index = FeatureVariations::NOT_FOUND_INDEX;
6514
    return true;
6515
#else
6516
50.9M
    find_variations_index (coords, num_coords, index, instancer);
6517
50.9M
    return get_feature_variations ().collect_lookup_conditions (
6518
50.9M
  coords,
6519
50.9M
  num_coords,
6520
50.9M
  instancer,
6521
50.9M
  lookup_conditions);
6522
50.9M
#endif
6523
50.9M
  }
6524
  bool get_lookup_variations (unsigned feature_index,
6525
                              unsigned variations_index,
6526
                              hb_sorted_array_t<const unsigned> conditions,
6527
                              hb_set_t *lookup_indexes) const
6528
45.9k
  {
6529
#ifdef HB_NO_VAR
6530
    return false;
6531
#else
6532
45.9k
    return get_feature_variations ().get_lookup_variations (
6533
45.9k
  feature_index, get_feature_variation (feature_index, variations_index),
6534
45.9k
  conditions, lookup_indexes);
6535
45.9k
#endif
6536
45.9k
  }
6537
  const Feature& get_feature_variation (unsigned int feature_index,
6538
          unsigned int variations_index) const
6539
106k
  {
6540
106k
#ifndef HB_NO_VAR
6541
106k
    if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
6542
24
  version.to_int () >= 0x00010001u)
6543
24
    {
6544
24
      const Feature *feature = get_feature_variations ().find_substitute (variations_index,
6545
24
                    feature_index);
6546
24
      if (feature)
6547
0
  return *feature;
6548
24
    }
6549
106k
#endif
6550
106k
    return get_feature (feature_index);
6551
106k
  }
6552
6553
  void feature_variation_collect_lookups (const hb_set_t *feature_indexes,
6554
            const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map,
6555
            hb_set_t       *lookup_indexes /* OUT */) const
6556
120
  {
6557
120
#ifndef HB_NO_VAR
6558
120
    get_feature_variations ().collect_lookups (feature_indexes, feature_record_cond_idx_map, lookup_indexes);
6559
120
#endif
6560
120
  }
6561
6562
  void collect_feature_variation_indices (hb_collect_variation_indices_context_t *c) const
6563
0
  {
6564
0
#ifndef HB_NO_VAR
6565
0
    get_feature_variations ().collect_variation_indices (c);
6566
0
#endif
6567
0
  }
6568
6569
#ifndef HB_NO_VAR
6570
  void collect_feature_substitutes_with_variations (hb_collect_feature_substitutes_with_var_context_t *c) const
6571
0
  { get_feature_variations ().collect_feature_substitutes_with_variations (c); }
6572
#endif
6573
6574
  template <typename TLookup>
6575
  void closure_lookups (hb_face_t      *face,
6576
      const hb_set_t *glyphs,
6577
      hb_set_t       *lookup_indexes /* IN/OUT */) const
6578
0
  {
6579
0
    hb_set_t visited_lookups, inactive_lookups;
6580
0
    hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups);
6581
6582
0
    c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>);
6583
6584
0
    for (unsigned lookup_index : *lookup_indexes)
6585
0
      reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);
6586
6587
0
    hb_set_union (lookup_indexes, &visited_lookups);
6588
0
    hb_set_subtract (lookup_indexes, &inactive_lookups);
6589
0
  }
Unexecuted instantiation: void OT::GSUBGPOS::closure_lookups<OT::Layout::GPOS_impl::PosLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const
Unexecuted instantiation: void OT::GSUBGPOS::closure_lookups<OT::Layout::GSUB_impl::SubstLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const
6590
6591
  void prune_langsys (const hb_map_t *duplicate_feature_map,
6592
                      const hb_set_t *layout_scripts,
6593
                      hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map,
6594
                      hb_set_t       *new_feature_indexes /* OUT */) const
6595
0
  {
6596
0
    hb_prune_langsys_context_t c (this, script_langsys_map, duplicate_feature_map, new_feature_indexes);
6597
6598
0
    unsigned count = get_script_count ();
6599
0
    for (unsigned script_index = 0; script_index < count; script_index++)
6600
0
    {
6601
0
      const Tag& tag = get_script_tag (script_index);
6602
0
      if (!layout_scripts->has (tag)) continue;
6603
0
      const Script& s = get_script (script_index);
6604
0
      s.prune_langsys (&c, script_index);
6605
0
    }
6606
0
  }
6607
6608
  void prune_features (const hb_map_t *lookup_indices, /* IN */
6609
           const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map, /* IN */
6610
           const hb_hashmap_t<unsigned, const Feature*> *feature_substitutes_map, /* IN */
6611
           hb_set_t       *feature_indices /* IN/OUT */) const
6612
0
  {
6613
0
#ifndef HB_NO_VAR
6614
    // This is the set of feature indices which have alternate versions defined
6615
    // if the FeatureVariation's table and the alternate version(s) intersect the
6616
    // set of lookup indices.
6617
0
    hb_set_t alternate_feature_indices;
6618
0
    get_feature_variations ().closure_features (lookup_indices, feature_record_cond_idx_map, &alternate_feature_indices);
6619
0
    if (unlikely (alternate_feature_indices.in_error()))
6620
0
    {
6621
0
      feature_indices->err ();
6622
0
      return;
6623
0
    }
6624
0
#endif
6625
6626
0
    for (unsigned i : hb_iter (feature_indices))
6627
0
    {
6628
0
      hb_tag_t tag =  get_feature_tag (i);
6629
0
      if (tag == HB_TAG ('p', 'r', 'e', 'f'))
6630
        // Note: Never ever drop feature 'pref', even if it's empty.
6631
        // HarfBuzz chooses shaper for Khmer based on presence of this
6632
        // feature. See thread at:
6633
  // http://lists.freedesktop.org/archives/harfbuzz/2012-November/002660.html
6634
0
        continue;
6635
6636
6637
0
      const Feature *f = &(get_feature (i));
6638
0
      const Feature** p = nullptr;
6639
0
      if (feature_substitutes_map->has (i, &p))
6640
0
        f = *p;
6641
6642
0
      if (!f->featureParams.is_null () &&
6643
0
          tag == HB_TAG ('s', 'i', 'z', 'e'))
6644
0
        continue;
6645
6646
0
      if (!f->intersects_lookup_indexes (lookup_indices)
6647
0
#ifndef HB_NO_VAR
6648
0
          && !alternate_feature_indices.has (i)
6649
0
#endif
6650
0
    )
6651
0
  feature_indices->del (i);
6652
0
    }
6653
0
  }
6654
6655
  void collect_name_ids (const hb_map_t *feature_index_map,
6656
                         hb_set_t *nameids_to_retain, /* OUT */
6657
                         const hb_hashmap_t<unsigned, const Feature*> *feature_substitutes_map,
6658
                         const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map HB_UNUSED,
6659
                         const hb_set_t *catch_all_features,
6660
                         bool all_axes_pinned HB_UNUSED) const
6661
0
  {
6662
0
    unsigned count = get_feature_count ();
6663
0
    for (unsigned i = 0 ; i < count; i++)
6664
0
    {
6665
0
      if (!feature_index_map->has (i)) continue;
6666
0
      hb_tag_t tag = get_feature_tag (i);
6667
0
      const Feature *feature = &get_feature (i);
6668
0
      const Feature **substitute;
6669
0
      if (feature_substitutes_map->has (i, &substitute))
6670
0
      {
6671
0
        feature = *substitute;
6672
0
        if (catch_all_features->has (i))
6673
0
          get_feature (i).collect_name_ids (tag, nameids_to_retain);
6674
0
      }
6675
0
      feature->collect_name_ids (tag, nameids_to_retain);
6676
0
    }
6677
0
#ifndef HB_NO_VAR
6678
0
    if (!all_axes_pinned)
6679
0
      get_feature_variations ().collect_name_ids (feature_index_map, feature_record_cond_idx_map,
6680
0
                                                  [this] (unsigned i) { return get_feature_tag (i); },
6681
0
                                                  nameids_to_retain);
6682
0
#endif
6683
0
  }
6684
6685
  template <typename T>
6686
  struct accelerator_t
6687
  {
6688
    accelerator_t (hb_face_t *face)
6689
18.0k
    {
6690
18.0k
      hb_sanitize_context_t sc;
6691
18.0k
      sc.lazy_some_gpos = true;
6692
18.0k
      this->table = sc.reference_table<T> (face);
6693
6694
18.0k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
6695
0
      {
6696
0
  hb_blob_destroy (this->table.get_blob ());
6697
0
  this->table = hb_blob_get_empty ();
6698
0
      }
6699
6700
18.0k
      this->lookup_count = table->get_lookup_count ();
6701
6702
18.0k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
6703
18.0k
      if (unlikely (!this->accels))
6704
0
      {
6705
0
  this->lookup_count = 0;
6706
0
  this->table.destroy ();
6707
0
  this->table = hb_blob_get_empty ();
6708
0
      }
6709
18.0k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::accelerator_t(hb_face_t*)
Line
Count
Source
6689
9.02k
    {
6690
9.02k
      hb_sanitize_context_t sc;
6691
9.02k
      sc.lazy_some_gpos = true;
6692
9.02k
      this->table = sc.reference_table<T> (face);
6693
6694
9.02k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
6695
0
      {
6696
0
  hb_blob_destroy (this->table.get_blob ());
6697
0
  this->table = hb_blob_get_empty ();
6698
0
      }
6699
6700
9.02k
      this->lookup_count = table->get_lookup_count ();
6701
6702
9.02k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
6703
9.02k
      if (unlikely (!this->accels))
6704
0
      {
6705
0
  this->lookup_count = 0;
6706
0
  this->table.destroy ();
6707
0
  this->table = hb_blob_get_empty ();
6708
0
      }
6709
9.02k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::accelerator_t(hb_face_t*)
Line
Count
Source
6689
9.02k
    {
6690
9.02k
      hb_sanitize_context_t sc;
6691
9.02k
      sc.lazy_some_gpos = true;
6692
9.02k
      this->table = sc.reference_table<T> (face);
6693
6694
9.02k
      if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face)))
6695
0
      {
6696
0
  hb_blob_destroy (this->table.get_blob ());
6697
0
  this->table = hb_blob_get_empty ();
6698
0
      }
6699
6700
9.02k
      this->lookup_count = table->get_lookup_count ();
6701
6702
9.02k
      this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels));
6703
9.02k
      if (unlikely (!this->accels))
6704
0
      {
6705
0
  this->lookup_count = 0;
6706
0
  this->table.destroy ();
6707
0
  this->table = hb_blob_get_empty ();
6708
0
      }
6709
9.02k
    }
6710
    ~accelerator_t ()
6711
17.9k
    {
6712
25.4k
      for (unsigned int i = 0; i < this->lookup_count; i++)
6713
7.44k
      {
6714
7.44k
  auto *accel = this->accels[i].get_relaxed ();
6715
7.44k
  if (accel)
6716
5.28k
    accel->fini ();
6717
7.44k
  hb_free (accel);
6718
7.44k
      }
6719
17.9k
      hb_free (this->accels);
6720
17.9k
      this->table.destroy ();
6721
17.9k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::~accelerator_t()
Line
Count
Source
6711
8.97k
    {
6712
15.7k
      for (unsigned int i = 0; i < this->lookup_count; i++)
6713
6.78k
      {
6714
6.78k
  auto *accel = this->accels[i].get_relaxed ();
6715
6.78k
  if (accel)
6716
4.90k
    accel->fini ();
6717
6.78k
  hb_free (accel);
6718
6.78k
      }
6719
8.97k
      hb_free (this->accels);
6720
8.97k
      this->table.destroy ();
6721
8.97k
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::~accelerator_t()
Line
Count
Source
6711
8.97k
    {
6712
9.63k
      for (unsigned int i = 0; i < this->lookup_count; i++)
6713
661
      {
6714
661
  auto *accel = this->accels[i].get_relaxed ();
6715
661
  if (accel)
6716
380
    accel->fini ();
6717
661
  hb_free (accel);
6718
661
      }
6719
8.97k
      hb_free (this->accels);
6720
8.97k
      this->table.destroy ();
6721
8.97k
    }
6722
6723
50.8M
    hb_blob_t *get_blob () const { return table.get_blob (); }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_blob() const
Line
Count
Source
6723
25.4M
    hb_blob_t *get_blob () const { return table.get_blob (); }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_blob() const
Line
Count
Source
6723
25.4M
    hb_blob_t *get_blob () const { return table.get_blob (); }
6724
6725
    hb_ot_layout_lookup_accelerator_t *get_accel (unsigned lookup_index) const
6726
193M
    {
6727
193M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
6728
6729
193M
    retry:
6730
193M
      auto *accel = accels[lookup_index].get_acquire ();
6731
193M
      if (unlikely (!accel))
6732
6.12k
      {
6733
6.12k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
6734
6.12k
  if (unlikely (!accel))
6735
0
    return nullptr;
6736
6737
6.12k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
6738
0
  {
6739
0
    accel->fini ();
6740
0
    hb_free (accel);
6741
0
    goto retry;
6742
0
  }
6743
6.12k
      }
6744
6745
193M
      return accel;
6746
193M
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_accel(unsigned int) const
Line
Count
Source
6726
176M
    {
6727
176M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
6728
6729
176M
    retry:
6730
176M
      auto *accel = accels[lookup_index].get_acquire ();
6731
176M
      if (unlikely (!accel))
6732
1.13k
      {
6733
1.13k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
6734
1.13k
  if (unlikely (!accel))
6735
0
    return nullptr;
6736
6737
1.13k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
6738
0
  {
6739
0
    accel->fini ();
6740
0
    hb_free (accel);
6741
0
    goto retry;
6742
0
  }
6743
1.13k
      }
6744
6745
176M
      return accel;
6746
176M
    }
OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_accel(unsigned int) const
Line
Count
Source
6726
17.2M
    {
6727
17.2M
      if (unlikely (lookup_index >= lookup_count)) return nullptr;
6728
6729
17.1M
    retry:
6730
17.1M
      auto *accel = accels[lookup_index].get_acquire ();
6731
17.1M
      if (unlikely (!accel))
6732
4.99k
      {
6733
4.99k
  accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index));
6734
4.99k
  if (unlikely (!accel))
6735
0
    return nullptr;
6736
6737
4.99k
  if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel)))
6738
0
  {
6739
0
    accel->fini ();
6740
0
    hb_free (accel);
6741
0
    goto retry;
6742
0
  }
6743
4.99k
      }
6744
6745
17.1M
      return accel;
6746
17.1M
    }
6747
6748
    hb_blob_ptr_t<T> table;
6749
    unsigned int lookup_count;
6750
    hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *accels;
6751
  };
6752
6753
  protected:
6754
  template <typename TLookup>
6755
  const Offset16To<TLookupList<TLookup>>& typed_lookup_list_offset () const
6756
3.30k
  { return reinterpret_cast<const Offset16To<TLookupList<TLookup>>&> (lookupList); }
OT::OffsetTo<OT::List16OfOffsetTo<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const& OT::GSUBGPOS::typed_lookup_list_offset<OT::Layout::GSUB_impl::SubstLookup>() const
Line
Count
Source
6756
2.16k
  { return reinterpret_cast<const Offset16To<TLookupList<TLookup>>&> (lookupList); }
OT::OffsetTo<OT::List16OfOffsetTo<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const& OT::GSUBGPOS::typed_lookup_list_offset<OT::Layout::GPOS_impl::PosLookup>() const
Line
Count
Source
6756
1.14k
  { return reinterpret_cast<const Offset16To<TLookupList<TLookup>>&> (lookupList); }
6757
6758
#ifndef HB_NO_BEYOND_64K
6759
  template <typename TLookup>
6760
  const Offset32To<TLookupList2<TLookup>>& typed_lookup_list2_offset () const
6761
684
  { return reinterpret_cast<const Offset32To<TLookupList2<TLookup>>&> (lookupList2); }
OT::OffsetTo<OT::List16OfOffsetTo<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const& OT::GSUBGPOS::typed_lookup_list2_offset<OT::Layout::GSUB_impl::SubstLookup>() const
Line
Count
Source
6761
252
  { return reinterpret_cast<const Offset32To<TLookupList2<TLookup>>&> (lookupList2); }
OT::OffsetTo<OT::List16OfOffsetTo<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const& OT::GSUBGPOS::typed_lookup_list2_offset<OT::Layout::GPOS_impl::PosLookup>() const
Line
Count
Source
6761
432
  { return reinterpret_cast<const Offset32To<TLookupList2<TLookup>>&> (lookupList2); }
6762
#endif
6763
6764
  template <typename TLookup>
6765
  const Offset16To<TLookupOffsetList<TLookup>>& subset_lookup_list_offset () const
6766
0
  { return reinterpret_cast<const Offset16To<TLookupOffsetList<TLookup>>&> (lookupList); }
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const& OT::GSUBGPOS::subset_lookup_list_offset<OT::Layout::GPOS_impl::PosLookup>() const
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const& OT::GSUBGPOS::subset_lookup_list_offset<OT::Layout::GSUB_impl::SubstLookup>() const
6767
  template <typename TLookup>
6768
  Offset16To<TLookupOffsetList<TLookup>>& subset_lookup_list_offset ()
6769
0
  { return reinterpret_cast<Offset16To<TLookupOffsetList<TLookup>>&> (lookupList); }
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true>& OT::GSUBGPOS::subset_lookup_list_offset<OT::Layout::GPOS_impl::PosLookup>()
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true>& OT::GSUBGPOS::subset_lookup_list_offset<OT::Layout::GSUB_impl::SubstLookup>()
6770
6771
#ifndef HB_NO_BEYOND_64K
6772
  template <typename TLookup>
6773
  const Offset32To<TLookupOffsetList2<TLookup>>& subset_lookup_list2_offset () const
6774
0
  { return reinterpret_cast<const Offset32To<TLookupOffsetList2<TLookup>>&> (lookupList2); }
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const& OT::GSUBGPOS::subset_lookup_list2_offset<OT::Layout::GPOS_impl::PosLookup>() const
Unexecuted instantiation: OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const& OT::GSUBGPOS::subset_lookup_list2_offset<OT::Layout::GSUB_impl::SubstLookup>() const
6775
#endif
6776
6777
  const Offset16To<RecordListOfFeature>& subset_feature_list_offset () const
6778
0
  { return reinterpret_cast<const Offset16To<RecordListOfFeature>&> (featureList); }
6779
  Offset16To<RecordListOfFeature>& subset_feature_list_offset ()
6780
0
  { return reinterpret_cast<Offset16To<RecordListOfFeature>&> (featureList); }
6781
6782
#ifndef HB_NO_BEYOND_64K
6783
  const Offset32To<RecordListOfFeature>& subset_feature_list2_offset () const
6784
0
  { return reinterpret_cast<const Offset32To<RecordListOfFeature>&> (featureList2); }
6785
#endif
6786
6787
  const void* get_lookup_list_field_offset () const
6788
0
  {
6789
0
#ifndef HB_NO_BEYOND_64K
6790
0
    if (version.to_int () >= 0x00010002u && lookupList2) return &lookupList2;
6791
0
#endif
6792
0
    return &lookupList;
6793
0
  }
6794
6795
  template <typename OffsetOut, typename OffsetIn, typename Base, typename ...Ts>
6796
  static bool serialize_subset_offset (hb_subset_context_t *c,
6797
               OffsetOut& out,
6798
               const OffsetIn& in,
6799
               const Base *base,
6800
               Ts&&... ds)
6801
0
  {
6802
0
    out = 0;
6803
0
    if (in.is_null ()) return false;
6804
6805
0
    auto *s = c->serializer;
6806
0
    s->push ();
6807
0
    bool ret = c->dispatch (base+in, std::forward<Ts> (ds)...);
6808
0
    if (ret) s->add_link (out, s->pop_pack ());
6809
0
    else s->pop_discard ();
6810
0
    return ret;
6811
0
  }
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GPOS_impl::PosLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::RecordListOf<OT::Feature>, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::RecordListOfFeature, OT::NumType<true, unsigned int, 4u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::RecordListOf<OT::Feature>, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::RecordListOfFeature, OT::NumType<true, unsigned int, 4u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::RecordListOf<OT::Feature>, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::RecordListOfFeature, OT::NumType<true, unsigned short, 2u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::RecordListOf<OT::Feature>, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::RecordListOfFeature, OT::NumType<true, unsigned short, 2u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned short, 2u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::RecordListOfScript, OT::NumType<true, unsigned short, 2u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
Unexecuted instantiation: bool OT::GSUBGPOS::serialize_subset_offset<OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true>, OT::GSUBGPOS, OT::hb_subset_layout_context_t*&>(hb_subset_context_t*, OT::OffsetTo<OT::List16OfOffsetTo<OT::Lookup, OT::NumType<true, unsigned int, 4u> >, OT::NumType<true, unsigned int, 4u>, void, true>&, OT::OffsetTo<OT::LookupOffsetList<OT::Layout::GSUB_impl::SubstLookup, OT::NumType<true, unsigned short, 2u> >, OT::NumType<true, unsigned short, 2u>, void, true> const&, OT::GSUBGPOS const*, OT::hb_subset_layout_context_t*&)
6812
6813
  FixedVersion<>version;  /* Version of the GSUB/GPOS table--initially set
6814
         * to 0x00010000u */
6815
  Offset16To<ScriptList>
6816
    scriptList; /* Offset to ScriptList table */
6817
  Offset16To<FeatureList>
6818
    featureList;  /* Offset to FeatureList table */
6819
  Offset16To<LookupListT>
6820
    lookupList; /* Offset to LookupList table */
6821
  Offset32To<FeatureVariations>
6822
    featureVars;  /* Offset to Feature Variations table--from
6823
         * beginning of table (may be NULL).
6824
         * Introduced in version 0x00010001. */
6825
#ifndef HB_NO_BEYOND_64K
6826
  Offset32To<ScriptList>
6827
    scriptList2;  /* 32-bit offset to ScriptList table.
6828
         * Introduced in version 0x00010002. */
6829
  Offset32To<FeatureList>
6830
    featureList2; /* 32-bit offset to FeatureList table.
6831
         * Introduced in version 0x00010002. */
6832
  Offset32To<LookupList2T>
6833
    lookupList2;  /* 32-bit offset to LookupList2 table.
6834
         * Introduced in version 0x00010002. */
6835
#endif
6836
  public:
6837
  DEFINE_SIZE_MIN (10);
6838
};
6839
6840
6841
} /* namespace OT */
6842
6843
6844
#endif /* HB_OT_LAYOUT_GSUBGPOS_HH */