summaryrefslogtreecommitdiff
path: root/src/png.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-01-05 09:38:42 -0300
committerJorge Arellano Cid <jcid@dillo.org>2009-01-05 09:38:42 -0300
commite705debdae8d2ff8e4331246e4d51c077a4235ba (patch)
tree78a509aaad8bf3cfc65a58b5fa4f3df4e1412b28 /src/png.c
parentf5decdf48e13d89f133c27e9e8b77c5e04aa4bbd (diff)
These optimizations are for repeated images in a page.
1.- Every repeated cache-served-image is decoded. The patch adds an extra reference to the dicache entry, so only one of them is decoded, and the imgbuf deletion is left to a_Dicache_cleanup. 2.- Every repeated cache-served-image call copyRow for each row. The patch avoids that. This is common with small images (e.g. bullets), but the overhead may be not worth the patch...
Diffstat (limited to 'src/png.c')
-rw-r--r--src/png.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/png.c b/src/png.c
index f7e2de8d..10eec6f0 100644
--- a/src/png.c
+++ b/src/png.c
@@ -474,6 +474,7 @@ void *a_Png_image(const char *Type, void *Ptr, CA_Callback_t *Call,
DicEntry = a_Dicache_add_entry(web->url);
DicEntry->DecoderData =
Png_new(web->Image, DicEntry->url, DicEntry->version);
+ a_Dicache_ref(DicEntry->url, DicEntry->version);
} else {
/* Repeated image */
a_Dicache_ref(DicEntry->url, DicEntry->version);