diff options
author | marha <marha@users.sourceforge.net> | 2010-08-06 10:14:25 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-08-06 10:14:25 +0000 |
commit | 47ed6413ce8f2586b8d542dc46055e075a47022e (patch) | |
tree | b814efb2655c444a4f63ac3cbb7d0cdf4bb3ef2f /freetype/src/smooth | |
parent | c115795736eb99a8f2288a06c231b9386f4d011f (diff) | |
download | vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.gz vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.bz2 vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.zip |
Updated to freetype 2.4.1
Diffstat (limited to 'freetype/src/smooth')
-rw-r--r-- | freetype/src/smooth/ftgrays.c | 53 | ||||
-rw-r--r-- | freetype/src/smooth/ftsmooth.c | 4 | ||||
-rw-r--r-- | freetype/src/smooth/ftspic.c | 13 |
3 files changed, 36 insertions, 34 deletions
diff --git a/freetype/src/smooth/ftgrays.c b/freetype/src/smooth/ftgrays.c index 846e454e6..0b941433e 100644 --- a/freetype/src/smooth/ftgrays.c +++ b/freetype/src/smooth/ftgrays.c @@ -4,7 +4,7 @@ /* */ /* A new `perfect' anti-aliasing renderer (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 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, */ @@ -103,10 +103,12 @@ #include <stdarg.h> #endif +#include <stddef.h> #include <string.h> #include <setjmp.h> #include <limits.h> #define FT_UINT_MAX UINT_MAX +#define FT_INT_MAX INT_MAX #define ft_memset memset @@ -114,6 +116,8 @@ #define ft_longjmp longjmp #define ft_jmp_buf jmp_buf +typedef ptrdiff_t FT_PtrDist; + #define ErrRaster_Invalid_Mode -2 #define ErrRaster_Invalid_Outline -1 @@ -1007,56 +1011,53 @@ const FT_Vector* control2, const FT_Vector* to ) { - TPos dx, dy, da, db; int top, level; int* levels; FT_Vector* arc; + int mid_x = ( DOWNSCALE( ras.x ) + to->x + + 3 * (control1->x + control2->x ) ) / 8; + int mid_y = ( DOWNSCALE( ras.y ) + to->y + + 3 * (control1->y + control2->y ) ) / 8; + TPos dx = DOWNSCALE( ras.x ) + to->x - ( mid_x << 1 ); + TPos dy = DOWNSCALE( ras.y ) + to->y - ( mid_y << 1 ); - dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 ); if ( dx < 0 ) dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 ); if ( dy < 0 ) dy = -dy; if ( dx < dy ) dx = dy; - da = dx; - - dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->x + control2->y ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - db = dx; level = 1; - da = da / ras.cubic_level; - db = db / ras.conic_level; - while ( da > 0 || db > 0 ) + dx /= ras.cubic_level; + while ( dx > 0 ) { - da >>= 2; - db >>= 3; + dx >>= 2; level++; } if ( level <= 1 ) { - TPos to_x, to_y, mid_x, mid_y; + TPos to_x, to_y; to_x = UPSCALE( to->x ); to_y = UPSCALE( to->y ); + + /* Recalculation of midpoint is needed only if */ + /* UPSCALE and DOWNSCALE have any effect. */ + +#if ( PIXEL_BITS != 6 ) mid_x = ( ras.x + to_x + 3 * UPSCALE( control1->x + control2->x ) ) / 8; mid_y = ( ras.y + to_y + 3 * UPSCALE( control1->y + control2->y ) ) / 8; +#endif gray_render_line( RAS_VAR_ mid_x, mid_y ); gray_render_line( RAS_VAR_ to_x, to_y ); + return; } @@ -1104,7 +1105,7 @@ Draw: { - TPos to_x, to_y, mid_x, mid_y; + TPos to_x, to_y; to_x = arc[0].x; @@ -1189,7 +1190,7 @@ /* first of all, compute the scanline offset */ p = (unsigned char*)map->buffer - y * map->pitch; if ( map->pitch >= 0 ) - p += ( map->rows - 1 ) * map->pitch; + p += (unsigned)( ( map->rows - 1 ) * map->pitch ); for ( ; count > 0; count--, spans++ ) { @@ -2003,14 +2004,14 @@ FT_UNUSED( raster ); } -#else /* _STANDALONE_ */ +#else /* !_STANDALONE_ */ static int gray_raster_new( FT_Memory memory, FT_Raster* araster ) { FT_Error error; - PRaster raster; + PRaster raster = NULL; *araster = 0; @@ -2033,7 +2034,7 @@ FT_FREE( raster ); } -#endif /* _STANDALONE_ */ +#endif /* !_STANDALONE_ */ static void diff --git a/freetype/src/smooth/ftsmooth.c b/freetype/src/smooth/ftsmooth.c index eed635315..7d16b94a1 100644 --- a/freetype/src/smooth/ftsmooth.c +++ b/freetype/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ /* */ /* Anti-aliasing renderer interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -200,7 +200,7 @@ /* Required check is ( pitch * height < FT_ULONG_MAX ), */ /* but we care realistic cases only. Always pitch <= width. */ - if ( width > 0xFFFFU || height > 0xFFFFU ) + if ( width > 0x7FFFU || height > 0x7FFFU ) { FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n", width, height )); diff --git a/freetype/src/smooth/ftspic.c b/freetype/src/smooth/ftspic.c index aa547fceb..7adaab17d 100644 --- a/freetype/src/smooth/ftspic.c +++ b/freetype/src/smooth/ftspic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for smooth 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,12 +43,13 @@ FT_Error - ft_smooth_renderer_class_pic_init( FT_Library library ) + ft_smooth_renderer_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - SmoothPIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = Smooth_Err_Ok; + SmoothPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve smooth_lcd and smooth_lcdv renderers, it implements reference counting */ |