Coverage Report

Created: 2025-11-09 06:40

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
267
  {
38
267
    TRACE_DISPATCH (this, lookup_type);
39
267
    switch (lookup_type) {
40
0
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
23
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
0
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
154
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
38
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
52
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
0
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
0
    default:                    return_trace (c->default_return_value ());
50
267
    }
51
267
  }
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
192
  {
38
192
    TRACE_DISPATCH (this, lookup_type);
39
192
    switch (lookup_type) {
40
0
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
23
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
0
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
104
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
26
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
39
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
0
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
0
    default:                    return_trace (c->default_return_value ());
50
192
    }
51
192
  }
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
75
  {
38
75
    TRACE_DISPATCH (this, lookup_type);
39
75
    switch (lookup_type) {
40
0
    case Single:                return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...));
41
0
    case Pair:                  return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...));
42
0
    case Cursive:               return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...));
43
50
    case MarkBase:              return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...));
44
12
    case MarkLig:               return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...));
45
13
    case MarkMark:              return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...));
46
0
    case Context:               return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...));
47
0
    case ChainContext:          return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...));
48
0
    case Extension:             return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...));
49
0
    default:                    return_trace (c->default_return_value ());
50
75
    }
51
75
  }
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 */