1
/***************************************************************************/
5
/* The FreeType position independent code services for raster module. */
7
/* Copyright 2009, 2010 by */
8
/* Oran Agra and Mickey Gabel. */
10
/* This file is part of the FreeType project, and may only be used, */
11
/* modified, and distributed under the terms of the FreeType project */
12
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13
/* this file you indicate that you have read the license and */
14
/* understand and accept it fully. */
16
/***************************************************************************/
20
#include FT_FREETYPE_H
21
#include FT_INTERNAL_OBJECTS_H
24
#ifdef FT_CONFIG_OPTION_PIC
26
/* forward declaration of PIC init functions from ftraster.c */
27
void FT_Init_Class_ft_standard_raster(FT_Raster_Funcs*);
30
ft_raster1_renderer_class_pic_free( FT_Library library )
32
FT_PIC_Container* pic_container = &library->pic_container;
33
FT_Memory memory = library->memory;
34
if ( pic_container->raster )
36
RasterPIC* container = (RasterPIC*)pic_container->raster;
37
if(--container->ref_count)
40
pic_container->raster = NULL;
46
ft_raster1_renderer_class_pic_init( FT_Library library )
48
FT_PIC_Container* pic_container = &library->pic_container;
49
FT_Error error = Raster_Err_Ok;
51
FT_Memory memory = library->memory;
54
/* since this function also serve raster5 renderer,
55
it implements reference counting */
56
if ( pic_container->raster )
58
((RasterPIC*)pic_container->raster)->ref_count++;
62
/* allocate pointer, clear and set global container pointer */
63
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
65
FT_MEM_SET( container, 0, sizeof(*container) );
66
pic_container->raster = container;
67
container->ref_count = 1;
69
/* initialize pointer table - this is how the module usually expects this data */
70
FT_Init_Class_ft_standard_raster(&container->ft_standard_raster);
73
ft_raster1_renderer_class_pic_free(library);
77
/* re-route these init and free functions to the above functions */
78
FT_Error ft_raster5_renderer_class_pic_init(FT_Library library)
80
return ft_raster1_renderer_class_pic_init(library);
82
void ft_raster5_renderer_class_pic_free(FT_Library library)
84
ft_raster1_renderer_class_pic_free(library);
87
#endif /* FT_CONFIG_OPTION_PIC */