From: Behdad Esfahbod Date: Mon, 3 Sep 2018 23:37:17 +0000 (-0700) Subject: [subset] Fix serialize_subset() calls X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49c44b58f6c2536ea5f403c54a40cab41b905150;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [subset] Fix serialize_subset() calls Ouch. --- diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 24fafd9..29afa94 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -525,7 +525,7 @@ struct OffsetListOf : OffsetArrayOf if (unlikely (!out)) return_trace (false); unsigned int count = this->len; for (unsigned int i = 0; i < count; i++) - out->arrayZ[i].serialize_subset (c, (*this)[i], this); + out->arrayZ[i].serialize_subset (c, (*this)[i], out); return_trace (true); } diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index de01bb4..343b62d 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -144,7 +144,7 @@ struct RecordListOf : RecordArrayOf if (unlikely (!out)) return_trace (false); unsigned int count = this->len; for (unsigned int i = 0; i < count; i++) - out->get_offset (i).serialize_subset (c, (*this)[i], this); + out->get_offset (i).serialize_subset (c, (*this)[i], out); return_trace (true); } @@ -283,10 +283,10 @@ struct Script TRACE_SUBSET (this); struct Script *out = c->serializer->embed (*this); if (unlikely (!out)) return_trace (false); - out->defaultLangSys.serialize_subset (c, this+defaultLangSys, this); + out->defaultLangSys.serialize_subset (c, this+defaultLangSys, out); unsigned int count = langSys.len; for (unsigned int i = 0; i < count; i++) - out->langSys.arrayZ[i].offset.serialize_subset (c, this+langSys[i].offset, this); + out->langSys.arrayZ[i].offset.serialize_subset (c, this+langSys[i].offset, out); return_trace (true); } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index d6518b9..5b913c7 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1402,14 +1402,13 @@ struct GSUB : GSUBGPOS inline bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - //struct GSUB *out = c->serializer->start_embed (); + struct GSUB *out = c->serializer->start_embed (); if (unlikely (!GSUBGPOS::subset (c))) return_trace (false); - /* TODO Replace following with c->iter_copy_and_subset()ish. */ - unsigned int count = get_lookup_count (); - //LookupList &outLookupList = out+out->lookupList; - for (unsigned int i = 0; i < count; i++) - //XXX if (unlikely (!outLookupList.arrayZ[i].subset (c, get_lookup (i), &outLookupList))) - return_trace (false); + const OffsetTo &list = CastR > (lookupList); + OffsetTo &outList = CastR > (out->lookupList); + outList.set (0); + //outList.serialize_subset (c, this+list, out); + /* TODO Use intersects() to count how many subtables survive? */ return_trace (true); } diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index e4399ae..6b163dc 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -2551,11 +2551,11 @@ struct GSUBGPOS TRACE_SUBSET (this); struct GSUBGPOS *out = c->serializer->embed (*this); if (unlikely (!out)) return_trace (false); - out->scriptList.serialize_subset (c, this+scriptList, this); - out->featureList.serialize_subset (c, this+featureList, this); + out->scriptList.serialize_subset (c, this+scriptList, out); + out->featureList.serialize_subset (c, this+featureList, out); out->lookupList.set (0); /* GSUB/GPOS fill this one in. */ if (version.to_int () >= 0x00010001u) - out->featureVars.serialize_subset (c, this+featureVars, this); + out->featureVars.serialize_subset (c, this+featureVars, out); return_trace (true); }