[gxvar] Inline two USHORT reads.

Speeds up GoogleSansFlex variable glyph drawing by ~13%.

  Before: 2.95ms
  After:  2.57ms

* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Do it.
This commit is contained in:
Behdad Esfahbod (بهداد اسفهبد) 2025-05-20 16:17:00 -06:00 committed by Werner Lemberg
parent 0a574d50e8
commit 14399c73c4

View file

@ -4157,8 +4157,16 @@
FT_TRACE6(( " tuple %d:\n", i ));
tupleDataSize = FT_GET_USHORT();
tupleIndex = FT_GET_USHORT();
/* Enter frame for four bytes. */
if ( stream->limit - stream->cursor < 4 )
{
FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
" invalid glyph variation array header\n" ));
error = FT_THROW( Invalid_Table );
goto Exit;
}
tupleDataSize = FT_NEXT_USHORT( stream->cursor );
tupleIndex = FT_NEXT_USHORT( stream->cursor );
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{