Coverage Report

Created: 2025-12-14 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/harfbuzz/src/OT/glyf/composite-iter.hh
Line
Count
Source
1
#ifndef OT_GLYF_COMPOSITE_ITER_HH
2
#define OT_GLYF_COMPOSITE_ITER_HH
3
4
5
#include "../../hb.hh"
6
7
8
namespace OT {
9
namespace glyf_impl {
10
11
12
template <typename CompositeGlyphRecord>
13
struct composite_iter_tmpl : hb_iter_with_fallback_t<composite_iter_tmpl<CompositeGlyphRecord>,
14
                 const CompositeGlyphRecord &>
15
{
16
  typedef const CompositeGlyphRecord *__item_t__;
17
  composite_iter_tmpl (hb_bytes_t glyph_, __item_t__ current_) :
18
702k
      glyph (glyph_), current (nullptr), current_size (0)
19
702k
  {
20
702k
    set_current (current_);
21
702k
  }
22
23
25.2M
  composite_iter_tmpl () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {}
24
25
6.37M
  const CompositeGlyphRecord & __item__ () const { return *current; }
26
1.06M
  bool __more__ () const { return current; }
27
  void __next__ ()
28
6.32M
  {
29
6.32M
    if (!current->has_more ()) { current = nullptr; return; }
30
31
5.69M
    set_current (&StructAtOffset<CompositeGlyphRecord> (current, current_size));
32
5.69M
  }
33
12.9M
  composite_iter_tmpl __end__ () const { return composite_iter_tmpl (); }
34
  bool operator != (const composite_iter_tmpl& o) const
35
18.4M
  { return current != o.current; }
36
37
38
  void set_current (__item_t__ current_)
39
6.39M
  {
40
6.39M
    if (!glyph.check_range (current_, CompositeGlyphRecord::min_size))
41
28.9k
    {
42
28.9k
      current = nullptr;
43
28.9k
      current_size = 0;
44
28.9k
      return;
45
28.9k
    }
46
6.36M
    unsigned size = current_->get_size ();
47
6.36M
    if (!glyph.check_range (current_, size))
48
34.1k
    {
49
34.1k
      current = nullptr;
50
34.1k
      current_size = 0;
51
34.1k
      return;
52
34.1k
    }
53
54
6.32M
    current = current_;
55
6.32M
    current_size = size;
56
6.32M
  }
57
58
  private:
59
  hb_bytes_t glyph;
60
  __item_t__ current;
61
  unsigned current_size;
62
};
63
64
65
} /* namespace glyf_impl */
66
} /* namespace OT */
67
68
#endif /* OT_GLYF_COMPOSITE_ITER_HH */