mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 00:59:16 +01:00
[HVAC] Micro-optimize
This commit is contained in:
1 parent
44daf39962
commit
0fd3c5f7ca
1 file changed
+6
-3
@@ -49,23 +49,26 @@ struct GlyphVariationDelta
|
||||
hb_array_t<contour_point_t> points,
|
||||
const SparseVarRegionList &varRegionList) const
|
||||
{
|
||||
float scalar = varRegionList.evaluate (regionIndex, coords, coords.length);
|
||||
float scalar = varRegionList.evaluate (regionIndex, coords.arrayZ, coords.length);
|
||||
if (scalar == 0)
|
||||
return;
|
||||
|
||||
if (unlikely (points.length < deltasCount))
|
||||
return;
|
||||
|
||||
const float *x = deltasZ;
|
||||
const float *y = deltasZ + deltasCount;
|
||||
if (scalar == 1)
|
||||
for (unsigned i = 0; i < deltasCount; i++)
|
||||
{
|
||||
auto &point = points[i];
|
||||
auto &point = points.arrayZ[i];
|
||||
point.x += x[i];
|
||||
point.y += y[i];
|
||||
}
|
||||
else
|
||||
for (unsigned i = 0; i < deltasCount; i++)
|
||||
{
|
||||
auto &point = points[i];
|
||||
auto &point = points.arrayZ[i];
|
||||
point.x += x[i] * scalar;
|
||||
point.y += y[i] * scalar;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user