From: Behdad Esfahbod Date: Wed, 8 May 2019 22:46:51 +0000 (-0700) Subject: [hdmx] Touch up X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b710176ce28e863a01797987d7ce37d19aaf2fd3;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [hdmx] Touch up --- diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 560fb14..35d27f7 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh @@ -44,7 +44,8 @@ struct DeviceRecord static unsigned int get_size (unsigned count) { return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); } - template + template bool serialize (hb_serialize_context_t *c, unsigned pixelSize, Iterator it) { TRACE_SERIALIZE (this); @@ -94,7 +95,8 @@ struct hdmx return StructAtOffset (&this->firstDeviceRecord, i * sizeDeviceRecord); } - template + template bool serialize (hb_serialize_context_t *c, unsigned version, Iterator it) { TRACE_SERIALIZE (this); @@ -103,14 +105,13 @@ struct hdmx this->version = version; this->numRecords = it.len (); - this->sizeDeviceRecord = - it ? DeviceRecord::get_size ((*it).second.len ()) : DeviceRecord::get_size (0); + this->sizeDeviceRecord = DeviceRecord::get_size (it ? (*it).second.len () : 0); - using pair_t = decltype (*it); + it - | hb_apply ([&] (const pair_t& _) { + | hb_apply ([&] (const hb_item_type& _) { c->start_embed ()->serialize (c, _.first, _.second); - }); + }) + ; return_trace (c->successful); } @@ -125,21 +126,24 @@ struct hdmx auto it = + hb_iota ((unsigned) numRecords) - | hb_map ([&] (unsigned _) { + | hb_map ([&] (unsigned _) + { const DeviceRecord *device_record = &StructAtOffset (&firstDeviceRecord, _ * sizeDeviceRecord); auto row = + hb_iota (c->plan->num_output_glyphs ()) | hb_map (c->plan->reverse_glyph_map) - | hb_map ([=] (hb_codepoint_t _) { + | hb_map ([=] (hb_codepoint_t _) + { if (c->plan->is_empty_glyph (_)) return Null(HBUINT8); return device_record->widthsZ.as_array (get_num_glyphs ()) [_]; }) ; return hb_pair ((unsigned) device_record->pixelSize, +row); - }); + }) + ; hdmx_prime->serialize (c->serializer, version, it); return_trace (true);