Merge branch 'master' into iter
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 30 Jan 2019 23:07:09 +0000 (15:07 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 30 Jan 2019 23:07:09 +0000 (15:07 -0800)
1  2 
configure.ac
src/hb-ot-layout-common.hh
src/hb-ot-layout-gsub-table.hh

diff --cc configure.ac
Simple merge
@@@ -1233,9 -1222,9 +1233,9 @@@ struct ClassDefFormat
    bool subset (hb_subset_context_t *c) const
    {
      TRACE_SUBSET (this);
-     const hb_set_t &glyphset = *c->plan->glyphset;
+     const hb_set_t &glyphset = *c->plan->glyphset ();
      const hb_map_t &glyph_map = *c->plan->glyph_map;
 -    hb_vector_t<GlyphID> glyphs;
 +    hb_sorted_vector_t<GlyphID> glyphs;
      hb_vector_t<HBUINT16> klasses;
  
      hb_codepoint_t start = startGlyph;
@@@ -95,16 -105,16 +95,16 @@@ struct SingleSubstFormat
    bool subset (hb_subset_context_t *c) const
    {
      TRACE_SUBSET (this);
-     const hb_set_t &glyphset = *c->plan->glyphset;
+     const hb_set_t &glyphset = *c->plan->glyphset ();
      const hb_map_t &glyph_map = *c->plan->glyph_map;
 -    hb_vector_t<GlyphID> from;
 +    hb_sorted_vector_t<GlyphID> from;
      hb_vector_t<GlyphID> to;
      hb_codepoint_t delta = deltaGlyphID;
 -    for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
 +    for (auto it = hb_iter (this+coverage)
 +               | hb_filter (glyphset); it; ++it)
      {
 -      if (!glyphset.has (iter.get_glyph ())) continue;
 -      from.push ()->set (glyph_map[iter.get_glyph ()]);
 -      to.push ()->set (glyph_map[(iter.get_glyph () + delta) & 0xFFFF]);
 +      from.push ()->set (glyph_map[*it]);
 +      to.push ()->set (glyph_map[(*it + delta) & 0xFFFF]);
      }
      c->serializer->propagate_error (from, to);
      SingleSubst_serialize (c->serializer, from, to);
@@@ -184,15 -202,15 +184,15 @@@ struct SingleSubstFormat
    bool subset (hb_subset_context_t *c) const
    {
      TRACE_SUBSET (this);
-     const hb_set_t &glyphset = *c->plan->glyphset;
+     const hb_set_t &glyphset = *c->plan->glyphset ();
      const hb_map_t &glyph_map = *c->plan->glyph_map;
 -    hb_vector_t<GlyphID> from;
 +    hb_sorted_vector_t<GlyphID> from;
      hb_vector_t<GlyphID> to;
 -    for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
 +    for (auto it = hb_zip (this+coverage, substitute)
 +               | hb_filter (glyphset, hb_first); it; ++it)
      {
 -      if (!glyphset.has (iter.get_glyph ())) continue;
 -      from.push ()->set (glyph_map[iter.get_glyph ()]);
 -      to.push ()->set (glyph_map[substitute[iter.get_coverage ()]]);
 +      from.push ()->set (glyph_map[it->first]);
 +      to.push ()->set (glyph_map[it->second]);
      }
      c->serializer->propagate_error (from, to);
      SingleSubst_serialize (c->serializer, from, to);