22 #include FT_INTERNAL_OBJECTS_H 23 #include FT_INTERNAL_DEBUG_H 29 #ifdef FT_CONFIG_OPTION_PIC 30 #error "cache system does not support PIC yet" 35 #define FT_COMPONENT trace_cache 37 #define FTC_LRU_GET_MANAGER( lru ) ( (FTC_Manager)(lru)->user_data ) 77 typedef struct FTC_SizeNodeRec_
85 #define FTC_SIZE_NODE( x ) ( (FTC_SizeNode)( x ) ) 130 node->scaler = scaler[0];
132 return ftc_scaler_lookup_size( manager, scaler, &node->size );
148 node->scaler = scaler[0];
150 return ftc_scaler_lookup_size( manager, scaler, &node->size );
174 return FT_BOOL( node->scaler.face_id == face_id );
190 return FT_THROW( Invalid_Argument );
195 return FT_THROW( Invalid_Cache_Handle );
203 error = FTC_MruList_Lookup( &manager->
sizes, scaler, &mrunode );
221 typedef struct FTC_FaceNodeRec_
229 #define FTC_FACE_NODE( x ) ( ( FTC_FaceNode )( x ) ) 243 node->face_id = face_id;
252 if ( node->face->size )
271 ftc_size_node_compare_faceid,
277 node->face_id =
NULL;
289 return FT_BOOL( node->face_id == face_id );
317 return FT_THROW( Invalid_Argument );
322 return FT_THROW( Invalid_Cache_Handle );
331 error = FTC_MruList_Lookup( &manager->
faces, face_id, &mrunode );
367 return FT_THROW( Invalid_Library_Handle );
374 if ( max_faces == 0 )
377 if ( max_sizes == 0 )
380 if ( max_bytes == 0 )
391 &ftc_face_list_class,
397 &ftc_size_list_class,
418 if ( !manager || !manager->
library )
463 #ifdef FT_DEBUG_ERROR 487 FT_TRACE0((
"FTC_Manager_Check: invalid node (cache index = %ld\n",
494 }
while ( node != first );
497 FT_TRACE0((
"FTC_Manager_Check: invalid weight %ld instead of %ld\n",
513 }
while ( node != first );
517 " invalid cache node count %d instead of %d\n",
542 #ifdef FT_DEBUG_ERROR 543 FTC_Manager_Check( manager );
545 FT_TRACE0((
"compressing, weight = %ld, max = %ld, nodes = %d\n",
582 if ( manager && clazz && acache )
590 FT_ERROR((
"FTC_Manager_RegisterCache:" 591 " too many registered caches\n" ));
595 if ( !
FT_ALLOC( cache, clazz->cache_size ) )
599 cache->
clazz = clazz[0];
606 error = clazz->cache_init( cache );
609 clazz->cache_done( cache );
676 for ( nn = 0; nn < manager->
num_caches; nn++ )
692 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 715 scaler.
face_id = font->face_id;
716 scaler.
width = font->pix_width;
717 scaler.
height = font->pix_height;
#define FT_ALLOC(ptr, size)
struct FTC_ScalerRec_ * FTC_Scaler
FTC_Manager_Compress(FTC_Manager manager)
FTC_Manager_FlushN(FTC_Manager manager, FT_UInt count)
FTC_Manager_LookupSize(FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize)
return FT_THROW(Missing_Property)
#define FTC_NODE__NEXT(x)
typedefFT_BEGIN_HEADER struct FTC_MruNodeRec_ * FTC_MruNode
#define FTC_MAX_SIZES_DEFAULT
#define FTC_MAX_FACES_DEFAULT
FT_BEGIN_HEADER typedef FT_Pointer FTC_FaceID
FTC_Cache_DoneFunc cache_done
FT_BEGIN_HEADER typedef unsigned char FT_Bool
FT_Set_Pixel_Sizes(FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height)
FTC_MruList_Init(FTC_MruList list, FTC_MruListClass clazz, FT_UInt max_nodes, FT_Pointer data, FT_Memory memory)
GLenum GLuint GLint GLenum face
FTC_Manager_LookupFace(FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface)
#define FTC_MAX_BYTES_DEFAULT
#define FT_ERROR(varformat)
FTC_MruList_RemoveSelection(FTC_MruList list, FTC_MruNode_CompareFunc selection, FT_Pointer key)
#define FTC_SCALER_COMPARE(a, b)
FT_Error(* FTC_Face_Requester)(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface)
ftc_face_node_compare(FTC_MruNode ftcnode, FT_Pointer ftcface_id)
#define FTC_MRULIST_LOOKUP_CMP(list, key, compare, node, error)
struct FTC_SizeNodeRec_ * FTC_SizeNode
FTC_Manager_RegisterCache(FTC_Manager manager, FTC_CacheClass clazz, FTC_Cache *acache)
FT_Set_Char_Size(FT_Face face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution)
FTC_Manager_Done(FTC_Manager manager)
FTC_Node_WeightFunc node_weight
GLsizei GLsizei GLenum GLenum const GLvoid * data
struct FTC_ManagerRec_ * FTC_Manager
FTC_MruList_Done(FTC_MruList list)
FT_CALLBACK_TABLE_DEF const FTC_MruListClassRec ftc_face_list_class
FT_Activate_Size(FT_Size size)
FTC_Manager_RemoveFaceID(FTC_Manager manager, FTC_FaceID face_id)
FT_Done_Size(FT_Size size)
FTC_Face_Requester request_face
#define FT_CALLBACK_DEF(x)
ftc_node_destroy(FTC_Node node, FTC_Manager manager)
FTC_Cache caches[FTC_MAX_CACHES]
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
ftc_face_node_init(FTC_MruNode ftcnode, FT_Pointer ftcface_id, FT_Pointer ftcmanager)
ftc_size_node_reset(FTC_MruNode ftcnode, FT_Pointer ftcscaler, FT_Pointer ftcmanager)
struct FTC_SizeNodeRec_ FTC_SizeNodeRec
FTC_Cache_RemoveFaceID(FTC_Cache cache, FTC_FaceID face_id)
ftc_size_node_done(FTC_MruNode ftcnode, FT_Pointer data)
#define FT_CALLBACK_TABLE_DEF
FTC_Manager_Reset(FTC_Manager manager)
ftc_size_node_compare(FTC_MruNode ftcnode, FT_Pointer ftcscaler)
#define FTC_NODE__PREV(x)
GLuint GLuint GLsizei count
ftc_face_node_done(FTC_MruNode ftcnode, FT_Pointer ftcmanager)
FTC_Manager_New(FT_Library library, FT_UInt max_faces, FT_UInt max_sizes, FT_ULong max_bytes, FTC_Face_Requester requester, FT_Pointer req_data, FTC_Manager *amanager)
FT_Done_Face(FT_Face face)
struct FTC_FaceNodeRec_ FTC_FaceNodeRec
FT_TRACE0(("cff_property_set: missing property `%s'\, property_name))
FT_CALLBACK_TABLE_DEF const FTC_MruListClassRec ftc_size_list_class
ftc_size_node_init(FTC_MruNode ftcnode, FT_Pointer ftcscaler, FT_Pointer ftcmanager)
GLuint GLuint GLfloat weight
struct FTC_FaceNodeRec_ * FTC_FaceNode
FTC_MruList_Reset(FTC_MruList list)
FT_BEGIN_HEADER FT_New_Size(FT_Face face, FT_Size *size)
FTC_Node_Unref(FTC_Node node, FTC_Manager manager)