r10084 jmb - in /branches/jmb/new-cache/image: ico.c ico.h

netsurf at semichrome.net netsurf at semichrome.net
Sun Feb 28 15:14:03 GMT 2010


Author: jmb
Date: Sun Feb 28 09:14:02 2010
New Revision: 10084

URL: http://source.netsurf-browser.org?rev=10084&view=rev
Log:
s/struct content/struct hlcache_handle/ in nsico_set_bitmap_from_size API

Modified:
    branches/jmb/new-cache/image/ico.c
    branches/jmb/new-cache/image/ico.h

Modified: branches/jmb/new-cache/image/ico.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.c?rev=10084&r1=10083&r2=10084&view=diff
==============================================================================
--- branches/jmb/new-cache/image/ico.c (original)
+++ branches/jmb/new-cache/image/ico.c Sun Feb 28 09:14:02 2010
@@ -30,6 +30,7 @@
 #include <libnsbmp.h>
 #include "utils/config.h"
 #include "content/content_protected.h"
+#include "content/hlcache.h"
 #include "desktop/plotters.h"
 #include "image/bitmap.h"
 #include "image/ico.h"
@@ -119,14 +120,22 @@
 
 /** sets the bitmap for an ico according to the dimensions */
 
-bool nsico_set_bitmap_from_size(struct content *c, int width, int height)
+bool nsico_set_bitmap_from_size(hlcache_handle *h, int width, int height)
 {
-	struct bmp_image *bmp = ico_find(c->data.ico.ico, width, height);
+	struct content *c = hlcache_handle_get_content(h);
+	struct bmp_image *bmp;
+
+	assert(c != NULL);
+
+	bmp = ico_find(c->data.ico.ico, width, height);
 	if (bmp == NULL)
 		return false;
+
 	if ((bmp->decoded == false) && (bmp_decode(bmp) != BMP_OK))
 		return false;
+
 	c->bitmap = bmp->bitmap;
+
 	return true;
 }
 

Modified: branches/jmb/new-cache/image/ico.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.h?rev=10084&r1=10083&r2=10084&view=diff
==============================================================================
--- branches/jmb/new-cache/image/ico.h (original)
+++ branches/jmb/new-cache/image/ico.h Sun Feb 28 09:14:02 2010
@@ -30,6 +30,7 @@
 #include <libnsbmp.h>
 
 struct content;
+struct hlcache_handle;
 
 struct content_ico_data {
 	struct ico_collection *ico;	/** ICO collection data */
@@ -47,7 +48,8 @@
 		int clip_x0, int clip_y0, int clip_x1, int clip_y1,
 		float scale, colour background_colour,
 		bool repeat_x, bool repeat_y);
-bool nsico_set_bitmap_from_size(struct content *c, int width, int height);
+bool nsico_set_bitmap_from_size(struct hlcache_handle *h, 
+		int width, int height);
 
 #endif /* WITH_BMP */
 




More information about the netsurf-commits mailing list