From fa420250c59414e432243feffb70be68654b8c27 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 11 May 2005 20:04:35 +0000 Subject: [PATCH] * include/freetype/ftimage.h (FT_Raster_RenderFunc), include/freetype/ftrender.h (FT_Glyph_TransformFunc, FT_Renderer_Render_Func, FT_Renderer_TransformFunc), src/base/ftglyph.c (ft_outline_glyph_transform), src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render), src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render), src/smooth/ftsmooth.c (ft_smooth_transform, ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd, ft_smooth_render_lcd_v): Decorate parameters with `const' where appropriate. * src/raster/ftraster.c (RASTER_RENDER_POOL): Removed. Obsolete. (ft_black_render): Decorate parameters with `const' where appropriate. * src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT -> FT_PEEK_USHORT) which caused crashes. Reported by Ismail Donmez . --- ChangeLog | 25 ++++++++++++++++++- include/freetype/ftimage.h | 4 ++-- include/freetype/ftrender.h | 24 +++++++++---------- src/base/ftglyph.c | 8 +++---- src/raster/ftraster.c | 7 ++---- src/raster/ftrend1.c | 18 +++++++------- src/sfnt/ttcmap.c | 2 +- src/smooth/ftgrays.c | 6 ++--- src/smooth/ftsmooth.c | 48 ++++++++++++++++++------------------- 9 files changed, 81 insertions(+), 61 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77ef74531..83135ba4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2005-05-11 Kirill Smelkov + + * include/freetype/ftimage.h (FT_Raster_RenderFunc), + include/freetype/ftrender.h (FT_Glyph_TransformFunc, + FT_Renderer_Render_Func, FT_Renderer_TransformFunc), + src/base/ftglyph.c (ft_outline_glyph_transform), + src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render), + src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render), + src/smooth/ftsmooth.c (ft_smooth_transform, + ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd, + ft_smooth_render_lcd_v): Decorate parameters with `const' where + appropriate. + + * src/raster/ftraster.c (RASTER_RENDER_POOL): Removed. Obsolete. + (ft_black_render): Decorate parameters with `const' where + appropriate. + +2005-05-11 Werner Lemberg + + * src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT -> + FT_PEEK_USHORT) which caused crashes. Reported by Ismail Donmez + . + 2005-05-08 Werner Lemberg * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE) @@ -6,7 +29,7 @@ 2005-05-07 Werner Lemberg Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck - Blaskey). + Blaskey ). * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'. * src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate. diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h index bff1e7ce0..0cb3b71ff 100644 --- a/include/freetype/ftimage.h +++ b/include/freetype/ftimage.h @@ -1183,8 +1183,8 @@ FT_BEGIN_HEADER /* composition). */ /* */ typedef int - (*FT_Raster_RenderFunc)( FT_Raster raster, - FT_Raster_Params* params ); + (*FT_Raster_RenderFunc)( FT_Raster raster, + const FT_Raster_Params* params ); #define FT_Raster_Render_Func FT_Raster_RenderFunc diff --git a/include/freetype/ftrender.h b/include/freetype/ftrender.h index db3ca94dd..5a01da479 100644 --- a/include/freetype/ftrender.h +++ b/include/freetype/ftrender.h @@ -4,7 +4,7 @@ /* */ /* FreeType renderer modules public interface (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -46,9 +46,9 @@ FT_BEGIN_HEADER (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); typedef void - (*FT_Glyph_TransformFunc)( FT_Glyph glyph, - FT_Matrix* matrix, - FT_Vector* delta ); + (*FT_Glyph_TransformFunc)( FT_Glyph glyph, + const FT_Matrix* matrix, + const FT_Vector* delta ); typedef void (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, @@ -85,16 +85,16 @@ FT_BEGIN_HEADER typedef FT_Error - (*FT_Renderer_RenderFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_UInt mode, - FT_Vector* origin ); + (*FT_Renderer_RenderFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_UInt mode, + const FT_Vector* origin ); typedef FT_Error - (*FT_Renderer_TransformFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_Matrix* matrix, - FT_Vector* delta ); + (*FT_Renderer_TransformFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ); typedef void diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index 1b22ab6b3..18f5a8eec 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -306,9 +306,9 @@ FT_CALLBACK_DEF( void ) - ft_outline_glyph_transform( FT_Glyph outline_glyph, - FT_Matrix* matrix, - FT_Vector* delta ) + ft_outline_glyph_transform( FT_Glyph outline_glyph, + const FT_Matrix* matrix, + const FT_Vector* delta ) { FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph; diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index b23ad27ab..c0c46a313 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -108,9 +108,6 @@ /* define DEBUG_RASTER if you want to compile a debugging version */ #define xxxDEBUG_RASTER - /* The default render pool size in bytes */ -#define RASTER_RENDER_POOL 8192 - /* undefine FT_RASTER_OPTION_ANTI_ALIASING if you do not want to support */ /* 5-levels anti-aliasing */ #ifdef FT_CONFIG_OPTION_5_GRAY_LEVELS @@ -3254,8 +3251,8 @@ static int - ft_black_render( TRaster_Instance* raster, - FT_Raster_Params* params ) + ft_black_render( TRaster_Instance* raster, + const FT_Raster_Params* params ) { FT_Outline* outline = (FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c index a17ef9b61..ed75fb605 100644 --- a/src/raster/ftrend1.c +++ b/src/raster/ftrend1.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph rasterizer interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002, 2003, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -55,10 +55,10 @@ /* transform a given glyph image */ static FT_Error - ft_raster1_transform( FT_Renderer render, - FT_GlyphSlot slot, - FT_Matrix* matrix, - FT_Vector* delta ) + ft_raster1_transform( FT_Renderer render, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ) { FT_Error error = Raster_Err_Ok; @@ -95,10 +95,10 @@ /* convert a slot's glyph image into a bitmap */ static FT_Error - ft_raster1_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - FT_Vector* origin ) + ft_raster1_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) { FT_Error error; FT_Outline* outline; diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 95f9d74f8..0f3a3241c 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -694,7 +694,7 @@ cmap->cur_delta = FT_PEEK_SHORT( p ); p += num_ranges * 2; - offset = FT_PEEK_SHORT( p ); + offset = FT_PEEK_USHORT( p ); if ( offset != 0xFFFFU ) { diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index f30c48848..6eeabb708 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -1578,7 +1578,7 @@ /* Error code. 0 means sucess. */ /* */ static - int FT_Outline_Decompose( FT_Outline* outline, + int FT_Outline_Decompose( const FT_Outline* outline, const FT_Outline_Funcs* func_interface, void* user ) { @@ -1960,8 +1960,8 @@ extern int - gray_raster_render( PRaster raster, - FT_Raster_Params* params ) + gray_raster_render( PRaster raster, + const FT_Raster_Params* params ) { FT_Outline* outline = (FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index af8783e29..54bf9e757 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ /* */ /* Anti-aliasing renderer interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -54,10 +54,10 @@ /* transform a given glyph image */ static FT_Error - ft_smooth_transform( FT_Renderer render, - FT_GlyphSlot slot, - FT_Matrix* matrix, - FT_Vector* delta ) + ft_smooth_transform( FT_Renderer render, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ) { FT_Error error = Smooth_Err_Ok; @@ -94,13 +94,13 @@ /* convert a slot's glyph image into a bitmap */ static FT_Error - ft_smooth_render_generic( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - FT_Vector* origin, - FT_Render_Mode required_mode, - FT_Int hmul, - FT_Int vmul ) + ft_smooth_render_generic( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin, + FT_Render_Mode required_mode, + FT_Int hmul, + FT_Int vmul ) { FT_Error error; FT_Outline* outline = NULL; @@ -231,10 +231,10 @@ /* convert a slot's glyph image into a bitmap */ static FT_Error - ft_smooth_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - FT_Vector* origin ) + ft_smooth_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) { if ( mode == FT_RENDER_MODE_LIGHT ) mode = FT_RENDER_MODE_NORMAL; @@ -247,10 +247,10 @@ /* convert a slot's glyph image into a horizontal LCD bitmap */ static FT_Error - ft_smooth_render_lcd( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - FT_Vector* origin ) + ft_smooth_render_lcd( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) { FT_Error error; @@ -266,10 +266,10 @@ /* convert a slot's glyph image into a vertical LCD bitmap */ static FT_Error - ft_smooth_render_lcd_v( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - FT_Vector* origin ) + ft_smooth_render_lcd_v( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) { FT_Error error;