shithub: freetype+ttf2subf

Download patch

ref: 89a94d4212503cff39448bd5329f1efc38c999be
parent: 85ee27ae9328aab5e8786a21ff4a2c3b2597bfc3
author: Dave Arnold <[email protected]>
date: Wed Feb 12 18:45:47 EST 2014

[cff] Optimize by using `FT_MulDiv'.
Suggested by Alexei.

* src/cff/cf2font.c (cf2_computeDarkening): Do it.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-02-12  Dave Arnold  <[email protected]>
+
+	[cff] Optimize by using `FT_MulDiv'.
+	Suggested by Alexei.
+
+	* src/cff/cf2font.c (cf2_computeDarkening): Do it.
+
 2014-02-12  Werner Lemberg  <[email protected]>
 
 	Fix Savannah bug #41465.
--- 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 );
         }
       }