From 4e2a0bbc454447e8abc469cc62ba5ba5f998a0b3 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 5 Sep 2011 16:14:25 +0000 Subject: Count total number of images that were not rendered and log on exit. svn path=/trunk/netsurf/; revision=12740 --- image/image_cache.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'image') 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; -- cgit v1.2.3