freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] ttinterp.c optimization


From: Alexei Podtelezhnikov
Subject: [ft-devel] ttinterp.c optimization
Date: Sat, 23 Aug 2014 22:01:08 -0400

I want to move CURRENT_Ppem outside of the point loops. It seems to
work fine. Anything wrong with that?

diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 9491533..082114a 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -7490,7 +7490,7 @@
     FT_ULong   k, nump;
     FT_UShort  A;
     FT_ULong   C;
-    FT_Long    B;
+    FT_Long    B, P;
 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
     FT_UShort  B1, B2;

@@ -7525,6 +7525,7 @@

     nump = (FT_ULong)args[0];   /* some points theoretically may occur more
                                    than once, thus UShort isn't enough */
+    P = CURRENT_Ppem();

     for ( k = 1; k <= nump; k++ )
     {
@@ -7567,7 +7568,7 @@

         C += CUR.GS.delta_base;

-        if ( CURRENT_Ppem() == (FT_Long)C )
+        if ( P == (FT_Long)C )
         {
           B = ( (FT_ULong)B & 0xF ) - 8;
           if ( B >= 0 )
@@ -7668,7 +7669,7 @@
   {
     FT_ULong  nump, k;
     FT_ULong  A, C;
-    FT_Long   B;
+    FT_Long   B, P;


 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
@@ -7692,6 +7693,7 @@
 #endif

     nump = (FT_ULong)args[0];
+    P    = CURRENT_Ppem();

     for ( k = 1; k <= nump; k++ )
     {
@@ -7736,7 +7738,7 @@

         C += CUR.GS.delta_base;

-        if ( CURRENT_Ppem() == (FT_Long)C )
+        if ( P == (FT_Long)C )
         {
           B = ( (FT_ULong)B & 0xF ) - 8;
           if ( B >= 0 )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]