From: Behdad Esfahbod Date: Thu, 29 Apr 2010 18:31:56 +0000 (-0400) Subject: [GPOS] Speedup apply_value() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8d960bd26883ee937b04ca2a3c16a3644870356;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [GPOS] Speedup apply_value() --- diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index c139692..fb9ec9f 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -106,8 +106,13 @@ struct ValueFormat : USHORT if (format & xAdvance) glyph_pos->x_advance += _hb_16dot16_mul_round (x_scale, *(SHORT*)values++); if (format & yAdvance) glyph_pos->y_advance += _hb_16dot16_mul_round (y_scale, *(SHORT*)values++); + if (!has_device ()) return; + x_ppem = layout_context->font->x_ppem; y_ppem = layout_context->font->y_ppem; + + if (!x_ppem && !y_ppem) return; + /* pixel -> fractional pixel */ if (format & xPlaDevice) { if (x_ppem) glyph_pos->x_offset += (base+*(OffsetTo*)values++).get_delta (x_ppem) << 16; else values++; @@ -142,7 +147,7 @@ struct ValueFormat : USHORT public: - inline bool has_device () { + inline bool has_device () const { unsigned int format = *this; return (format & devices) != 0; }