From 360fe27b55c93c9c6c86895dbbf5db3efc66cc43 Mon Sep 17 00:00:00 2001 From: Mike DePaulo Date: Sat, 28 Feb 2015 07:31:25 -0500 Subject: Updated to freetype 2.5.5 Conflicts: freetype/src/base/ftbdf.c freetype/src/base/fttype1.c freetype/src/pfr/pfrobjs.c --- freetype/include/internal/ftobjs.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'freetype/include/internal/ftobjs.h') diff --git a/freetype/include/internal/ftobjs.h b/freetype/include/internal/ftobjs.h index 92d2cb1cc..af5faf4a3 100644 --- a/freetype/include/internal/ftobjs.h +++ b/freetype/include/internal/ftobjs.h @@ -72,6 +72,16 @@ FT_BEGIN_HEADER #define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) ) + /* + * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min' + * algorithm. We use alpha = 1, beta = 3/8, giving us results with a + * largest error less than 7% compared to the exact value. + */ +#define FT_HYPOT( x, y ) \ + ( x = FT_ABS( x ), \ + y = FT_ABS( y ), \ + x > y ? x + ( 3 * y >> 3 ) \ + : y + ( 3 * x >> 3 ) ) #define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) ) #define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n ) @@ -82,14 +92,6 @@ FT_BEGIN_HEADER #define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 ) - /* - * Return the highest power of 2 that is <= value; this correspond to - * the highest bit in a given 32-bit value. - */ - FT_BASE( FT_UInt32 ) - ft_highpow2( FT_UInt32 value ); - - /* * character classification functions -- since these are used to parse * font files, we must not use those in which are -- cgit v1.2.3