* include/freetype/cache/ftcmanag.h, src/cache/ftcint.h,

src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftccache.c,
    src/cache/ftcglyph.c, src/cache/ftcimage.c, src/cache/ftcmanag.c,
    src/cache/ftcmru.c, src/cache/ftcsbits.c, src/cache/rules.mk:

      make various fields of the @FTC_ManagerRec structure private, i.e.
      un-accessible from client applications, introducing the new private
      "src/cache/ftcint.h" header

    * include/freetype/cache/ftcmru.h, src/cache/ftcmru.c: implement
    the new convenience function FTC_MruList_RemoveOldest()
This commit is contained in:
David Turner 2005-10-13 12:12:23 +00:00
parent 1abfd22056
commit 16e9314d96
12 changed files with 61 additions and 54 deletions

View File

@ -1,9 +1,23 @@
2005-10-13 David Turner <david@freetype.org>
* include/freetype/cache/ftcmanag.h, src/cache/ftcint.h,
src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftccache.c,
src/cache/ftcglyph.c, src/cache/ftcimage.c, src/cache/ftcmanag.c,
src/cache/ftcmru.c, src/cache/ftcsbits.c, src/cache/rules.mk:
make various fields of the @FTC_ManagerRec structure private, i.e.
un-accessible from client applications, introducing the new private
"src/cache/ftcint.h" header
* include/freetype/cache/ftcmru.h, src/cache/ftcmru.c: implement
the new convenience function FTC_MruList_RemoveOldest()
2005-09-21 David Turner <david@freetype.org>
* massive redesign of the cache sub-system internals.
in order to simplify the code and even slightly improve
performance (ftbench shows a 3% improvements in the SBit
and Image caches)
* massive redesign of the cache sub-system internals.
in order to simplify the code and even slightly improve
performance (ftbench shows a 3% improvements in the SBit
and Image caches)
2005-09-19 David Somers <dsomers@omz13.com>
@ -417,7 +431,7 @@
2005-07-04 Werner Lemberg <wl@gnu.org>
* include/freetype/internal/ftmemory.h (FT_REALLOC_ARRAY): Fix typo.
* include/freetype/internal/ftmemory.h (FT_REALLOC_ARRAY): Fix typo.
Reported by Brett Hutley.
2005-06-30 David Turner <david@freetype.org>

View File

@ -79,33 +79,19 @@ FT_BEGIN_HEADER
/* */
/*************************************************************************/
#define FTC_MAX_FACES_DEFAULT 2
#define FTC_MAX_SIZES_DEFAULT 4
#define FTC_MAX_BYTES_DEFAULT 200000L /* ~200kByte by default */
/* maximum number of caches registered in a single manager */
#define FTC_MAX_CACHES 16
#ifndef FTC_MANAGER_PRIVATE
#define FTC_MANAGER_PRIVATE
#endif
typedef struct FTC_ManagerRec_
{
FT_Library library;
FT_Memory memory;
FTC_Node nodes_list;
FT_ULong max_weight;
FT_ULong cur_weight;
FT_UInt num_nodes;
FT_UInt num_nodes; /* only used for statistics */
FT_ULong cur_weight; /* only used for statistics */
FTC_Cache caches[FTC_MAX_CACHES];
FT_UInt num_caches;
FTC_MruListRec faces;
FTC_MruListRec sizes;
FT_Pointer request_data;
FTC_Face_Requester request_face;
FTC_MANAGER_PRIVATE
} FTC_ManagerRec;
@ -135,15 +121,16 @@ FT_BEGIN_HEADER
FTC_Manager_Compress( FTC_Manager manager );
/* try to flush `count' old nodes from the cache; return the number
* of really flushed nodes
*/
/* try to flush `count' old nodes from the cache; return the number
* of really flushed nodes
*/
FT_EXPORT( FT_UInt )
FTC_Manager_FlushN( FTC_Manager manager,
FT_UInt count );
/* this must be used internally for the moment */
/* this must be used internally for the moment
*/
FT_EXPORT( FT_Error )
FTC_Manager_RegisterCache( FTC_Manager manager,
FTC_CacheClass clazz,

View File

@ -171,6 +171,10 @@ FT_BEGIN_HEADER
FTC_MruList_Remove( FTC_MruList list,
FTC_MruNode node );
FT_EXPORT( void )
FTC_MruList_RemoveOldest( FTC_MruList list );
FT_EXPORT( void )
FTC_MruList_RemoveSelection( FTC_MruList list,
FTC_MruNode_EqualFunc selection,

View File

@ -16,8 +16,7 @@
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcint.h"
#include FT_CACHE_INTERNAL_GLYPH_H
#include FT_CACHE_INTERNAL_IMAGE_H
#include FT_CACHE_INTERNAL_SBITS_H

View File

@ -16,8 +16,7 @@
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_INTERNAL_MANAGER_H
#include "ftcint.h"
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H

6
src/cache/ftccmap.c vendored
View File

@ -15,11 +15,7 @@
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_CACHE_H
#include FT_CACHE_INTERNAL_MANAGER_H
#include "ftcint.h"
#include FT_INTERNAL_MEMORY_H
#include FT_INTERNAL_DEBUG_H
#include FT_TRUETYPE_IDS_H

View File

@ -16,8 +16,7 @@
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcint.h"
#include FT_CACHE_INTERNAL_GLYPH_H
#include FT_ERRORS_H
#include FT_INTERNAL_OBJECTS_H

View File

@ -15,9 +15,7 @@
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcint.h"
#include FT_CACHE_INTERNAL_IMAGE_H
#include FT_INTERNAL_MEMORY_H
@ -67,7 +65,7 @@
/* we will now load the glyph image */
error = clazz->fam_load_glyph( family, gindex,
FTC_CACHE__MANAGER(cache),
FTC_CACHE__MANAGER(cache),
&inode->glyph );
if ( error )
{

14
src/cache/ftcmanag.c vendored
View File

@ -15,10 +15,7 @@
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include FT_CACHE_INTERNAL_MANAGER_H
#include "ftcint.h"
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_SIZES_H
@ -26,6 +23,15 @@
#include "ftcerror.h"
FT_EXPORT_DEF( void )
_ftc_manager_get_debug_info( FTC_Manager manager,
FT_UInt *p_num_caches,
FT_UInt *p_num_nodes,
FT_ULong *p_cur_weight )
{
}
#undef FT_COMPONENT
#define FT_COMPONENT trace_cache

12
src/cache/ftcmru.c vendored
View File

@ -15,9 +15,7 @@
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcint.h"
#include FT_CACHE_INTERNAL_MRU_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
@ -321,6 +319,14 @@
}
FT_EXPORT_DEF( void )
FTC_MruList_RemoveOldest( FTC_MruList list )
{
if ( list && list->nodes )
FTC_MruList_Remove( list, list->nodes->prev );
}
FT_EXPORT_DEF( void )
FTC_MruList_RemoveSelection( FTC_MruList list,
FTC_MruNode_EqualFunc selection,

View File

@ -15,9 +15,7 @@
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcint.h"
#include FT_CACHE_INTERNAL_SBITS_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H

1
src/cache/rules.mk vendored
View File

@ -42,6 +42,7 @@ CACHE_DRV_H := $(CACHE_H_DIR)/ftcmru.h \
$(CACHE_H_DIR)/ftcimage.h \
$(CACHE_H_DIR)/ftccmap.h \
$(CACHE_DIR)/ftcerror.h \
$(CACHE_DIR)/ftcint.h \
$(CACHE_DIR)/ftccback.h