00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <ft2build.h>
00020 #include FT_FREETYPE_H
00021 #include FT_INTERNAL_OBJECTS_H
00022 #include "ftspic.h"
00023
00024 #ifdef FT_CONFIG_OPTION_PIC
00025
00026
00027 void FT_Init_Class_ft_grays_raster(FT_Raster_Funcs*);
00028
00029 void
00030 ft_smooth_renderer_class_pic_free( FT_Library library )
00031 {
00032 FT_PIC_Container* pic_container = &library->pic_container;
00033 FT_Memory memory = library->memory;
00034 if ( pic_container->smooth )
00035 {
00036 SmoothPIC* container = (SmoothPIC*)pic_container->smooth;
00037 if(--container->ref_count)
00038 return;
00039 FT_FREE( container );
00040 pic_container->smooth = NULL;
00041 }
00042 }
00043
00044
00045 FT_Error
00046 ft_smooth_renderer_class_pic_init( FT_Library library )
00047 {
00048 FT_PIC_Container* pic_container = &library->pic_container;
00049 FT_Error error = FT_Err_Ok;
00050 SmoothPIC* container;
00051 FT_Memory memory = library->memory;
00052
00053
00054
00055 if(pic_container->smooth)
00056 {
00057 ((SmoothPIC*)pic_container->smooth)->ref_count++;
00058 return error;
00059 }
00060
00061
00062 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00063 return error;
00064 FT_MEM_SET( container, 0, sizeof(*container) );
00065 pic_container->smooth = container;
00066 container->ref_count = 1;
00067
00068
00069 FT_Init_Class_ft_grays_raster(&container->ft_grays_raster);
00070
00071 if(error)
00072 ft_smooth_renderer_class_pic_free(library);
00073 return error;
00074 }
00075
00076
00077 FT_Error ft_smooth_lcd_renderer_class_pic_init(FT_Library library)
00078 {
00079 return ft_smooth_renderer_class_pic_init(library);
00080 }
00081 void ft_smooth_lcd_renderer_class_pic_free(FT_Library library)
00082 {
00083 ft_smooth_renderer_class_pic_free(library);
00084 }
00085 FT_Error ft_smooth_lcdv_renderer_class_pic_init(FT_Library library)
00086 {
00087 return ft_smooth_renderer_class_pic_init(library);
00088 }
00089 void ft_smooth_lcdv_renderer_class_pic_free(FT_Library library)
00090 {
00091 ft_smooth_renderer_class_pic_free(library);
00092 }
00093
00094 #endif
00095
00096
00097