shithub: freetype+ttf2subf

Download patch

ref: ec46b28df763ef3e5cc88c9b22c7cdd7ab5faa8f
parent: caf72cd6e5765aa5419f2f3e8e42610181dc82e8
author: David Turner <[email protected]>
date: Wed Apr 25 18:56:30 EDT 2001

* src/base/ftcalc.c (FT_SqrtFixed): corrected/optimised the 32-bit
	fixed-point square root. it is now used even with 64-bits
	ints, as it's simply _much_ faster than calling FT_Sqrt64 :-)

    * src/base/ftbbox.c : removed invalid "#include FT_BEZIER_H" line

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-04-26  David Turner  <[email protected]>
+
+	* src/base/ftcalc.c (FT_SqrtFixed): corrected/optimised the 32-bit
+	fixed-point square root. it is now used even with 64-bits
+	ints, as it's simply _much_ faster than calling FT_Sqrt64 :-)
+
+    * src/base/ftbbox.c : removed invalid "#include FT_BEZIER_H" line
+
 2001-04-25  David Turner  <[email protected]>
 
         * src/base/ftbbox.c (BBox_Cubic_Check): rewrote function to use
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -154,7 +154,7 @@
   /*         file "ftconfig.h" either statically, or through Autoconf      */
   /*         on platforms that support it.                                 */
   /*                                                                       */
-#define FT_CONFIG_OPTION_FORCE_INT64
+#undef  FT_CONFIG_OPTION_FORCE_INT64
 
 
   /*************************************************************************/
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -28,7 +28,6 @@
 #include FT_BBOX_H
 #include FT_IMAGE_H
 #include FT_OUTLINE_H
-#include FT_BEZIER_H
 
 
   typedef struct  TBBox_Rec_
@@ -37,8 +36,8 @@
     FT_BBox    bbox;
 
   } TBBox_Rec;
+                          
 
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -293,8 +292,8 @@
     FT_Pos   y;
     FT_Fixed uu;
     
-    /* the polynom is "a*x^3 + 3b*x^2 + 3c*x + d", however, we also      */
-    /* have dP/dx(u) = 0, which implies that P(t0) = b*t0^2 + 2c*t0 + d  */
+    /* the polynom is "a*x^3 + 3b*x^2 + 3c*x + d", however, we also   */
+    /* have dP/dx(u) = 0, which implies that P(u) = b*u^2 + 2c*u + d  */
     if ( u > 0 && u < 0x10000L )
     {
       uu = FT_MulFix( u, u );
@@ -369,7 +368,6 @@
         
         if ( t1 > 0xFFFFFFL )
         {
-          /* on 64-bit machines .. */
           do
           {
             shift--;
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -189,6 +189,7 @@
 
 #ifdef FT_CONFIG_OPTION_OLD_CALCS
 
+#if 0
   /* a helper function for FT_Sqrt64() */
 
   static
@@ -237,6 +238,7 @@
     z = (FT_Int64)(x) << 16;
     return FT_Sqrt64( z );
   }
+#endif
 
 #endif /* FT_CONFIG_OPTION_OLD_CALCS */
 
@@ -554,6 +556,10 @@
 #endif /* FT_CONFIG_OPTION_OLD_CALCS */
 
 
+
+#endif /* FT_LONG64 */
+
+
  /* a not-so-fast but working 16.16 fixed point square root function */
   FT_EXPORT_DEF( FT_Int32 )  FT_SqrtFixed( FT_Int32  x )
   {
@@ -566,8 +572,8 @@
     {
       rem_hi = 0;
       rem_lo = x;
-      count  = 32;
-      do
+      count  = 24;
+	  do
       {
         rem_hi   = (rem_hi << 2) | (rem_lo >> 30);
         rem_lo <<= 2;
@@ -578,14 +584,12 @@
           rem_hi -= test_div;
           root   += 1;
         }
-        count--;
       }
+	  while (--count);
     }
 
     return (FT_Int32)root;
   }
-
-#endif /* FT_LONG64 */
 
 
 /* END */