diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-04 23:50:14 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-04 23:50:14 +0000 |
commit | b051cf466f7c9f008f2ab8c3f6ccac34882a1b9e (patch) | |
tree | 081f1eb48b34fed18e0def6f897dd1f9928ec9b7 /image/image.c | |
parent | 330227d87a7c099775d5db000416413f0271701d (diff) | |
download | netsurf-b051cf466f7c9f008f2ab8c3f6ccac34882a1b9e.tar.gz netsurf-b051cf466f7c9f008f2ab8c3f6ccac34882a1b9e.tar.bz2 |
Add Image cache and inegrate png and jpeg content handlers
Current periodic cache clean algorithm is poor and requires replacing with something suitable (probably a segregated LRU)
The speculative load algorithm is likewise poor and only uses the image size to make a decision.
svn path=/trunk/netsurf/; revision=12720
Diffstat (limited to 'image/image.c')
-rw-r--r-- | image/image.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/image/image.c b/image/image.c index 779826a17..fb8197b28 100644 --- a/image/image.c +++ b/image/image.c @@ -16,6 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdint.h> #include <stdbool.h> #include <string.h> @@ -23,6 +24,7 @@ #include "utils/errors.h" #include "image/image.h" +#include "image/image_cache.h" #include "image/bmp.h" #include "image/gif.h" #include "image/ico.h" @@ -45,6 +47,10 @@ nserror image_init(void) { nserror error; + error = image_cache_init(); + if (error != NSERROR_OK) + return error; + #ifdef WITH_BMP error = nsbmp_init(); if (error != NSERROR_OK) @@ -158,5 +164,8 @@ void image_fini(void) #ifdef WITH_WEBP webp_fini(); #endif + + /* dump any remaining cache entries */ + image_cache_fini(); } |