ref: ba03310b5aa6a8b752f892c32f2354aff9a73f78
parent: 300da33d61512fe98dc6f34e68fbc330120600ba
author: Alexei Podtelezhnikov <[email protected]>
date: Wed Oct 31 18:01:36 EDT 2018
* src/type1/t1load.c (t1_set_mm_blend): Optimized.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2018-10-31 Alexei Podtelezhnikov <[email protected]>
+ * src/type1/t1load.c (t1_set_mm_blend): Optimized.
+
+2018-10-31 Alexei Podtelezhnikov <[email protected]>
+
* src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized.
2018-10-29 Werner Lemberg <[email protected]>
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -384,23 +384,30 @@
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 );
}