From 855bdb7290c4d82af4831596d39b73efe2a0f6dc Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Tue, 24 Jun 2014 08:19:18 -0400 Subject: Moved dicache entry removal to a_Dicache_cleanup() This allows keeping the decompressed image entry until a_Dicache_cleanup() removes it. With the added SurvCleanup variable that controls how many cleanup passes the entry is kept, it is now possible to tune the dicache. For instance: SurvCleanup=0 same as without patch (negligible difference). SurvCleanup=1 allows Back and Forward reuse entries for adjacent pages. SurvCleanup=2 all the above, plus one more pass of lifetime. The default is SurvCleanup=3 (experimental). Example: If you read a newspaper with lots of images, this caching allows to click an article, read it, and go back *quickly* using the same tab. It is experimental because there may be other simple approaches that serve well/better these kind of usage patterns. --- src/dicache.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dicache.h') diff --git a/src/dicache.h b/src/dicache.h index f1819b12..0390d214 100644 --- a/src/dicache.h +++ b/src/dicache.h @@ -26,8 +26,9 @@ typedef enum { typedef struct DICacheEntry { DilloUrl *url; /* Image URL for this entry */ - uint_t width, height; /* As taken from image data */ DilloImgType type; /* Image type */ + uint_t width, height; /* As taken from image data */ + int SurvCleanup; /* Cleanup-pass survival for unused images */ uchar_t *cmap; /* Color map */ void *v_imgbuf; /* Void pointer to an Imgbuf object */ uint_t TotalSize; /* Amount of memory the image takes up */ @@ -38,9 +39,9 @@ typedef struct DICacheEntry { int version; /* Version number, used for different versions of the same URL image */ + uint_t DecodedSize; /* Size of already decoded data */ CA_Callback_t Decoder; /* Client function */ void *DecoderData; /* Client function data */ - uint_t DecodedSize; /* Size of already decoded data */ struct DICacheEntry *next; /* Link to the next "newer" version */ } DICacheEntry; -- cgit v1.2.3