From ba03310b5aa6a8b752f892c32f2354aff9a73f78 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Wed, 31 Oct 2018 22:01:36 -0400 Subject: * src/type1/t1load.c (t1_set_mm_blend): Optimized. --- ChangeLog | 4 ++++ src/type1/t1load.c | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6379771a7..2b75088ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-10-31 Alexei Podtelezhnikov + + * src/type1/t1load.c (t1_set_mm_blend): Optimized. + 2018-10-31 Alexei Podtelezhnikov * src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized. diff --git a/src/type1/t1load.c b/src/type1/t1load.c index e358c3255..01befa2d4 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -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 ); } -- cgit v1.2.1