mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 08:51:07 +01:00
[gvar] Optimize unpack_deltas
This commit is contained in:
1 parent
bca569ae53
commit
6d7206b68b
1 file changed
+9
-5
@@ -342,20 +342,24 @@ struct GlyphVariationData
|
||||
unsigned int j;
|
||||
if (control & DELTAS_ARE_ZERO)
|
||||
for (j = 0; j < run_count && i < count; j++, i++)
|
||||
deltas[i] = 0;
|
||||
deltas.arrayZ[i] = 0;
|
||||
else if (control & DELTAS_ARE_WORDS)
|
||||
{
|
||||
if (unlikely (p + run_count * HBUINT16::static_size > end)) return false;
|
||||
for (j = 0; j < run_count && i < count; j++, i++)
|
||||
{
|
||||
if (unlikely (p + HBUINT16::static_size > end)) return false;
|
||||
deltas[i] = *(const HBINT16 *) p;
|
||||
deltas.arrayZ[i] = * (const HBINT16 *) p;
|
||||
p += HBUINT16::static_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unlikely (p + run_count > end)) return false;
|
||||
for (j = 0; j < run_count && i < count; j++, i++)
|
||||
{
|
||||
if (unlikely (p + 1 > end)) return false;
|
||||
deltas[i] = *(const HBINT8 *) p++;
|
||||
deltas.arrayZ[i] = * (const HBINT8 *) p++;
|
||||
}
|
||||
}
|
||||
if (j < run_count)
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user