[cff] Optimize by using `FT_MulDiv'. Suggested by Alexei. * src/cff/cf2font.c (cf2_computeDarkening): Do it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/ChangeLog b/ChangeLog
index e0777e5..122ef6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-02-12 Dave Arnold <darnold@adobe.com>
+
+ [cff] Optimize by using `FT_MulDiv'.
+ Suggested by Alexei.
+
+ * src/cff/cf2font.c (cf2_computeDarkening): Do it.
+
2014-02-12 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #41465.
diff --git a/src/cff/cf2font.c b/src/cff/cf2font.c
index 9eedf1b..6e99dc2 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 );
}
}