ReactOS 0.4.16-dev-2354-g16de117
ftcache.h File Reference
#include <freetype/ftglyph.h>
Include dependency graph for ftcache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FTC_ScalerRec_
 
struct  FTC_ImageTypeRec_
 
struct  FTC_SBitRec_
 

Macros

#define FTC_IMAGE_TYPE_COMPARE(d1, d2)
 

Typedefs

typedef FT_Error(* FTC_Face_Requester) (FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face *aface)
 
typedef struct FTC_ManagerRec_FTC_Manager
 
typedef struct FTC_NodeRec_FTC_Node
 
typedef struct FTC_ScalerRec_ FTC_ScalerRec
 
typedef struct FTC_ScalerRec_FTC_Scaler
 
typedef struct FTC_CMapCacheRec_ * FTC_CMapCache
 
typedef struct FTC_ImageTypeRec_ FTC_ImageTypeRec
 
typedef struct FTC_ImageTypeRec_FTC_ImageType
 
typedef struct FTC_ImageCacheRec_ * FTC_ImageCache
 
typedef struct FTC_SBitRec_FTC_SBit
 
typedef struct FTC_SBitRec_ FTC_SBitRec
 
typedef struct FTC_SBitCacheRec_ * FTC_SBitCache
 

Functions

 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)
 
 FTC_Manager_Reset (FTC_Manager manager)
 
 FTC_Manager_Done (FTC_Manager manager)
 
 FTC_Manager_LookupFace (FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface)
 
 FTC_Manager_LookupSize (FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize)
 
 FTC_Node_Unref (FTC_Node node, FTC_Manager manager)
 
 FTC_Manager_RemoveFaceID (FTC_Manager manager, FTC_FaceID face_id)
 
 FTC_CMapCache_New (FTC_Manager manager, FTC_CMapCache *acache)
 
 FTC_CMapCache_Lookup (FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code)
 
 FTC_ImageCache_New (FTC_Manager manager, FTC_ImageCache *acache)
 
 FTC_ImageCache_Lookup (FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode)
 
 FTC_ImageCache_LookupScaler (FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode)
 
 FTC_SBitCache_New (FTC_Manager manager, FTC_SBitCache *acache)
 
 FTC_SBitCache_Lookup (FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode)
 
 FTC_SBitCache_LookupScaler (FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode)
 

Variables

FT_BEGIN_HEADER typedef FT_Pointer FTC_FaceID
 

Macro Definition Documentation

◆ FTC_IMAGE_TYPE_COMPARE

#define FTC_IMAGE_TYPE_COMPARE (   d1,
  d2 
)
Value:
( (d1)->face_id == (d2)->face_id && \
(d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags )
GLint GLint GLsizei width
Definition: gl.h:1546
GLbitfield flags
Definition: glext.h:7161

Definition at line 697 of file ftcache.h.

Typedef Documentation

◆ FTC_CMapCache

typedef struct FTC_CMapCacheRec_* FTC_CMapCache

Definition at line 573 of file ftcache.h.

◆ FTC_Face_Requester

typedef FT_Error(* FTC_Face_Requester) (FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face *aface)

Definition at line 209 of file ftcache.h.

◆ FTC_ImageCache

typedef struct FTC_ImageCacheRec_* FTC_ImageCache

Definition at line 713 of file ftcache.h.

◆ FTC_ImageType

Definition at line 691 of file ftcache.h.

◆ FTC_ImageTypeRec

◆ FTC_Manager

Definition at line 250 of file ftcache.h.

◆ FTC_Node

Definition at line 270 of file ftcache.h.

◆ FTC_SBit

Definition at line 861 of file ftcache.h.

◆ FTC_SBitCache

typedef struct FTC_SBitCacheRec_* FTC_SBitCache

Definition at line 935 of file ftcache.h.

◆ FTC_SBitRec

◆ FTC_Scaler

Definition at line 461 of file ftcache.h.

◆ FTC_ScalerRec

Function Documentation

◆ FTC_CMapCache_Lookup()

FTC_CMapCache_Lookup ( FTC_CMapCache  cache,
FTC_FaceID  face_id,
FT_Int  cmap_index,
FT_UInt32  char_code 
)

Definition at line 230 of file ftccmap.c.

234 {
235 FTC_Cache cache = FTC_CACHE( cmap_cache );
239 FT_UInt gindex = 0;
241 FT_Int no_cmap_change = 0;
242
243
244 if ( cmap_index < 0 )
245 {
246 /* Treat a negative cmap index as a special value, meaning that you */
247 /* don't want to change the FT_Face's character map through this */
248 /* call. This can be useful if the face requester callback already */
249 /* sets the face's charmap to the appropriate value. */
250
251 no_cmap_change = 1;
252 cmap_index = 0;
253 }
254
255 if ( !cache )
256 {
257 FT_TRACE0(( "FTC_CMapCache_Lookup: bad arguments, returning 0\n" ));
258 return 0;
259 }
260
261 query.face_id = face_id;
262 query.cmap_index = (FT_UInt)cmap_index;
263 query.char_code = char_code;
264
265 hash = FTC_CMAP_HASH( face_id, (FT_UInt)cmap_index, char_code );
266
267#if 1
269 node, error );
270#else
271 error = FTC_Cache_Lookup( cache, hash, &query, &node );
272#endif
273 if ( error )
274 goto Exit;
275
276 FT_ASSERT( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first ) <
278
279 /* something rotten can happen with rogue clients */
280 if ( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first >=
282 return 0; /* XXX: should return appropriate error */
283
284 gindex = FTC_CMAP_NODE( node )->indices[char_code -
285 FTC_CMAP_NODE( node )->first];
286 if ( gindex == FTC_CMAP_UNKNOWN )
287 {
289
290
291 gindex = 0;
292
294 FTC_CMAP_NODE( node )->face_id,
295 &face );
296 if ( error )
297 goto Exit;
298
299 if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps )
300 {
301 FT_CharMap old, cmap = NULL;
302
303
304 old = face->charmap;
305 cmap = face->charmaps[cmap_index];
306
307 if ( old != cmap && !no_cmap_change )
308 FT_Set_Charmap( face, cmap );
309
310 gindex = FT_Get_Char_Index( face, char_code );
311
312 if ( old != cmap && !no_cmap_change )
313 FT_Set_Charmap( face, old );
314 }
315
316 FTC_CMAP_NODE( node )->indices[char_code -
317 FTC_CMAP_NODE( node )->first]
318 = (FT_UShort)gindex;
319 }
320
321 Exit:
322 return gindex;
323 }
#define NULL
Definition: types.h:112
WORD face[3]
Definition: mesh.c:4747
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
Definition: ftobjs.c:3731
FT_Set_Charmap(FT_Face face, FT_CharMap charmap)
Definition: ftobjs.c:3564
FTC_Manager_LookupFace(FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface)
Definition: ftcmanag.c:305
#define FTC_CACHE(x)
Definition: ftccache.h:161
#define FTC_CACHE_LOOKUP_CMP(cache, nodecmp, hash, query, node, error)
Definition: ftccache.h:210
#define FTC_CMAP_UNKNOWN
Definition: ftccmap.c:81
ftc_cmap_node_compare(FTC_Node ftcnode, FT_Pointer ftcquery, FTC_Cache cache, FT_Bool *list_changed)
Definition: ftccmap.c:149
#define FTC_CMAP_NODE(x)
Definition: ftccmap.c:77
#define FTC_CMAP_INDICES_MAX
Definition: ftccmap.c:48
#define FTC_CMAP_HASH(faceid, index, charcode)
Definition: ftccmap.c:51
#define FT_ASSERT(condition)
Definition: ftdebug.h:241
#define FT_TRACE0(varformat)
Definition: ftdebug.h:187
int FT_Error
Definition: fttypes.h:299
unsigned short FT_UShort
Definition: fttypes.h:209
unsigned int FT_UInt
Definition: fttypes.h:231
size_t FT_Offset
Definition: fttypes.h:323
signed int FT_Int
Definition: fttypes.h:220
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
const GLint * first
Definition: glext.h:5794
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330
Definition: cache.c:49
Definition: _hash_fun.h:40
Definition: dlist.c:348

◆ FTC_CMapCache_New()

FTC_CMapCache_New ( FTC_Manager  manager,
FTC_CMapCache acache 
)

Definition at line 218 of file ftccmap.c.

220 {
221 return FTC_Manager_RegisterCache( manager,
223 FTC_CACHE_P( acache ) );
224 }
#define FTC_CACHE_P(x)
Definition: ftccache.h:162
static const FTC_CacheClassRec ftc_cmap_cache_class
Definition: ftccmap.c:201
FTC_Manager_RegisterCache(FTC_Manager manager, FTC_CacheClass clazz, FTC_Cache *acache)
Definition: ftcmanag.c:575

◆ FTC_ImageCache_Lookup()

FTC_ImageCache_Lookup ( FTC_ImageCache  cache,
FTC_ImageType  type,
FT_UInt  gindex,
FT_Glyph aglyph,
FTC_Node anode 
)

Definition at line 285 of file ftcbasic.c.

290 {
292 FTC_Node node = 0; /* make compiler happy */
295
296
297 /* some argument checks are delayed to `FTC_Cache_Lookup' */
298 if ( !aglyph )
299 {
300 error = FT_THROW( Invalid_Argument );
301 goto Exit;
302 }
303
304 *aglyph = NULL;
305 if ( anode )
306 *anode = NULL;
307
308 /*
309 * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt',
310 * but public `FT_ImageType->flags' is of type `FT_Int32'.
311 *
312 * On 16bit systems, higher bits of type->flags cannot be handled.
313 */
314#if 0xFFFFFFFFUL > FT_UINT_MAX
315 if ( (type->flags & (FT_ULong)FT_UINT_MAX) )
316 FT_TRACE1(( "FTC_ImageCache_Lookup:"
317 " higher bits in load_flags 0x%x are dropped\n",
318 (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
319#endif
320
321 query.attrs.scaler.face_id = type->face_id;
322 query.attrs.scaler.width = type->width;
323 query.attrs.scaler.height = type->height;
324 query.attrs.load_flags = (FT_UInt)type->flags;
325
326 query.attrs.scaler.pixel = 1;
327 query.attrs.scaler.x_res = 0; /* make compilers happy */
328 query.attrs.scaler.y_res = 0;
329
330 hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;
331
332#if 1 /* inlining is about 50% faster! */
336 hash, gindex,
337 &query,
338 node,
339 error );
340#else
341 error = FTC_GCache_Lookup( FTC_GCACHE( cache ),
342 hash, gindex,
343 FTC_GQUERY( &query ),
344 &node );
345#endif
346 if ( !error )
347 {
348 *aglyph = FTC_INODE( node )->glyph;
349
350 if ( anode )
351 {
352 *anode = node;
353 node->ref_count++;
354 }
355 }
356
357 Exit:
358 return error;
359 }
ftc_basic_family_compare(FTC_MruNode ftcfamily, FT_Pointer ftcquery)
Definition: ftcbasic.c:68
#define FTC_BASIC_ATTR_HASH(a)
Definition: ftcbasic.c:47
FTC_GNode_Compare(FTC_GNode gnode, FTC_GQuery gquery, FTC_Cache cache, FT_Bool *list_changed)
Definition: ftcglyph.c:85
#define FTC_GCACHE(x)
Definition: ftcglyph.h:218
#define FTC_GCACHE_LOOKUP_CMP(cache, famcmp, nodecmp, hash, gindex, query, node, error)
Definition: ftcglyph.h:279
#define FTC_GQUERY(x)
Definition: ftcglyph.h:166
#define FTC_INODE(x)
Definition: ftcimage.h:53
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_TRACE1(varformat)
Definition: ftdebug.h:188
#define FT_UINT_MAX
Definition: ftstdlib.h:65
unsigned long FT_ULong
Definition: fttypes.h:253
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ FTC_ImageCache_LookupScaler()

FTC_ImageCache_LookupScaler ( FTC_ImageCache  cache,
FTC_Scaler  scaler,
FT_ULong  load_flags,
FT_UInt  gindex,
FT_Glyph aglyph,
FTC_Node anode 
)

Definition at line 365 of file ftcbasic.c.

371 {
373 FTC_Node node = 0; /* make compiler happy */
376
377
378 /* some argument checks are delayed to `FTC_Cache_Lookup' */
379 if ( !aglyph || !scaler )
380 {
381 error = FT_THROW( Invalid_Argument );
382 goto Exit;
383 }
384
385 *aglyph = NULL;
386 if ( anode )
387 *anode = NULL;
388
389 /*
390 * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt',
391 * but public `FT_Face->face_flags' is of type `FT_Long'.
392 *
393 * On long > int systems, higher bits of load_flags cannot be handled.
394 */
395#if FT_ULONG_MAX > FT_UINT_MAX
396 if ( load_flags > FT_UINT_MAX )
397 FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
398 " higher bits in load_flags 0x%lx are dropped\n",
399 load_flags & ~((FT_ULong)FT_UINT_MAX) ));
400#endif
401
402 query.attrs.scaler = scaler[0];
403 query.attrs.load_flags = (FT_UInt)load_flags;
404
405 hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;
406
410 hash, gindex,
411 &query,
412 node,
413 error );
414 if ( !error )
415 {
416 *aglyph = FTC_INODE( node )->glyph;
417
418 if ( anode )
419 {
420 *anode = node;
421 node->ref_count++;
422 }
423 }
424
425 Exit:
426 return error;
427 }

◆ FTC_ImageCache_New()

FTC_ImageCache_New ( FTC_Manager  manager,
FTC_ImageCache acache 
)

Definition at line 274 of file ftcbasic.c.

276 {
278 (FTC_GCache*)acache );
279 }
static const FTC_GCacheClassRec ftc_basic_image_cache_class
Definition: ftcbasic.c:253
FTC_GCache_New(FTC_Manager manager, FTC_GCacheClass clazz, FTC_GCache *acache)
Definition: ftcglyph.c:174

◆ FTC_Manager_Done()

FTC_Manager_Done ( FTC_Manager  manager)

Definition at line 412 of file ftcmanag.c.

413 {
415 FT_UInt idx;
416
417
418 if ( !manager || !manager->library )
419 return;
420
421 memory = manager->memory;
422
423 /* now discard all caches */
424 for (idx = manager->num_caches; idx-- > 0; )
425 {
426 FTC_Cache cache = manager->caches[idx];
427
428
429 if ( cache )
430 {
431 cache->clazz.cache_done( cache );
432 FT_FREE( cache );
433 manager->caches[idx] = NULL;
434 }
435 }
436 manager->num_caches = 0;
437
438 /* discard faces and sizes */
439 FTC_MruList_Done( &manager->sizes );
440 FTC_MruList_Done( &manager->faces );
441
442 manager->library = NULL;
443 manager->memory = NULL;
444
445 FT_FREE( manager );
446 }
unsigned int idx
Definition: utils.c:41
FTC_MruList_Done(FTC_MruList list)
Definition: ftcmru.c:194
#define FT_FREE(ptr)
Definition: ftmemory.h:337
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:64
static char memory[1024 *256]
Definition: process.c:122
FT_UInt num_caches
Definition: ftcmanag.h:101
FTC_Cache caches[FTC_MAX_CACHES]
Definition: ftcmanag.h:100
FTC_MruListRec faces
Definition: ftcmanag.h:103
FT_Memory memory
Definition: ftcmanag.h:93
FT_Library library
Definition: ftcmanag.h:92
FTC_MruListRec sizes
Definition: ftcmanag.h:104

◆ FTC_Manager_LookupFace()

FTC_Manager_LookupFace ( FTC_Manager  manager,
FTC_FaceID  face_id,
FT_Face aface 
)

Definition at line 305 of file ftcmanag.c.

308 {
310 FTC_MruNode mrunode;
311
312
313 if ( !aface )
314 return FT_THROW( Invalid_Argument );
315
316 *aface = NULL;
317
318 if ( !manager )
319 return FT_THROW( Invalid_Cache_Handle );
320
321 /* we break encapsulation for the sake of speed */
322#ifdef FTC_INLINE
323
325 mrunode, error );
326
327#else
328 error = FTC_MruList_Lookup( &manager->faces, face_id, &mrunode );
329#endif
330
331 if ( !error )
332 *aface = FTC_FACE_NODE( mrunode )->face;
333
334 return error;
335 }
#define FTC_FACE_NODE(x)
Definition: ftcmanag.c:226
ftc_face_node_compare(FTC_MruNode ftcnode, FT_Pointer ftcface_id)
Definition: ftcmanag.c:279
#define FTC_MRULIST_LOOKUP_CMP(list, key, compare, node, error)
Definition: ftcmru.h:164
typedefFT_BEGIN_HEADER struct FTC_MruNodeRec_ * FTC_MruNode
Definition: ftcmru.h:61

Referenced by ftc_basic_family_get_count(), FTC_CMapCache_Lookup(), and ftc_scaler_lookup_size().

◆ FTC_Manager_LookupSize()

FTC_Manager_LookupSize ( FTC_Manager  manager,
FTC_Scaler  scaler,
FT_Size asize 
)

Definition at line 178 of file ftcmanag.c.

181 {
183 FTC_MruNode mrunode;
184
185
186 if ( !asize || !scaler )
187 return FT_THROW( Invalid_Argument );
188
189 *asize = NULL;
190
191 if ( !manager )
192 return FT_THROW( Invalid_Cache_Handle );
193
194#ifdef FTC_INLINE
195
197 mrunode, error );
198
199#else
200 error = FTC_MruList_Lookup( &manager->sizes, scaler, &mrunode );
201#endif
202
203 if ( !error )
204 *asize = FTC_SIZE_NODE( mrunode )->size;
205
206 return error;
207 }
ftc_size_node_compare(FTC_MruNode ftcnode, FT_Pointer ftcscaler)
Definition: ftcmanag.c:99
#define FTC_SIZE_NODE(x)
Definition: ftcmanag.c:81

Referenced by ftc_basic_family_load_bitmap(), and ftc_basic_family_load_glyph().

◆ FTC_Manager_New()

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 
)

Definition at line 350 of file ftcmanag.c.

357 {
360 FTC_Manager manager = 0;
361
362
363 if ( !library )
364 return FT_THROW( Invalid_Library_Handle );
365
366 if ( !amanager || !requester )
367 return FT_THROW( Invalid_Argument );
368
370
371 if ( FT_NEW( manager ) )
372 goto Exit;
373
374 if ( max_faces == 0 )
375 max_faces = FTC_MAX_FACES_DEFAULT;
376
377 if ( max_sizes == 0 )
378 max_sizes = FTC_MAX_SIZES_DEFAULT;
379
380 if ( max_bytes == 0 )
381 max_bytes = FTC_MAX_BYTES_DEFAULT;
382
383 manager->library = library;
384 manager->memory = memory;
385 manager->max_weight = max_bytes;
386
387 manager->request_face = requester;
388 manager->request_data = req_data;
389
390 FTC_MruList_Init( &manager->faces,
392 max_faces,
393 manager,
394 memory );
395
396 FTC_MruList_Init( &manager->sizes,
398 max_sizes,
399 manager,
400 memory );
401
402 *amanager = manager;
403
404 Exit:
405 return error;
406 }
FT_Library library
Definition: cffdrivr.c:660
static const FTC_MruListClassRec ftc_size_list_class
Definition: ftcmanag.c:151
static const FTC_MruListClassRec ftc_face_list_class
Definition: ftcmanag.c:291
#define FTC_MAX_BYTES_DEFAULT
Definition: ftcmanag.h:84
#define FTC_MAX_SIZES_DEFAULT
Definition: ftcmanag.h:83
#define FTC_MAX_FACES_DEFAULT
Definition: ftcmanag.h:82
FTC_MruList_Init(FTC_MruList list, FTC_MruListClass clazz, FT_UInt max_nodes, FT_Pointer data, FT_Memory memory)
Definition: ftcmru.c:168
#define FT_NEW(ptr)
Definition: ftmemory.h:339
FT_Pointer request_data
Definition: ftcmanag.h:106
FTC_Face_Requester request_face
Definition: ftcmanag.h:107
FT_Offset max_weight
Definition: ftcmanag.h:96
FT_Memory memory
Definition: ftobjs.h:895

◆ FTC_Manager_RemoveFaceID()

FTC_Manager_RemoveFaceID ( FTC_Manager  manager,
FTC_FaceID  face_id 
)

Definition at line 665 of file ftcmanag.c.

667 {
668 FT_UInt nn;
669
670
671 if ( !manager )
672 return;
673
674 /* this will remove all FTC_SizeNode that correspond to
675 * the face_id as well
676 */
679 face_id );
680
681 for ( nn = 0; nn < manager->num_caches; nn++ )
682 FTC_Cache_RemoveFaceID( manager->caches[nn], face_id );
683 }
FTC_Cache_RemoveFaceID(FTC_Cache cache, FTC_FaceID face_id)
Definition: ftccache.c:563
FTC_MruList_RemoveSelection(FTC_MruList list, FTC_MruNode_CompareFunc selection, FT_Pointer key)
Definition: ftcmru.c:326

◆ FTC_Manager_Reset()

FTC_Manager_Reset ( FTC_Manager  manager)

Definition at line 452 of file ftcmanag.c.

453 {
454 if ( !manager )
455 return;
456
457 FTC_MruList_Reset( &manager->sizes );
458 FTC_MruList_Reset( &manager->faces );
459
460 FTC_Manager_FlushN( manager, manager->num_nodes );
461 }
FTC_Manager_FlushN(FTC_Manager manager, FT_UInt count)
Definition: ftcmanag.c:627
FTC_MruList_Reset(FTC_MruList list)
Definition: ftcmru.c:184
FT_UInt num_nodes
Definition: ftcmanag.h:98

◆ FTC_Node_Unref()

FTC_Node_Unref ( FTC_Node  node,
FTC_Manager  manager 
)

Definition at line 689 of file ftcmanag.c.

691 {
692 if ( node &&
693 manager &&
694 (FT_UInt)node->cache_index < manager->num_caches )
695 node->ref_count--;
696 }

◆ FTC_SBitCache_Lookup()

FTC_SBitCache_Lookup ( FTC_SBitCache  cache,
FTC_ImageType  type,
FT_UInt  gindex,
FTC_SBit sbit,
FTC_Node anode 
)

Definition at line 485 of file ftcbasic.c.

490 {
493 FTC_Node node = 0; /* make compiler happy */
495
496
497 if ( anode )
498 *anode = NULL;
499
500 /* other argument checks delayed to `FTC_Cache_Lookup' */
501 if ( !ansbit )
502 return FT_THROW( Invalid_Argument );
503
504 *ansbit = NULL;
505
506 /*
507 * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt',
508 * but public `FT_ImageType->flags' is of type `FT_Int32'.
509 *
510 * On 16bit systems, higher bits of type->flags cannot be handled.
511 */
512#if 0xFFFFFFFFUL > FT_UINT_MAX
513 if ( (type->flags & (FT_ULong)FT_UINT_MAX) )
514 FT_TRACE1(( "FTC_ImageCache_Lookup:"
515 " higher bits in load_flags 0x%x are dropped\n",
516 (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
517#endif
518
519 query.attrs.scaler.face_id = type->face_id;
520 query.attrs.scaler.width = type->width;
521 query.attrs.scaler.height = type->height;
522 query.attrs.load_flags = (FT_UInt)type->flags;
523
524 query.attrs.scaler.pixel = 1;
525 query.attrs.scaler.x_res = 0; /* make compilers happy */
526 query.attrs.scaler.y_res = 0;
527
528 /* beware, the hash must be the same for all glyph ranges! */
529 hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +
531
532#if 1 /* inlining is about 50% faster! */
536 hash, gindex,
537 &query,
538 node,
539 error );
540#else
541 error = FTC_GCache_Lookup( FTC_GCACHE( cache ),
542 hash,
543 gindex,
544 FTC_GQUERY( &query ),
545 &node );
546#endif
547 if ( error )
548 goto Exit;
549
550 *ansbit = FTC_SNODE( node )->sbits +
551 ( gindex - FTC_GNODE( node )->gindex );
552
553 if ( anode )
554 {
555 *anode = node;
556 node->ref_count++;
557 }
558
559 Exit:
560 return error;
561 }
#define FTC_GNODE(x)
Definition: ftcglyph.h:155
FTC_SNode_Compare(FTC_SNode snode, FTC_GQuery gquery, FTC_Cache cache, FT_Bool *list_changed)
Definition: ftcsbits.c:411
#define FTC_SNODE(x)
Definition: ftcsbits.h:40
#define FTC_SBIT_ITEMS_PER_NODE
Definition: ftcsbits.h:29

◆ FTC_SBitCache_LookupScaler()

FTC_SBitCache_LookupScaler ( FTC_SBitCache  cache,
FTC_Scaler  scaler,
FT_ULong  load_flags,
FT_UInt  gindex,
FTC_SBit sbit,
FTC_Node anode 
)

Definition at line 567 of file ftcbasic.c.

573 {
576 FTC_Node node = 0; /* make compiler happy */
578
579
580 if ( anode )
581 *anode = NULL;
582
583 /* other argument checks delayed to `FTC_Cache_Lookup' */
584 if ( !ansbit || !scaler )
585 return FT_THROW( Invalid_Argument );
586
587 *ansbit = NULL;
588
589 /*
590 * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt',
591 * but public `FT_Face->face_flags' is of type `FT_Long'.
592 *
593 * On long > int systems, higher bits of load_flags cannot be handled.
594 */
595#if FT_ULONG_MAX > FT_UINT_MAX
596 if ( load_flags > FT_UINT_MAX )
597 FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
598 " higher bits in load_flags 0x%lx are dropped\n",
599 load_flags & ~((FT_ULong)FT_UINT_MAX) ));
600#endif
601
602 query.attrs.scaler = scaler[0];
603 query.attrs.load_flags = (FT_UInt)load_flags;
604
605 /* beware, the hash must be the same for all glyph ranges! */
606 hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +
608
612 hash, gindex,
613 &query,
614 node,
615 error );
616 if ( error )
617 goto Exit;
618
619 *ansbit = FTC_SNODE( node )->sbits +
620 ( gindex - FTC_GNODE( node )->gindex );
621
622 if ( anode )
623 {
624 *anode = node;
625 node->ref_count++;
626 }
627
628 Exit:
629 return error;
630 }

◆ FTC_SBitCache_New()

FTC_SBitCache_New ( FTC_Manager  manager,
FTC_SBitCache acache 
)

Definition at line 474 of file ftcbasic.c.

476 {
478 (FTC_GCache*)acache );
479 }
static const FTC_GCacheClassRec ftc_basic_sbit_cache_class
Definition: ftcbasic.c:453

Variable Documentation

◆ FTC_FaceID