Coverage Report

Created: 2026-02-14 06:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/harfbuzz/src/OT/Layout/GPOS/PosLookupSubTable.hh
Line
Count
Source
1
#ifndef OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH
2
#define OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH
3
4
#include "SinglePos.hh"
5
#include "PairPos.hh"
6
#include "CursivePos.hh"
7
#include "MarkBasePos.hh"
8
#include "MarkLigPos.hh"
9
#include "MarkMarkPos.hh"
10
#include "ContextPos.hh"
11
#include "ChainContextPos.hh"
12
#include "ExtensionPos.hh"
13
14
namespace OT {
15
namespace Layout {
16
namespace GPOS_impl {
17
18
struct PosLookupSubTable
19
{
20
  friend struct ::OT::Lookup;
21
  friend struct PosLookup;
22
23
  enum Type {
24
    Single              = 1,
25
    Pair                = 2,
26
    Cursive             = 3,
27
    MarkBase            = 4,
28
    MarkLig             = 5,
29
    MarkMark            = 6,
30
    Context             = 7,
31
    ChainContext        = 8,
32
    Extension           = 9
33
  };
34
35
  template <typename context_t, typename ...Ts>
36
  typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type, Ts&&... ds) const
37
666k
  {
38
666k
    TRACE_DISPATCH (this, lookup_type);
39
666k
    switch (lookup_type) {
40
15.8k
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
66.7k
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
7.23k
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
31.1k
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
15.5k
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
17.3k
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
22.8k
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
36.2k
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
52.4k
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
400k
    default:                    return_trace (c->default_return_value ());
50
666k
    }
51
666k
  }
Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int) const
Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int) const
Unexecuted instantiation: hb_subset_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<hb_subset_context_t>(hb_subset_context_t*, unsigned int) const
hb_sanitize_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*, unsigned int) const
Line
Count
Source
37
452k
  {
38
452k
    TRACE_DISPATCH (this, lookup_type);
39
452k
    switch (lookup_type) {
40
11.3k
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
38.8k
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
3.81k
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
16.9k
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
9.34k
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
9.77k
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
16.5k
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
29.7k
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
50.5k
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
265k
    default:                    return_trace (c->default_return_value ());
50
452k
    }
51
452k
  }
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*, unsigned int) const
OT::hb_accelerate_subtables_context_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*, unsigned int) const
Line
Count
Source
37
213k
  {
38
213k
    TRACE_DISPATCH (this, lookup_type);
39
213k
    switch (lookup_type) {
40
4.49k
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
27.9k
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
3.42k
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
14.1k
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
6.20k
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
7.54k
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
6.32k
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
6.51k
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
1.95k
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
134k
    default:                    return_trace (c->default_return_value ());
50
213k
    }
51
213k
  }
Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Layout::GPOS_impl::PosLookupSubTable::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*, unsigned int, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const
52
53
  bool intersects (const hb_set_t *glyphs, unsigned int lookup_type) const
54
0
  {
55
0
    hb_intersects_context_t c (glyphs);
56
0
    return dispatch (&c, lookup_type);
57
0
  }
58
59
  protected:
60
  union {
61
  SinglePos             single;
62
  PairPos               pair;
63
  CursivePos            cursive;
64
  MarkBasePos           markBase;
65
  MarkLigPos            markLig;
66
  MarkMarkPos           markMark;
67
  ContextPos            context;
68
  ChainContextPos       chainContext;
69
  ExtensionPos          extension;
70
  } u;
71
  public:
72
  DEFINE_SIZE_MIN (0);
73
};
74
75
}
76
}
77
}
78
79
#endif  /* HB_OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH */