[gvar] Optimize scalar = 1.0 case
This commit is contained in:
parent
2d098d5d7f
commit
bb3bb76450
|
@ -609,6 +609,7 @@ struct gvar
|
|||
|
||||
hb_memset (deltas.arrayZ, 0, deltas.length * sizeof (deltas.arrayZ[0]));
|
||||
|
||||
if (scalar != 1.0f)
|
||||
for (unsigned int i = 0; i < num_deltas; i++)
|
||||
{
|
||||
unsigned int pt_index = apply_to_all ? i : indices[i];
|
||||
|
@ -617,6 +618,15 @@ struct gvar
|
|||
deltas.arrayZ[pt_index].x += x_deltas.arrayZ[i] * scalar;
|
||||
deltas.arrayZ[pt_index].y += y_deltas.arrayZ[i] * scalar;
|
||||
}
|
||||
else
|
||||
for (unsigned int i = 0; i < num_deltas; i++)
|
||||
{
|
||||
unsigned int pt_index = apply_to_all ? i : indices[i];
|
||||
if (unlikely (pt_index >= deltas.length)) continue;
|
||||
deltas.arrayZ[pt_index].flag = 1; /* this point is referenced, i.e., explicit deltas specified */
|
||||
deltas.arrayZ[pt_index].x += x_deltas.arrayZ[i];
|
||||
deltas.arrayZ[pt_index].y += y_deltas.arrayZ[i];
|
||||
}
|
||||
|
||||
/* infer deltas for unreferenced points */
|
||||
unsigned start_point = 0;
|
||||
|
|
Loading…
Reference in New Issue