From 89a94d4212503cff39448bd5329f1efc38c999be Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Wed, 12 Feb 2014 23:45:47 +0100 Subject: [PATCH] [cff] Optimize by using `FT_MulDiv'. Suggested by Alexei. * src/cff/cf2font.c (cf2_computeDarkening): Do it. --- ChangeLog | 7 +++++++ src/cff/cf2font.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0777e592..122ef6f46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-02-12 Dave Arnold + + [cff] Optimize by using `FT_MulDiv'. + Suggested by Alexei. + + * src/cff/cf2font.c (cf2_computeDarkening): Do it. + 2014-02-12 Werner Lemberg Fix Savannah bug #41465. diff --git a/src/cff/cf2font.c b/src/cff/cf2font.c index 9eedf1be5..6e99dc2f0 100644 --- a/src/cff/cf2font.c +++ b/src/cff/cf2font.c @@ -167,7 +167,7 @@ if ( !xdelta ) goto Try_x3; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y1 ), ppem ); } @@ -184,7 +184,7 @@ if ( !xdelta ) goto Try_x4; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y2 ), ppem ); } } @@ -202,7 +202,7 @@ if ( !xdelta ) goto Use_y4; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y3 ), ppem ); } }