From 270ef59a98d34fef418fb6cd27e46f3edc912948 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 28 Mar 2010 12:56:39 +0000 Subject: Merge jmb/new-cache; r=dsilvers,rs=vince svn path=/trunk/netsurf/; revision=10180 --- image/bmp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'image/bmp.c') diff --git a/image/bmp.c b/image/bmp.c index 2a27231ac..1774f945c 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -30,7 +30,7 @@ #include #include #include "utils/config.h" -#include "content/content.h" +#include "content/content_protected.h" #include "desktop/plotters.h" #include "image/bitmap.h" #include "image/bmp.h" @@ -49,8 +49,7 @@ bmp_bitmap_callback_vt bmp_bitmap_callbacks = { .bitmap_get_bpp = bitmap_get_bpp }; -bool nsbmp_create(struct content *c, struct content *parent, - const char *params[]) +bool nsbmp_create(struct content *c, const struct http_parameter *params) { union content_msg_data msg_data; @@ -71,12 +70,16 @@ bool nsbmp_convert(struct content *c, int iwidth, int iheight) bmp_image *bmp; union content_msg_data msg_data; uint32_t swidth; + const char *data; + unsigned long size; /* set the bmp data */ bmp = c->data.bmp.bmp; + data = content__get_source_data(c, &size); + /* analyse the BMP */ - res = bmp_analyse(bmp, c->source_size, (unsigned char *)c->source_data); + res = bmp_analyse(bmp, size, (unsigned char *) data); switch (res) { case BMP_OK: break; @@ -98,7 +101,7 @@ bool nsbmp_convert(struct content *c, int iwidth, int iheight) c->title = malloc(100); if (c->title) snprintf(c->title, 100, messages_get("BMPTitle"), c->width, - c->height, c->source_size); + c->height, size); swidth = bmp->bitmap_callbacks.bitmap_get_bpp(bmp->bitmap) * bmp->width; c->size += (swidth * bmp->height) + 16 + 44 + 100; -- cgit v1.2.3