From 47ed6413ce8f2586b8d542dc46055e075a47022e Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 6 Aug 2010 10:14:25 +0000 Subject: Updated to freetype 2.4.1 --- freetype/src/raster/ftmisc.h | 16 ++++++++++++++-- freetype/src/raster/ftraster.c | 17 ++++++++--------- freetype/src/raster/rastpic.c | 13 +++++++------ 3 files changed, 29 insertions(+), 17 deletions(-) (limited to 'freetype/src/raster') diff --git a/freetype/src/raster/ftmisc.h b/freetype/src/raster/ftmisc.h index f04b5404b..7773924fe 100644 --- a/freetype/src/raster/ftmisc.h +++ b/freetype/src/raster/ftmisc.h @@ -5,7 +5,7 @@ /* Miscellaneous macros for stand-alone rasterizer (specification */ /* only). */ /* */ -/* Copyright 2005, 2009 by */ +/* Copyright 2005, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -27,6 +27,7 @@ #ifndef __FTMISC_H__ #define __FTMISC_H__ + /* memset */ #include FT_CONFIG_STANDARD_LIBRARY_H @@ -35,6 +36,7 @@ #define FT_LOCAL_DEF( x ) static x + /* from include/freetype2/fttypes.h */ typedef unsigned char FT_Byte; @@ -77,12 +79,22 @@ } FT_MemoryRec; + /* from src/ftcalc.c */ -#include +#if ( defined _WIN32 || defined _WIN64 ) + + typedef __int64 FT_Int64; + +#else + +#include "inttypes.h" typedef int64_t FT_Int64; +#endif + + static FT_Long FT_MulDiv( FT_Long a, FT_Long b, diff --git a/freetype/src/raster/ftraster.c b/freetype/src/raster/ftraster.c index 23ad59265..ff3e12c7b 100644 --- a/freetype/src/raster/ftraster.c +++ b/freetype/src/raster/ftraster.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph rasterizer (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1122,13 +1122,13 @@ if ( Dx > 0 ) { - Ix = ( ras.precision * Dx ) / Dy; + Ix = SMulDiv( ras.precision, Dx, Dy); Rx = ( ras.precision * Dx ) % Dy; Dx = 1; } else { - Ix = -( ( ras.precision * -Dx ) / Dy ); + Ix = SMulDiv( ras.precision, -Dx, Dy) * -1; Rx = ( ras.precision * -Dx ) % Dy; Dx = -1; } @@ -3400,7 +3400,7 @@ } -#else /* _STANDALONE_ */ +#else /* !_STANDALONE_ */ static int @@ -3408,7 +3408,7 @@ PRaster *araster ) { FT_Error error; - PRaster raster; + PRaster raster = NULL; *araster = 0; @@ -3432,7 +3432,7 @@ } -#endif /* _STANDALONE_ */ +#endif /* !_STANDALONE_ */ static void @@ -3447,9 +3447,8 @@ PWorker worker = (PWorker)pool_base; - raster->buffer = pool_base + ( (sizeof ( *worker ) + 7 ) & ~7 ); - raster->buffer_size = ( ( pool_base + pool_size ) - - (char*)raster->buffer ) / sizeof ( Long ); + raster->buffer = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 ); + raster->buffer_size = pool_base + pool_size - (char*)raster->buffer; raster->worker = worker; } else diff --git a/freetype/src/raster/rastpic.c b/freetype/src/raster/rastpic.c index 3c264877b..e31c54976 100644 --- a/freetype/src/raster/rastpic.c +++ b/freetype/src/raster/rastpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for raster module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,16 +43,17 @@ FT_Error - ft_raster1_renderer_class_pic_init( FT_Library library ) + ft_raster1_renderer_class_pic_init( FT_Library library ) { FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - RasterPIC* container; - FT_Memory memory = library->memory; + FT_Error error = Raster_Err_Ok; + RasterPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve raster5 renderer, it implements reference counting */ - if(pic_container->raster) + if ( pic_container->raster ) { ((RasterPIC*)pic_container->raster)->ref_count++; return error; -- cgit v1.2.3