diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2010-04-29 14:31:56 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2010-04-29 14:31:56 -0400 |
commit | a8d960bd26883ee937b04ca2a3c16a3644870356 (patch) | |
tree | 34d9ac168c6c2d63fdf60d5ec41e47b3398afb6e | |
parent | 2cd1ea4411d0808559a942ff3fa4e637f9c9a9c8 (diff) |
[GPOS] Speedup apply_value()
-rw-r--r-- | src/hb-ot-layout-gpos-private.hh | 7 |
1 files changed, 6 insertions, 1 deletions
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<Device>*)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; } |