* src/type1/t1load.c (t1_set_mm_blend): Optimized.

This commit is contained in:
Alexei Podtelezhnikov 2018-10-31 22:01:36 -04:00
parent 300da33d61
commit ba03310b5a
2 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2018-10-31 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/type1/t1load.c (t1_set_mm_blend): Optimized.
2018-10-31 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized.

View File

@ -384,24 +384,31 @@
for ( n = 0; n < blend->num_designs; n++ )
{
FT_Fixed result = 0x10000L; /* 1.0 fixed */
FT_Fixed factor;
for ( m = 0; m < blend->num_axis; m++ )
{
FT_Fixed factor;
/* get current blend axis position; */
/* use a default value if we don't have a coordinate */
factor = m < num_coords ? coords[m] : 0x8000;
if ( factor < 0 )
factor = 0;
if ( factor > 0x10000L )
factor = 0x10000L;
if ( m >= num_coords )
{
result >>= 1;
continue;
}
/* get current blend axis position */
factor = coords[m];
if ( ( n & ( 1 << m ) ) == 0 )
factor = 0x10000L - factor;
if ( factor <= 0 )
{
result = 0;
break;
}
else if ( factor >= 0x10000L )
continue;
result = FT_MulFix( result, factor );
}