summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-09-05 16:14:25 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-09-05 16:14:25 +0000
commit4e2a0bbc454447e8abc469cc62ba5ba5f998a0b3 (patch)
tree70df4579b0b52614a9b2f208118b5701bdb37a32 /image
parentdca97bc8d466dbeb84236eda7dcebf5e6898968b (diff)
downloadnetsurf-4e2a0bbc454447e8abc469cc62ba5ba5f998a0b3.tar.gz
netsurf-4e2a0bbc454447e8abc469cc62ba5ba5f998a0b3.tar.bz2
Count total number of images that were not rendered and log on exit.
svn path=/trunk/netsurf/; revision=12740
Diffstat (limited to 'image')
-rw-r--r--image/image_cache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/image/image_cache.c b/image/image_cache.c
index f70d8ddb2..5e3576e6a 100644
--- a/image/image_cache.c
+++ b/image/image_cache.c
@@ -82,6 +82,8 @@ struct image_cache_s {
int specultive_miss_count; /* bitmap was available but never actually required conversion */
int hit_count; /* bitmap was available at plot time required no conversion */
int fail_count; /* bitmap was not available at plot time, required conversion which failed */
+
+ int total_unrendered; /* bitmap was freed without ever being required for redraw */
};
static struct image_cache_s *image_cache = NULL;
@@ -191,6 +193,10 @@ static void image_cache__free_entry(struct image_cache_entry_s *centry)
{
LOG(("freeing %p ", centry));
+ if (centry->redraw_count == 0) {
+ image_cache->total_unrendered++;
+ }
+
image_cache__free_bitmap(centry);
image_cache__unlink(centry);
@@ -314,6 +320,9 @@ nserror image_cache_fini(void)
(image_cache->miss_count * 100) / op_count,
(image_cache->specultive_miss_count * 100) / op_count,
(image_cache->fail_count * 100) / op_count));
+ LOG(("Total images never rendered: %d (includes %d that were converted)",
+ image_cache->total_unrendered,
+ image_cache->specultive_miss_count));
free(image_cache);
return NSERROR_OK;