Coverage Report

Created: 2025-08-29 06:20

/src/harfbuzz/src/OT/Layout/GSUB/SubstLookupSubTable.hh
Line
Count
Source (jump to first uncovered line)
1
#ifndef OT_LAYOUT_GSUB_SUBSTLOOKUPSUBTABLE_HH
2
#define OT_LAYOUT_GSUB_SUBSTLOOKUPSUBTABLE_HH
3
4
#include "Common.hh"
5
#include "SingleSubst.hh"
6
#include "MultipleSubst.hh"
7
#include "AlternateSubst.hh"
8
#include "LigatureSubst.hh"
9
#include "ContextSubst.hh"
10
#include "ChainContextSubst.hh"
11
#include "ExtensionSubst.hh"
12
#include "ReverseChainSingleSubst.hh"
13
14
namespace OT {
15
namespace Layout {
16
namespace GSUB_impl {
17
18
struct SubstLookupSubTable
19
{
20
  friend struct ::OT::Lookup;
21
  friend struct SubstLookup;
22
23
  protected:
24
  union {
25
  SingleSubst                   single;
26
  MultipleSubst                 multiple;
27
  AlternateSubst                alternate;
28
  LigatureSubst                 ligature;
29
  ContextSubst                  context;
30
  ChainContextSubst             chainContext;
31
  ExtensionSubst                extension;
32
  ReverseChainSingleSubst       reverseChainContextSingle;
33
  } u;
34
  public:
35
  DEFINE_SIZE_MIN (0);
36
37
  enum Type {
38
    Single              = 1,
39
    Multiple            = 2,
40
    Alternate           = 3,
41
    Ligature            = 4,
42
    Context             = 5,
43
    ChainContext        = 6,
44
    Extension           = 7,
45
    ReverseChainSingle  = 8
46
  };
47
48
  template <typename context_t, typename ...Ts>
49
  typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type, Ts&&... ds) const
50
6.02k
  {
51
6.02k
    TRACE_DISPATCH (this, lookup_type);
52
6.02k
    switch (lookup_type) {
53
2.03k
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
54
0
    case Multiple:              return_trace (u.multiple.dispatch (c, std::forward<Ts> (ds)...));
55
3.74k
    case Alternate:             return_trace (u.alternate.dispatch (c, std::forward<Ts> (ds)...));
56
100
    case Ligature:              return_trace (u.ligature.dispatch (c, std::forward<Ts> (ds)...));
57
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
58
144
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
59
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
60
0
    case ReverseChainSingle:    return_trace (u.reverseChainContextSingle.dispatch (c, std::forward<Ts> (ds)...));
61
0
    default:                    return_trace (c->default_return_value ());
62
6.02k
    }
63
6.02k
  }
Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*, unsigned int) const
hb_sanitize_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*, unsigned int) const
Line
Count
Source
50
5.95k
  {
51
5.95k
    TRACE_DISPATCH (this, lookup_type);
52
5.95k
    switch (lookup_type) {
53
2.03k
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
54
0
    case Multiple:              return_trace (u.multiple.dispatch (c, std::forward<Ts> (ds)...));
55
3.74k
    case Alternate:             return_trace (u.alternate.dispatch (c, std::forward<Ts> (ds)...));
56
90
    case Ligature:              return_trace (u.ligature.dispatch (c, std::forward<Ts> (ds)...));
57
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
58
80
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
59
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
60
0
    case ReverseChainSingle:    return_trace (u.reverseChainContextSingle.dispatch (c, std::forward<Ts> (ds)...));
61
0
    default:                    return_trace (c->default_return_value ());
62
5.95k
    }
63
5.95k
  }
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*, unsigned int) const
Unexecuted instantiation: hb_subset_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<hb_subset_context_t>(hb_subset_context_t*, unsigned int) const
OT::hb_accelerate_subtables_context_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*, unsigned int) const
Line
Count
Source
50
74
  {
51
74
    TRACE_DISPATCH (this, lookup_type);
52
74
    switch (lookup_type) {
53
0
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
54
0
    case Multiple:              return_trace (u.multiple.dispatch (c, std::forward<Ts> (ds)...));
55
0
    case Alternate:             return_trace (u.alternate.dispatch (c, std::forward<Ts> (ds)...));
56
10
    case Ligature:              return_trace (u.ligature.dispatch (c, std::forward<Ts> (ds)...));
57
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
58
64
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
59
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
60
0
    case ReverseChainSingle:    return_trace (u.reverseChainContextSingle.dispatch (c, std::forward<Ts> (ds)...));
61
0
    default:                    return_trace (c->default_return_value ());
62
74
    }
63
74
  }
Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Layout::GSUB_impl::SubstLookupSubTable::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*&, unsigned int*&) const
64
65
  bool intersects (const hb_set_t *glyphs, unsigned int lookup_type) const
66
0
  {
67
0
    hb_intersects_context_t c (glyphs);
68
0
    return dispatch (&c, lookup_type);
69
0
  }
70
};
71
72
73
}
74
}
75
}
76
77
#endif  /* HB_OT_LAYOUT_GSUB_SUBSTLOOKUPSUBTABLE_HH */