Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/002c3c1a7c2ae7229afac3f1966892fd42895aec
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/002c3c1a7c2ae7229afac3f1966892fd42895aec
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/002c3c1a7c2ae7229afac3f1966892fd42895aec

The branch, master has been updated
       via  002c3c1a7c2ae7229afac3f1966892fd42895aec (commit)
       via  c2d72d1e9361b3017872e5aff16cfe9a894f3048 (commit)
       via  eca8c260a8746470ee068bb4b751b0109e663ee2 (commit)
       via  b0e61d1f32a282e8419cde81557a2f89e761190b (commit)
       via  e104fd798bbae2a12ec8318cb8e6094a37c5f3cd (commit)
       via  8e57f2a2f588c4d59fadb3ae4ef05625581c8ad6 (commit)
       via  ee874c7ea139366effcfeadcb7066ad4a39c295f (commit)
       via  9114068d3fd8c3240fbc566d554b1f7a2eaa976a (commit)
       via  1e9687196d7e6606e3d0b54998fcf22803fc4ca9 (commit)
       via  fca10f324ebbb3c2ddf14527d95ba4299c21d894 (commit)
       via  2fb5fcdda2348e09033d59291b5e8413eb88f2cb (commit)
       via  28c0e79624a1e5a101ec1f05ad4015d1a78e687f (commit)
       via  527cc33c7fbbc2ca878ffc8a128e465304128be1 (commit)
       via  09bd355a5c25a378d4a4532234ecd8067d235872 (commit)
       via  14d265d50262bdc9662b75d8de859bf1cbb3ade8 (commit)
      from  6f591aceafc1a0214966340813a626ee08aa022e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=002c3c1a7c2ae7229afac3f1966892fd42895aec
commit 002c3c1a7c2ae7229afac3f1966892fd42895aec
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Bitmap API: Clean up creation flags.

diff --git a/content/handlers/image/bmp.c b/content/handlers/image/bmp.c
index 6ef4aac..5f9708b 100644
--- a/content/handlers/image/bmp.c
+++ b/content/handlers/image/bmp.c
@@ -57,12 +57,12 @@ typedef struct nsbmp_content {
  */
 static void *nsbmp_bitmap_create(int width, int height, unsigned int bmp_state)
 {
-       unsigned int bitmap_state = BITMAP_NEW;
+       unsigned int bitmap_state = BITMAP_NONE;
 
        /* set bitmap state based on bmp state */
        bitmap_state |= (bmp_state & BMP_OPAQUE) ? BITMAP_OPAQUE : 0;
        bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
-                       BITMAP_CLEAR_MEMORY : 0;
+                       BITMAP_CLEAR : 0;
 
        /* return the created bitmap */
        return guit->bitmap->create(width, height, bitmap_state);
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index 9ecc472..f06805d 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -88,7 +88,7 @@ static inline nserror gif__nsgif_error_to_ns(nsgif_error 
gif_res)
  */
 static void *gif_bitmap_create(int width, int height)
 {
-       return guit->bitmap->create(width, height, BITMAP_NEW);
+       return guit->bitmap->create(width, height, BITMAP_NONE);
 }
 
 static nserror gif_create_gif_data(gif_content *c)
diff --git a/content/handlers/image/ico.c b/content/handlers/image/ico.c
index 63ca254..ac617f7 100644
--- a/content/handlers/image/ico.c
+++ b/content/handlers/image/ico.c
@@ -54,12 +54,12 @@ typedef struct nsico_content {
  */
 static void *nsico_bitmap_create(int width, int height, unsigned int bmp_state)
 {
-       unsigned int bitmap_state = BITMAP_NEW;
+       unsigned int bitmap_state = BITMAP_NONE;
 
        /* set bitmap state based on bmp state */
        bitmap_state |= (bmp_state & BMP_OPAQUE) ? BITMAP_OPAQUE : 0;
        bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
-                       BITMAP_CLEAR_MEMORY : 0;
+                       BITMAP_CLEAR : 0;
 
        /* return the created bitmap */
        return guit->bitmap->create(width, height, bitmap_state);
diff --git a/content/handlers/image/jpeg.c b/content/handlers/image/jpeg.c
index 549c2b6..9daf06b 100644
--- a/content/handlers/image/jpeg.c
+++ b/content/handlers/image/jpeg.c
@@ -235,7 +235,7 @@ jpeg_cache_convert(struct content *c)
        height = cinfo.output_height;
 
        /* create opaque bitmap (jpegs cannot be transparent) */
-       bitmap = guit->bitmap->create(width, height, BITMAP_NEW | 
BITMAP_OPAQUE);
+       bitmap = guit->bitmap->create(width, height, BITMAP_OPAQUE);
        if (bitmap == NULL) {
                /* empty bitmap could not be created */
                jpeg_destroy_decompress(&cinfo);
diff --git a/content/handlers/image/nssprite.c 
b/content/handlers/image/nssprite.c
index a4ce6b5..a6c2909 100644
--- a/content/handlers/image/nssprite.c
+++ b/content/handlers/image/nssprite.c
@@ -116,7 +116,7 @@ static bool nssprite_convert(struct content *c)
 
        struct rosprite* sprite = sprite_area->sprites[0];
 
-       nssprite->bitmap = guit->bitmap->create(sprite->width, sprite->height, 
BITMAP_NEW);
+       nssprite->bitmap = guit->bitmap->create(sprite->width, sprite->height, 
BITMAP_NONE);
        if (!nssprite->bitmap) {
                content_broadcast_error(c, NSERROR_NOMEM, NULL);
                return false;
diff --git a/content/handlers/image/png.c b/content/handlers/image/png.c
index a1db3f6..d4c2ae0 100644
--- a/content/handlers/image/png.c
+++ b/content/handlers/image/png.c
@@ -163,7 +163,7 @@ static void info_callback(png_structp png_s, png_infop info)
        }
 
        /* Claim the required memory for the converted PNG */
-       png_c->bitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       png_c->bitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        if (png_c->bitmap == NULL) {
                /* Failed to create bitmap skip pre-conversion */
                longjmp(png_jmpbuf(png_s), CBERR_NOPRE);
@@ -483,7 +483,7 @@ png_cache_convert(struct content *c)
        height = png_get_image_height(png_ptr, info_ptr);
 
        /* Claim the required memory for the converted PNG */
-       bitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       bitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        if (bitmap == NULL) {
                /* cleanup and bail */
                goto png_cache_convert_error;
diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c
index 0051df3..4617998 100644
--- a/content/handlers/image/rsvg.c
+++ b/content/handlers/image/rsvg.c
@@ -187,7 +187,7 @@ static bool rsvg_convert(struct content *c)
        c->height = rsvgsize.height;
 
        if ((d->bitmap = guit->bitmap->create(c->width, c->height,
-                       BITMAP_NEW)) == NULL) {
+                       BITMAP_NONE)) == NULL) {
                NSLOG(netsurf, INFO,
                      "Failed to create bitmap for rsvg render.");
                content_broadcast_error(c, NSERROR_NOMEM, NULL);
diff --git a/content/handlers/image/webp.c b/content/handlers/image/webp.c
index 721e924..59667a8 100644
--- a/content/handlers/image/webp.c
+++ b/content/handlers/image/webp.c
@@ -107,9 +107,9 @@ webp_cache_convert(struct content *c)
        }
 
        if (webpfeatures.has_alpha == 0) {
-               bmap_flags = BITMAP_NEW | BITMAP_OPAQUE;
+               bmap_flags = BITMAP_OPAQUE;
        } else {
-               bmap_flags = BITMAP_NEW;
+               bmap_flags = BITMAP_NONE;
        }
 
        /* create bitmap */
diff --git a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd 
b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
index db3c4ef..2fe73f4 100644
--- a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
+++ b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
@@ -90,7 +90,7 @@ canvas2d_user_data_handler(dom_node_operation operation,
                height = guit->bitmap->get_height(bitmap);
                stride = guit->bitmap->get_rowstride(bitmap);
                newbitmap = guit->bitmap->create(width, height,
-                                                BITMAP_NEW);
+                                                BITMAP_NONE);
                if (newbitmap != NULL) {
                        if (guit->bitmap->get_rowstride(newbitmap) == stride) {
                                // Compatible bitmap, bung the data over
@@ -173,7 +173,7 @@ static nserror canvas2d_create_bitmap(dom_node *node, 
struct bitmap **bitmap_out
 
        bitmap = guit->bitmap->create(
                (int)width, (int)height,
-               BITMAP_NEW);
+               BITMAP_NONE);
 
        if (bitmap == NULL) {
                return NSERROR_NOMEM;
@@ -242,7 +242,7 @@ canvas2d__handle_dom_event(dom_event *evt, void *pw)
        
        /* Okay, we need to reallocate our bitmap and re-cache values */
        
-       newbitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       newbitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        stride = guit->bitmap->get_rowstride(newbitmap);
 
        if (newbitmap != NULL) {
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 2fbc80f..ce9821a 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -106,7 +106,7 @@ browser_window_history__clone_entry(struct history *history,
                new_entry->page.bitmap = guit->bitmap->create(
                                LOCAL_HISTORY_WIDTH,
                                LOCAL_HISTORY_HEIGHT,
-                               BITMAP_NEW | BITMAP_OPAQUE);
+                               BITMAP_OPAQUE);
 
                if (new_entry->page.bitmap != NULL) {
                        bmsrc_data = 
guit->bitmap->get_buffer(entry->page.bitmap);
@@ -388,7 +388,7 @@ browser_window_history_add(struct browser_window *bw,
 
        entry->page.bitmap = guit->bitmap->create(
                        LOCAL_HISTORY_WIDTH, LOCAL_HISTORY_HEIGHT,
-                       BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
+                       BITMAP_CLEAR | BITMAP_OPAQUE);
        if (entry->page.bitmap != NULL) {
                ret = guit->bitmap->render(entry->page.bitmap, content);
                if (ret != NSERROR_OK) {
diff --git a/desktop/treeview.c b/desktop/treeview.c
index feb1a7c..d49be0f 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -5077,7 +5077,7 @@ treeview_generate_triangle_bitmap(colour bg, colour fg, 
int size)
        colour colour4 = fg;
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
@@ -5176,7 +5176,7 @@ treeview_generate_copy_bitmap(struct bitmap *orig, int 
size)
        assert(size == guit->bitmap->get_height(orig));
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
@@ -5224,7 +5224,7 @@ treeview_generate_rotate_bitmap(struct bitmap *orig, int 
size)
        assert(size == guit->bitmap->get_height(orig));
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index ec1a90a..c39f384 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -108,7 +108,7 @@ static APTR pool_bitmap = NULL;
 static bool guigfx_warned = false;
 
 /* exported function documented in amiga/bitmap.h */
-void *amiga_bitmap_create(int width, int height, unsigned int state)
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *bitmap;
 
@@ -139,8 +139,7 @@ void *amiga_bitmap_create(int width, int height, unsigned 
int state)
        bitmap->width = width;
        bitmap->height = height;
 
-       if(state & BITMAP_OPAQUE) bitmap->opaque = true;
-               else bitmap->opaque = false;
+       bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
 
        bitmap->nativebm = NULL;
        bitmap->nativebmwidth = 0;
diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h
index aaec26a..ae072c0 100755
--- a/frontends/amiga/bitmap.h
+++ b/frontends/amiga/bitmap.h
@@ -25,6 +25,8 @@
 #include <intuition/classusr.h>
 #include <libraries/Picasso96.h>
 
+#include "netsurf/bitmap.h"
+
 #define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8
 #define AMI_BITMAP_SCALE_ICON 0xFF
 
@@ -101,10 +103,10 @@ void ami_bitmap_fini(void);
  *
  * \param  width   width of image in pixels
  * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *amiga_bitmap_create(int width, int height, unsigned int state);
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags);
 
 /**
  * Return a pointer to the pixel data in a bitmap.
diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c
index a9fe809..1162d72 100644
--- a/frontends/amiga/dt_anim.c
+++ b/frontends/amiga/dt_anim.c
@@ -173,7 +173,7 @@ bool amiga_dt_anim_convert(struct content *c)
        size_t size;
        UBYTE *bm_buffer;
        struct BitMapHeader *bmh;
-       unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
+       unsigned int bm_flags = BITMAP_OPAQUE;
        struct adtFrame adt_frame;
        APTR clut;
 
diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c
index ed1272b..f84e0e0 100644
--- a/frontends/amiga/dt_picture.c
+++ b/frontends/amiga/dt_picture.c
@@ -187,7 +187,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct 
content *c)
 
        if((dto = amiga_dt_picture_newdtobject(adt)))
        {
-               bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NEW);
+               bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NONE);
                if (!bitmap) {
                        msg_data.errordata.errorcode = NSERROR_NOMEM;
                        msg_data.errordata.errormsg = messages_get("NoMemory");
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index 001874c..2b7f612 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -201,7 +201,7 @@ bool amiga_icon_convert(struct content *c)
                return false;
        }
 
-       icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NEW);
+       icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE);
        if (!icon_c->bitmap) {
                msg_data.errordata.errorcode = NSERROR_NOMEM;
                msg_data.errordata.errormsg = messages_get("NoMemory");
diff --git a/frontends/atari/bitmap.c b/frontends/atari/bitmap.c
index 5ac15ad..8c467c7 100644
--- a/frontends/atari/bitmap.c
+++ b/frontends/atari/bitmap.c
@@ -77,36 +77,36 @@ int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * 
out )
  * \param  pixdata     NULL or an memory address to use as the bitmap pixdata
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, 
unsigned int state, void * pixdata )
+static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, 
enum gui_bitmap_flags flags, void * pixdata )
 {
-    struct bitmap * bitmap;
+       struct bitmap * bitmap;
 
-    NSLOG(netsurf, INFO,
-         "width %d (rowstride: %d, bpp: %d), height %d, state %u", w,
-         rowstride, bpp, h, state);
+       NSLOG(netsurf, INFO,
+         "width %d (rowstride: %d, bpp: %d), height %d, flags %u", w,
+         rowstride, bpp, h, (unsigned)flags);
 
        if( rowstride == 0) {
                rowstride = bpp * w;
        }
 
        assert( rowstride >= (w * bpp) );
-    bitmap = calloc(1 , sizeof(struct bitmap) );
-    if (bitmap) {
+       bitmap = calloc(1 , sizeof(struct bitmap) );
+       if (bitmap) {
                if( pixdata == NULL) {
-               bitmap->pixdata = calloc(1, (rowstride * h)+128);
+                       bitmap->pixdata = calloc(1, (rowstride * h)+128);
                }
                else {
                        bitmap->pixdata = pixdata;
                }
 
-        if (bitmap->pixdata != NULL) {
+       if (bitmap->pixdata != NULL) {
                        bitmap->width = w;
                        bitmap->height = h;
-                       bitmap->opaque = (state & BITMAP_OPAQUE) ? true : false;
+                       bitmap->opaque = (flags & BITMAP_OPAQUE) ? true : false;
                        bitmap->bpp = bpp;
                        bitmap->resized = NULL;
                        bitmap->rowstride = rowstride;
-        } else {
+       } else {
                        free(bitmap);
                        bitmap=NULL;
                        NSLOG(netsurf, INFO, "Out of memory!");
@@ -118,9 +118,9 @@ static void *atari_bitmap_create_ex( int w, int h, short 
bpp, int rowstride, uns
 
 
 /* exported interface documented in atari/bitmap.h */
-void *atari_bitmap_create(int w, int h, unsigned int state)
+void *atari_bitmap_create(int w, int h, enum gui_bitmap_flags flags)
 {
-       return atari_bitmap_create_ex( w, h, NS_BMP_DEFAULT_BPP, w * 
NS_BMP_DEFAULT_BPP, state, NULL );
+       return atari_bitmap_create_ex( w, h, NS_BMP_DEFAULT_BPP, w * 
NS_BMP_DEFAULT_BPP, flags, NULL );
 }
 
 /**
@@ -347,7 +347,7 @@ int atari_bitmap_get_height(void *bitmap)
 bool atari_bitmap_resize(struct bitmap *img, HermesHandle hermes_h,
                HermesFormat *fmt, int nw, int nh)
 {
-       unsigned int state = 0;
+       enum gui_bitmap_flags flags = 0;
        short bpp = img->bpp;
        int stride = atari_bitmap_get_rowstride( img );
        int err;
@@ -364,9 +364,9 @@ bool atari_bitmap_resize(struct bitmap *img, HermesHandle 
hermes_h,
 
        /* allocate the mem for resized bitmap */
        if (img->opaque == true) {
-               state |= BITMAP_OPAQUE;
+               flags |= BITMAP_OPAQUE;
        }
-       img->resized = atari_bitmap_create_ex( nw, nh, bpp, nw*bpp, state, NULL 
);
+       img->resized = atari_bitmap_create_ex( nw, nh, bpp, nw*bpp, flags, NULL 
);
        if( img->resized == NULL ) {
                        printf("W: %d, H: %d, bpp: %d\n", nw, nh, bpp);
                        assert(img->resized);
diff --git a/frontends/atari/bitmap.h b/frontends/atari/bitmap.h
index 72bad55..88985ad 100644
--- a/frontends/atari/bitmap.h
+++ b/frontends/atari/bitmap.h
@@ -90,7 +90,7 @@ int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * 
out );
  * \param  state   a flag word indicating the initial state
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *atari_bitmap_create(int w, int h, unsigned int state);
+void *atari_bitmap_create(int w, int h, enum gui_bitmap_flags flags);
 
 /**
  * Find the width of a pixel row in bytes.
diff --git a/frontends/atari/plot/font_freetype.c 
b/frontends/atari/plot/font_freetype.c
index f8109f6..3ff4ab1 100644
--- a/frontends/atari/plot/font_freetype.c
+++ b/frontends/atari/plot/font_freetype.c
@@ -25,6 +25,7 @@
 #include "utils/log.h"
 #include "utils/nsoption.h"
 #include "netsurf/mouse.h"
+#include "netsurf/bitmap.h"
 #include "netsurf/plot_style.h"
 
 #include "atari/gui.h"
diff --git a/frontends/atari/plot/font_internal.c 
b/frontends/atari/plot/font_internal.c
index 709697f..11732c5 100644
--- a/frontends/atari/plot/font_internal.c
+++ b/frontends/atari/plot/font_internal.c
@@ -25,6 +25,7 @@
 #include "utils/utf8.h"
 #include "utils/log.h"
 #include "netsurf/mouse.h"
+#include "netsurf/bitmap.h"
 #include "netsurf/plot_style.h"
 
 #include "atari/gui.h"
diff --git a/frontends/beos/bitmap.cpp b/frontends/beos/bitmap.cpp
index 7b6d00d..83e69fc 100644
--- a/frontends/beos/bitmap.cpp
+++ b/frontends/beos/bitmap.cpp
@@ -114,28 +114,28 @@ static inline void nsbeos_rgba_to_bgra(void *src,
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  bflags  flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
         struct bitmap *bmp = (struct bitmap *)malloc(sizeof(struct bitmap));
         if (bmp == NULL)
                 return NULL;
 
-        int32 flags = 0;
-        if (state & BITMAP_CLEAR_MEMORY)
-                flags |= B_BITMAP_CLEAR_TO_WHITE;
+        int32 Bflags = 0;
+        if (flags & BITMAP_CLEAR)
+                Bflags |= B_BITMAP_CLEAR_TO_WHITE;
 
         BRect frame(0, 0, width - 1, height - 1);
         //XXX: bytes per row ?
-        bmp->primary = new BBitmap(frame, flags, B_RGBA32);
-        bmp->shadow = new BBitmap(frame, flags, B_RGBA32);
+        bmp->primary = new BBitmap(frame, Bflags, B_RGBA32);
+        bmp->shadow = new BBitmap(frame, Bflags, B_RGBA32);
 
         bmp->pretile_x = bmp->pretile_y = bmp->pretile_xy = NULL;
 
-        bmp->opaque = (state & BITMAP_OPAQUE) != 0;
+        bmp->opaque = (flags & BITMAP_OPAQUE) != 0;
 
         return bmp;
 }
diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c
index 7b522f2..9fb5db1 100644
--- a/frontends/framebuffer/bitmap.c
+++ b/frontends/framebuffer/bitmap.c
@@ -47,19 +47,16 @@
  * \param  state   a flag word indicating the initial state
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
-        nsfb_t *bm;
-
-        NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height,
-              state);
+       nsfb_t *bm;
 
        bm = nsfb_new(NSFB_SURFACE_RAM);
        if (bm == NULL) {
                return NULL;
        }
 
-       if ((state & BITMAP_OPAQUE) == 0) {
+       if ((flags & BITMAP_OPAQUE) == 0) {
                nsfb_set_geometry(bm, width, height, NSFB_FMT_ABGR8888);
        } else {
                nsfb_set_geometry(bm, width, height, NSFB_FMT_XBGR8888);
@@ -70,9 +67,7 @@ static void *bitmap_create(int width, int height, unsigned 
int state)
                return NULL;
        }
 
-        NSLOG(netsurf, INFO, "bitmap %p", bm);
-
-        return bm;
+       return bm;
 }
 
 
diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c
index cafe222..1f1a6dc 100644
--- a/frontends/gtk/bitmap.c
+++ b/frontends/gtk/bitmap.c
@@ -45,17 +45,17 @@
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *gbitmap;
 
        gbitmap = calloc(1, sizeof(struct bitmap));
        if (gbitmap != NULL) {
-               if ((state & BITMAP_OPAQUE) != 0) {
+               if ((flags & BITMAP_OPAQUE) != 0) {
                        gbitmap->surface = 
cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
                } else {
                        gbitmap->surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
diff --git a/frontends/monkey/bitmap.c b/frontends/monkey/bitmap.c
index ba3b83c..3601698 100644
--- a/frontends/monkey/bitmap.c
+++ b/frontends/monkey/bitmap.c
@@ -31,26 +31,26 @@ struct bitmap {
        size_t rowstride;
        int width;
        int height;
-       unsigned int state;
+       bool opaque;
 };
 
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *ret = calloc(sizeof(*ret), 1);
        if (ret == NULL)
                return NULL;
-  
+
        ret->width = width;
        ret->height = height;
-       ret->state = state;
-  
+       ret->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+
        ret->ptr = calloc(width, height * 4);
-  
+
        if (ret->ptr == NULL) {
                free(ret);
                return NULL;
        }
-  
+
        return ret;
 }
 
@@ -64,11 +64,8 @@ static void bitmap_destroy(void *bitmap)
 static void bitmap_set_opaque(void *bitmap, bool opaque)
 {
        struct bitmap *bmap = bitmap;
-  
-       if (opaque)
-               bmap->state |= (BITMAP_OPAQUE);
-       else
-               bmap->state &= ~(BITMAP_OPAQUE);
+
+       bmap->opaque = opaque;
 }
 
 static bool bitmap_test_opaque(void *bitmap)
@@ -79,8 +76,8 @@ static bool bitmap_test_opaque(void *bitmap)
 static bool bitmap_get_opaque(void *bitmap)
 {
        struct bitmap *bmap = bitmap;
-  
-       return (bmap->state & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+
+       return bmap->opaque;
 }
 
 static unsigned char *bitmap_get_buffer(void *bitmap)
@@ -98,7 +95,7 @@ static size_t bitmap_get_rowstride(void *bitmap)
 
 static void bitmap_modified(void *bitmap)
 {
-       struct bitmap *bmap = bitmap;
+       return;
 }
 
 static int bitmap_get_width(void *bitmap)
diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c
index e724d44..3454c66 100644
--- a/frontends/riscos/bitmap.c
+++ b/frontends/riscos/bitmap.c
@@ -91,7 +91,7 @@ static bool bitmap_initialise(struct bitmap *bitmap)
        assert(!bitmap->sprite_area);
 
        area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
-       if (bitmap->state & BITMAP_CLEAR_MEMORY)
+       if (bitmap->clear)
                bitmap->sprite_area = calloc(1, area_size);
        else
                bitmap->sprite_area = malloc(area_size);
@@ -123,7 +123,7 @@ static bool bitmap_initialise(struct bitmap *bitmap)
 
 
 /* exported interface documented in riscos/bitmap.h */
-void *riscos_bitmap_create(int width, int height, unsigned int state)
+void *riscos_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *bitmap;
 
@@ -135,7 +135,8 @@ void *riscos_bitmap_create(int width, int height, unsigned 
int state)
                return NULL;
        bitmap->width = width;
        bitmap->height = height;
-       bitmap->state = state;
+       bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+       bitmap->clear = (flags & BITMAP_CLEAR) == BITMAP_CLEAR;
 
        return bitmap;
 }
@@ -172,10 +173,7 @@ static void bitmap_set_opaque(void *vbitmap, bool opaque)
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
        assert(bitmap);
 
-       if (opaque)
-               bitmap->state |= BITMAP_OPAQUE;
-       else
-               bitmap->state &= ~BITMAP_OPAQUE;
+       bitmap->opaque = opaque;
 }
 
 
@@ -246,7 +244,7 @@ bool riscos_bitmap_get_opaque(void *vbitmap)
 {
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
        assert(bitmap);
-       return (bitmap->state & BITMAP_OPAQUE);
+       return bitmap->opaque;
 }
 
 
diff --git a/frontends/riscos/bitmap.h b/frontends/riscos/bitmap.h
index f66ebb3..dd3904d 100644
--- a/frontends/riscos/bitmap.h
+++ b/frontends/riscos/bitmap.h
@@ -37,7 +37,8 @@ struct bitmap {
        int width; /**< width of bitmap */
        int height; /**< height of bitmap */
 
-       unsigned int state; /**< The bitmap attributes (opaque/dirty etc.) */
+       bool opaque; /**< Whether the bitmap is opaque. */
+       bool clear;  /**< Whether the bitmap should be initialised to zeros. */
 
        struct osspriteop_area *sprite_area; /**< Uncompressed data, or NULL */
 };
@@ -71,11 +72,11 @@ void riscos_bitmap_overlay_sprite(struct bitmap *bitmap, 
const struct osspriteop
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state the state to create the bitmap in.
+ * \param  height  height of image in pixels
+ * \param  flags   flags for bitmap creation.
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *riscos_bitmap_create(int width, int height, unsigned int state);
+void *riscos_bitmap_create(int width, int height, enum gui_bitmap_flags flags);
 
 /**
  * Free a bitmap.
diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c
index 8679760..85fefea 100644
--- a/frontends/riscos/save.c
+++ b/frontends/riscos/save.c
@@ -243,7 +243,7 @@ ro_gui_save_create_thumbnail(struct hlcache_handle *h, 
const char *name)
        struct bitmap *bitmap;
        osspriteop_area *area;
 
-       bitmap = riscos_bitmap_create(34, 34, BITMAP_NEW | BITMAP_OPAQUE | 
BITMAP_CLEAR_MEMORY);
+       bitmap = riscos_bitmap_create(34, 34, BITMAP_OPAQUE | BITMAP_CLEAR);
        if (!bitmap) {
                NSLOG(netsurf, INFO, "Thumbnail initialisation failed.");
                return false;
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 28ef06f..cb1e548 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -4568,7 +4568,7 @@ ro_gui_window_iconise(struct gui_window *g, 
wimp_full_message_window_info *wi)
 
        /* create the thumbnail sprite */
        bitmap = riscos_bitmap_create(width, height,
-                       BITMAP_NEW | BITMAP_OPAQUE | BITMAP_CLEAR_MEMORY);
+                       BITMAP_OPAQUE | BITMAP_CLEAR);
        if (!bitmap) {
                NSLOG(netsurf, INFO, "Thumbnail initialisation failed.");
                return;
diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c
index 82b902d..26bc807 100644
--- a/frontends/windows/bitmap.c
+++ b/frontends/windows/bitmap.c
@@ -41,19 +41,19 @@
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  state   flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *win32_bitmap_create(int width, int height, unsigned int state)
+static void *win32_bitmap_create(int width, int height, enum gui_bitmap_flags 
flags)
 {
        struct bitmap *bitmap;
        BITMAPV5HEADER *pbmi;
        HBITMAP windib;
        uint8_t *pixdata;
 
-       NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height,
-             state);
+       NSLOG(netsurf, INFO, "width %d, height %d, flags %u", width, height,
+             (unsigned)flags);
 
        pbmi = calloc(1, sizeof(BITMAPV5HEADER));
        if (pbmi == NULL) {
@@ -91,7 +91,7 @@ void *win32_bitmap_create(int width, int height, unsigned int 
state)
        bitmap->windib = windib;
        bitmap->pbmi = pbmi;
        bitmap->pixdata = pixdata;
-       if ((state & BITMAP_OPAQUE) != 0) {
+       if ((flags & BITMAP_OPAQUE) != 0) {
                bitmap->opaque = true;
        } else {
                bitmap->opaque = false;
@@ -327,7 +327,7 @@ bitmap_render(struct bitmap *bitmap, struct hlcache_handle 
*content)
        }
 
        /* create a full size bitmap and plot into it */
-       fsbitmap = win32_bitmap_create(width, height, BITMAP_NEW | 
BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
+       fsbitmap = win32_bitmap_create(width, height, BITMAP_CLEAR | 
BITMAP_OPAQUE);
 
        SelectObject(bufferdc, fsbitmap->windib);
 
diff --git a/frontends/windows/bitmap.h b/frontends/windows/bitmap.h
index c57061d..a370dd6 100644
--- a/frontends/windows/bitmap.h
+++ b/frontends/windows/bitmap.h
@@ -33,8 +33,6 @@ struct bitmap {
 
 struct bitmap *bitmap_scale(struct bitmap *prescale, int width, int height);
 
-void *win32_bitmap_create(int width, int height, unsigned int state);
-
 void win32_bitmap_destroy(void *bitmap);
 
 #endif
diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index db207cf..dfd1188 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -54,9 +54,12 @@
 #ifndef _NETSURF_BITMAP_H_
 #define _NETSURF_BITMAP_H_
 
-#define BITMAP_NEW             0
-#define BITMAP_OPAQUE          (1 << 0) /**< image is opaque */
-#define BITMAP_CLEAR_MEMORY    (1 << 2) /**< memory should be wiped */
+/** Bitmap creation flags. */
+enum gui_bitmap_flags {
+       BITMAP_NONE   = 0,
+       BITMAP_OPAQUE = (1 << 0), /**< image is opaque */
+       BITMAP_CLEAR  = (1 << 1), /**< memory should be wiped to 0 */
+};
 
 struct content;
 struct bitmap;
@@ -71,12 +74,12 @@ struct gui_bitmap_table {
        /**
         * Create a new bitmap.
         *
-        * \param width width of image in pixels
-        * \param height width of image in pixels
-        * \param state The state to create the bitmap in.
+        * \param width   width of image in pixels
+        * \param height  height of image in pixels
+        * \param flags   flags for bitmap creation
         * \return A bitmap structure or NULL on error.
         */
-       void *(*create)(int width, int height, unsigned int state);
+       void *(*create)(int width, int height, enum gui_bitmap_flags flags);
 
        /**
         * Destroy a bitmap.


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=c2d72d1e9361b3017872e5aff16cfe9a894f3048
commit c2d72d1e9361b3017872e5aff16cfe9a894f3048
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Include: Bitmap: Remove unused save callback.

diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index e10e2ce..db207cf 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -142,15 +142,6 @@ struct gui_bitmap_table {
        int (*get_height)(void *bitmap);
 
        /**
-        * Save a bitmap to disc.
-        *
-        * \param bitmap The bitmap to save
-        * \param path The path to save the bitmap to.
-        * \param flags Flags affecting the save.
-        */
-       bool (*save)(void *bitmap, const char *path, unsigned flags);
-
-       /**
         * Marks a bitmap as modified.
         *
         * \param bitmap The bitmap set as modified.


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=eca8c260a8746470ee068bb4b751b0109e663ee2
commit eca8c260a8746470ee068bb4b751b0109e663ee2
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    BeOS: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/beos/bitmap.cpp b/frontends/beos/bitmap.cpp
index 6834192..7b6d00d 100644
--- a/frontends/beos/bitmap.cpp
+++ b/frontends/beos/bitmap.cpp
@@ -247,32 +247,6 @@ static void bitmap_destroy(void *vbitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  vbitmap  a bitmap, as returned by bitmap_create()
- * \param  path     pathname for file
- * \param  flags    modify the behaviour of the save
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
-{
-        struct bitmap *bitmap = (struct bitmap *)vbitmap;
-        BTranslatorRoster *roster = BTranslatorRoster::Default();
-        BBitmapStream stream(bitmap->primary);
-        BFile file(path, B_WRITE_ONLY | B_CREATE_FILE);
-        uint32 type = B_PNG_FORMAT;
-
-        if (file.InitCheck() < B_OK)
-                return false;
-
-        if (roster->Translate(&stream, NULL, NULL, &file, type) < B_OK)
-                return false;
-
-        return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  vbitmap  a bitmap, as returned by bitmap_create()
@@ -534,7 +508,6 @@ static struct gui_bitmap_table bitmap_table = {
         /*.get_rowstride =*/ bitmap_get_rowstride,
         /*.get_width =*/ bitmap_get_width,
         /*.get_height =*/ bitmap_get_height,
-        /*.save =*/ bitmap_save,
         /*.modified =*/ bitmap_modified,
         /*.render =*/ bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=b0e61d1f32a282e8419cde81557a2f89e761190b
commit b0e61d1f32a282e8419cde81557a2f89e761190b
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Windows: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c
index ad78a2e..82b902d 100644
--- a/frontends/windows/bitmap.c
+++ b/frontends/windows/bitmap.c
@@ -164,20 +164,6 @@ void win32_bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param bitmap a bitmap, as returned by bitmap_create()
- * \param path pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -375,7 +361,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=e104fd798bbae2a12ec8318cb8e6094a37c5f3cd
commit e104fd798bbae2a12ec8318cb8e6094a37c5f3cd
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    RISC OS: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c
index c4388cb..e724d44 100644
--- a/frontends/riscos/bitmap.c
+++ b/frontends/riscos/bitmap.c
@@ -864,7 +864,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = riscos_bitmap_save,
        .modified = bitmap_modified,
        .render = riscos_bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=8e57f2a2f588c4d59fadb3ae4ef05625581c8ad6
commit 8e57f2a2f588c4d59fadb3ae4ef05625581c8ad6
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Monkey: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/monkey/bitmap.c b/frontends/monkey/bitmap.c
index 9ed84bc..ba3b83c 100644
--- a/frontends/monkey/bitmap.c
+++ b/frontends/monkey/bitmap.c
@@ -96,11 +96,6 @@ static size_t bitmap_get_rowstride(void *bitmap)
        return bmap->width * 4;
 }
 
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
 static void bitmap_modified(void *bitmap)
 {
        struct bitmap *bmap = bitmap;
@@ -135,7 +130,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ee874c7ea139366effcfeadcb7066ad4a39c295f
commit ee874c7ea139366effcfeadcb7066ad4a39c295f
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    GTK: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c
index 5057533..cafe222 100644
--- a/frontends/gtk/bitmap.c
+++ b/frontends/gtk/bitmap.c
@@ -304,23 +304,6 @@ static void bitmap_destroy(void *vbitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  vbitmap  a bitmap, as returned by bitmap_create()
- * \param  path     pathname for file
- * \param  flags    modify the behaviour of the save
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
-{
-       struct bitmap *gbitmap = (struct bitmap *)vbitmap;
-       assert(gbitmap);
-
-       return false;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  vbitmap  a bitmap, as returned by bitmap_create()
@@ -519,7 +502,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = nsgtk_bitmap_get_width,
        .get_height = nsgtk_bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=9114068d3fd8c3240fbc566d554b1f7a2eaa976a
commit 9114068d3fd8c3240fbc566d554b1f7a2eaa976a
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Framebuffer: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c
index 133ee12..7b522f2 100644
--- a/frontends/framebuffer/bitmap.c
+++ b/frontends/framebuffer/bitmap.c
@@ -133,20 +133,6 @@ static void bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  bitmap  a bitmap, as returned by bitmap_create()
- * \param  path    pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -331,7 +317,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=1e9687196d7e6606e3d0b54998fcf22803fc4ca9
commit 1e9687196d7e6606e3d0b54998fcf22803fc4ca9
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Atari: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/atari/bitmap.c b/frontends/atari/bitmap.c
index e627a32..5ac15ad 100644
--- a/frontends/atari/bitmap.c
+++ b/frontends/atari/bitmap.c
@@ -249,21 +249,6 @@ void atari_bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  bitmap  a bitmap, as returned by bitmap_create()
- * \param  path    pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * Sets whether a bitmap should be plotted opaque
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -434,7 +419,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = atari_bitmap_get_rowstride,
        .get_width = atari_bitmap_get_width,
        .get_height = atari_bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=fca10f324ebbb3c2ddf14527d95ba4299c21d894
commit fca10f324ebbb3c2ddf14527d95ba4299c21d894
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Amiga: Drop bitmap save callback entry; core doesn't use it.

diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 14ca3fa..ec1a90a 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -815,7 +815,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = amiga_bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = amiga_bitmap_save,
        .modified = amiga_bitmap_modified,
        .render = bitmap_render,
 };


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=2fb5fcdda2348e09033d59291b5e8413eb88f2cb
commit 2fb5fcdda2348e09033d59291b5e8413eb88f2cb
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    GUI: Bitmap save callback was never required.

diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index 5888c17..cddafa0 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -580,10 +580,6 @@ static nserror verify_bitmap_register(struct 
gui_bitmap_table *gbt)
                return NSERROR_BAD_PARAMETER;
        }
 
-       if (gbt->save == NULL) {
-               return NSERROR_BAD_PARAMETER;
-       }
-
        if (gbt->modified == NULL) {
                return NSERROR_BAD_PARAMETER;
        }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=28c0e79624a1e5a101ec1f05ad4015d1a78e687f
commit 28c0e79624a1e5a101ec1f05ad4015d1a78e687f
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Include: Bitmap: Modified flag isn't used.

diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index b6db3f4..e10e2ce 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -56,7 +56,6 @@
 
 #define BITMAP_NEW             0
 #define BITMAP_OPAQUE          (1 << 0) /**< image is opaque */
-#define BITMAP_MODIFIED                (1 << 1) /**< buffer has been modified 
*/
 #define BITMAP_CLEAR_MEMORY    (1 << 2) /**< memory should be wiped */
 
 struct content;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=527cc33c7fbbc2ca878ffc8a128e465304128be1
commit 527cc33c7fbbc2ca878ffc8a128e465304128be1
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Monkey: Bitmap: Modified flag is not used.

diff --git a/frontends/monkey/bitmap.c b/frontends/monkey/bitmap.c
index 62b62eb..9ed84bc 100644
--- a/frontends/monkey/bitmap.c
+++ b/frontends/monkey/bitmap.c
@@ -104,7 +104,6 @@ static bool bitmap_save(void *bitmap, const char *path, 
unsigned flags)
 static void bitmap_modified(void *bitmap)
 {
        struct bitmap *bmap = bitmap;
-       bmap->state |= BITMAP_MODIFIED;
 }
 
 static int bitmap_get_width(void *bitmap)


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=09bd355a5c25a378d4a4532234ecd8067d235872
commit 09bd355a5c25a378d4a4532234ecd8067d235872
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    RISC OS: Bitmap modified flag is not used.

diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c
index 9de6c91..c4388cb 100644
--- a/frontends/riscos/bitmap.c
+++ b/frontends/riscos/bitmap.c
@@ -450,7 +450,6 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, 
unsigned flags)
 static void bitmap_modified(void *vbitmap)
 {
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
-       bitmap->state |= BITMAP_MODIFIED;
 }
 
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=14d265d50262bdc9662b75d8de859bf1cbb3ade8
commit 14d265d50262bdc9662b75d8de859bf1cbb3ade8
Author: Michael Drake <t...@netsurf-browser.org>
Commit: Michael Drake <t...@netsurf-browser.org>

    Include: Bitmap: Fix comment typo.

diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index d95a172..b6db3f4 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -67,7 +67,7 @@ struct hlcache_handle;
  * Bitmap operations.
  */
 struct gui_bitmap_table {
-       /* Mandantory entries */
+       /* Mandatory entries */
 
        /**
         * Create a new bitmap.


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/image/bmp.c                       |    4 +-
 content/handlers/image/gif.c                       |    2 +-
 content/handlers/image/ico.c                       |    4 +-
 content/handlers/image/jpeg.c                      |    2 +-
 content/handlers/image/nssprite.c                  |    2 +-
 content/handlers/image/png.c                       |    4 +-
 content/handlers/image/rsvg.c                      |    2 +-
 content/handlers/image/webp.c                      |    4 +-
 .../duktape/CanvasRenderingContext2D.bnd           |    6 +--
 desktop/browser_history.c                          |    4 +-
 desktop/gui_factory.c                              |    4 --
 desktop/treeview.c                                 |    6 +--
 frontends/amiga/bitmap.c                           |    6 +--
 frontends/amiga/bitmap.h                           |    6 ++-
 frontends/amiga/dt_anim.c                          |    2 +-
 frontends/amiga/dt_picture.c                       |    2 +-
 frontends/amiga/icon.c                             |    2 +-
 frontends/atari/bitmap.c                           |   48 +++++++-------------
 frontends/atari/bitmap.h                           |    2 +-
 frontends/atari/plot/font_freetype.c               |    1 +
 frontends/atari/plot/font_internal.c               |    1 +
 frontends/beos/bitmap.cpp                          |   45 ++++--------------
 frontends/framebuffer/bitmap.c                     |   28 ++----------
 frontends/gtk/bitmap.c                             |   26 ++---------
 frontends/monkey/bitmap.c                          |   34 +++++---------
 frontends/riscos/bitmap.c                          |   16 +++----
 frontends/riscos/bitmap.h                          |    9 ++--
 frontends/riscos/save.c                            |    2 +-
 frontends/riscos/window.c                          |    2 +-
 frontends/windows/bitmap.c                         |   29 +++---------
 frontends/windows/bitmap.h                         |    2 -
 include/netsurf/bitmap.h                           |   29 +++++-------
 32 files changed, 108 insertions(+), 228 deletions(-)

diff --git a/content/handlers/image/bmp.c b/content/handlers/image/bmp.c
index 6ef4aac..5f9708b 100644
--- a/content/handlers/image/bmp.c
+++ b/content/handlers/image/bmp.c
@@ -57,12 +57,12 @@ typedef struct nsbmp_content {
  */
 static void *nsbmp_bitmap_create(int width, int height, unsigned int bmp_state)
 {
-       unsigned int bitmap_state = BITMAP_NEW;
+       unsigned int bitmap_state = BITMAP_NONE;
 
        /* set bitmap state based on bmp state */
        bitmap_state |= (bmp_state & BMP_OPAQUE) ? BITMAP_OPAQUE : 0;
        bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
-                       BITMAP_CLEAR_MEMORY : 0;
+                       BITMAP_CLEAR : 0;
 
        /* return the created bitmap */
        return guit->bitmap->create(width, height, bitmap_state);
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index 9ecc472..f06805d 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -88,7 +88,7 @@ static inline nserror gif__nsgif_error_to_ns(nsgif_error 
gif_res)
  */
 static void *gif_bitmap_create(int width, int height)
 {
-       return guit->bitmap->create(width, height, BITMAP_NEW);
+       return guit->bitmap->create(width, height, BITMAP_NONE);
 }
 
 static nserror gif_create_gif_data(gif_content *c)
diff --git a/content/handlers/image/ico.c b/content/handlers/image/ico.c
index 63ca254..ac617f7 100644
--- a/content/handlers/image/ico.c
+++ b/content/handlers/image/ico.c
@@ -54,12 +54,12 @@ typedef struct nsico_content {
  */
 static void *nsico_bitmap_create(int width, int height, unsigned int bmp_state)
 {
-       unsigned int bitmap_state = BITMAP_NEW;
+       unsigned int bitmap_state = BITMAP_NONE;
 
        /* set bitmap state based on bmp state */
        bitmap_state |= (bmp_state & BMP_OPAQUE) ? BITMAP_OPAQUE : 0;
        bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
-                       BITMAP_CLEAR_MEMORY : 0;
+                       BITMAP_CLEAR : 0;
 
        /* return the created bitmap */
        return guit->bitmap->create(width, height, bitmap_state);
diff --git a/content/handlers/image/jpeg.c b/content/handlers/image/jpeg.c
index 549c2b6..9daf06b 100644
--- a/content/handlers/image/jpeg.c
+++ b/content/handlers/image/jpeg.c
@@ -235,7 +235,7 @@ jpeg_cache_convert(struct content *c)
        height = cinfo.output_height;
 
        /* create opaque bitmap (jpegs cannot be transparent) */
-       bitmap = guit->bitmap->create(width, height, BITMAP_NEW | 
BITMAP_OPAQUE);
+       bitmap = guit->bitmap->create(width, height, BITMAP_OPAQUE);
        if (bitmap == NULL) {
                /* empty bitmap could not be created */
                jpeg_destroy_decompress(&cinfo);
diff --git a/content/handlers/image/nssprite.c 
b/content/handlers/image/nssprite.c
index a4ce6b5..a6c2909 100644
--- a/content/handlers/image/nssprite.c
+++ b/content/handlers/image/nssprite.c
@@ -116,7 +116,7 @@ static bool nssprite_convert(struct content *c)
 
        struct rosprite* sprite = sprite_area->sprites[0];
 
-       nssprite->bitmap = guit->bitmap->create(sprite->width, sprite->height, 
BITMAP_NEW);
+       nssprite->bitmap = guit->bitmap->create(sprite->width, sprite->height, 
BITMAP_NONE);
        if (!nssprite->bitmap) {
                content_broadcast_error(c, NSERROR_NOMEM, NULL);
                return false;
diff --git a/content/handlers/image/png.c b/content/handlers/image/png.c
index a1db3f6..d4c2ae0 100644
--- a/content/handlers/image/png.c
+++ b/content/handlers/image/png.c
@@ -163,7 +163,7 @@ static void info_callback(png_structp png_s, png_infop info)
        }
 
        /* Claim the required memory for the converted PNG */
-       png_c->bitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       png_c->bitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        if (png_c->bitmap == NULL) {
                /* Failed to create bitmap skip pre-conversion */
                longjmp(png_jmpbuf(png_s), CBERR_NOPRE);
@@ -483,7 +483,7 @@ png_cache_convert(struct content *c)
        height = png_get_image_height(png_ptr, info_ptr);
 
        /* Claim the required memory for the converted PNG */
-       bitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       bitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        if (bitmap == NULL) {
                /* cleanup and bail */
                goto png_cache_convert_error;
diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c
index 0051df3..4617998 100644
--- a/content/handlers/image/rsvg.c
+++ b/content/handlers/image/rsvg.c
@@ -187,7 +187,7 @@ static bool rsvg_convert(struct content *c)
        c->height = rsvgsize.height;
 
        if ((d->bitmap = guit->bitmap->create(c->width, c->height,
-                       BITMAP_NEW)) == NULL) {
+                       BITMAP_NONE)) == NULL) {
                NSLOG(netsurf, INFO,
                      "Failed to create bitmap for rsvg render.");
                content_broadcast_error(c, NSERROR_NOMEM, NULL);
diff --git a/content/handlers/image/webp.c b/content/handlers/image/webp.c
index 721e924..59667a8 100644
--- a/content/handlers/image/webp.c
+++ b/content/handlers/image/webp.c
@@ -107,9 +107,9 @@ webp_cache_convert(struct content *c)
        }
 
        if (webpfeatures.has_alpha == 0) {
-               bmap_flags = BITMAP_NEW | BITMAP_OPAQUE;
+               bmap_flags = BITMAP_OPAQUE;
        } else {
-               bmap_flags = BITMAP_NEW;
+               bmap_flags = BITMAP_NONE;
        }
 
        /* create bitmap */
diff --git a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd 
b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
index db3c4ef..2fe73f4 100644
--- a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
+++ b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
@@ -90,7 +90,7 @@ canvas2d_user_data_handler(dom_node_operation operation,
                height = guit->bitmap->get_height(bitmap);
                stride = guit->bitmap->get_rowstride(bitmap);
                newbitmap = guit->bitmap->create(width, height,
-                                                BITMAP_NEW);
+                                                BITMAP_NONE);
                if (newbitmap != NULL) {
                        if (guit->bitmap->get_rowstride(newbitmap) == stride) {
                                // Compatible bitmap, bung the data over
@@ -173,7 +173,7 @@ static nserror canvas2d_create_bitmap(dom_node *node, 
struct bitmap **bitmap_out
 
        bitmap = guit->bitmap->create(
                (int)width, (int)height,
-               BITMAP_NEW);
+               BITMAP_NONE);
 
        if (bitmap == NULL) {
                return NSERROR_NOMEM;
@@ -242,7 +242,7 @@ canvas2d__handle_dom_event(dom_event *evt, void *pw)
        
        /* Okay, we need to reallocate our bitmap and re-cache values */
        
-       newbitmap = guit->bitmap->create(width, height, BITMAP_NEW);
+       newbitmap = guit->bitmap->create(width, height, BITMAP_NONE);
        stride = guit->bitmap->get_rowstride(newbitmap);
 
        if (newbitmap != NULL) {
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 2fbc80f..ce9821a 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -106,7 +106,7 @@ browser_window_history__clone_entry(struct history *history,
                new_entry->page.bitmap = guit->bitmap->create(
                                LOCAL_HISTORY_WIDTH,
                                LOCAL_HISTORY_HEIGHT,
-                               BITMAP_NEW | BITMAP_OPAQUE);
+                               BITMAP_OPAQUE);
 
                if (new_entry->page.bitmap != NULL) {
                        bmsrc_data = 
guit->bitmap->get_buffer(entry->page.bitmap);
@@ -388,7 +388,7 @@ browser_window_history_add(struct browser_window *bw,
 
        entry->page.bitmap = guit->bitmap->create(
                        LOCAL_HISTORY_WIDTH, LOCAL_HISTORY_HEIGHT,
-                       BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
+                       BITMAP_CLEAR | BITMAP_OPAQUE);
        if (entry->page.bitmap != NULL) {
                ret = guit->bitmap->render(entry->page.bitmap, content);
                if (ret != NSERROR_OK) {
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index 5888c17..cddafa0 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -580,10 +580,6 @@ static nserror verify_bitmap_register(struct 
gui_bitmap_table *gbt)
                return NSERROR_BAD_PARAMETER;
        }
 
-       if (gbt->save == NULL) {
-               return NSERROR_BAD_PARAMETER;
-       }
-
        if (gbt->modified == NULL) {
                return NSERROR_BAD_PARAMETER;
        }
diff --git a/desktop/treeview.c b/desktop/treeview.c
index feb1a7c..d49be0f 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -5077,7 +5077,7 @@ treeview_generate_triangle_bitmap(colour bg, colour fg, 
int size)
        colour colour4 = fg;
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
@@ -5176,7 +5176,7 @@ treeview_generate_copy_bitmap(struct bitmap *orig, int 
size)
        assert(size == guit->bitmap->get_height(orig));
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
@@ -5224,7 +5224,7 @@ treeview_generate_rotate_bitmap(struct bitmap *orig, int 
size)
        assert(size == guit->bitmap->get_height(orig));
 
        /* Create the bitmap */
-       b = guit->bitmap->create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+       b = guit->bitmap->create(size, size, BITMAP_OPAQUE);
        if (b == NULL)
                return NULL;
 
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 14ca3fa..c39f384 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -108,7 +108,7 @@ static APTR pool_bitmap = NULL;
 static bool guigfx_warned = false;
 
 /* exported function documented in amiga/bitmap.h */
-void *amiga_bitmap_create(int width, int height, unsigned int state)
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *bitmap;
 
@@ -139,8 +139,7 @@ void *amiga_bitmap_create(int width, int height, unsigned 
int state)
        bitmap->width = width;
        bitmap->height = height;
 
-       if(state & BITMAP_OPAQUE) bitmap->opaque = true;
-               else bitmap->opaque = false;
+       bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
 
        bitmap->nativebm = NULL;
        bitmap->nativebmwidth = 0;
@@ -815,7 +814,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = amiga_bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = amiga_bitmap_save,
        .modified = amiga_bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h
index aaec26a..ae072c0 100755
--- a/frontends/amiga/bitmap.h
+++ b/frontends/amiga/bitmap.h
@@ -25,6 +25,8 @@
 #include <intuition/classusr.h>
 #include <libraries/Picasso96.h>
 
+#include "netsurf/bitmap.h"
+
 #define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8
 #define AMI_BITMAP_SCALE_ICON 0xFF
 
@@ -101,10 +103,10 @@ void ami_bitmap_fini(void);
  *
  * \param  width   width of image in pixels
  * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *amiga_bitmap_create(int width, int height, unsigned int state);
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags);
 
 /**
  * Return a pointer to the pixel data in a bitmap.
diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c
index a9fe809..1162d72 100644
--- a/frontends/amiga/dt_anim.c
+++ b/frontends/amiga/dt_anim.c
@@ -173,7 +173,7 @@ bool amiga_dt_anim_convert(struct content *c)
        size_t size;
        UBYTE *bm_buffer;
        struct BitMapHeader *bmh;
-       unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
+       unsigned int bm_flags = BITMAP_OPAQUE;
        struct adtFrame adt_frame;
        APTR clut;
 
diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c
index ed1272b..f84e0e0 100644
--- a/frontends/amiga/dt_picture.c
+++ b/frontends/amiga/dt_picture.c
@@ -187,7 +187,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct 
content *c)
 
        if((dto = amiga_dt_picture_newdtobject(adt)))
        {
-               bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NEW);
+               bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NONE);
                if (!bitmap) {
                        msg_data.errordata.errorcode = NSERROR_NOMEM;
                        msg_data.errordata.errormsg = messages_get("NoMemory");
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index 001874c..2b7f612 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -201,7 +201,7 @@ bool amiga_icon_convert(struct content *c)
                return false;
        }
 
-       icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NEW);
+       icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE);
        if (!icon_c->bitmap) {
                msg_data.errordata.errorcode = NSERROR_NOMEM;
                msg_data.errordata.errormsg = messages_get("NoMemory");
diff --git a/frontends/atari/bitmap.c b/frontends/atari/bitmap.c
index e627a32..8c467c7 100644
--- a/frontends/atari/bitmap.c
+++ b/frontends/atari/bitmap.c
@@ -77,36 +77,36 @@ int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * 
out )
  * \param  pixdata     NULL or an memory address to use as the bitmap pixdata
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, 
unsigned int state, void * pixdata )
+static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, 
enum gui_bitmap_flags flags, void * pixdata )
 {
-    struct bitmap * bitmap;
+       struct bitmap * bitmap;
 
-    NSLOG(netsurf, INFO,
-         "width %d (rowstride: %d, bpp: %d), height %d, state %u", w,
-         rowstride, bpp, h, state);
+       NSLOG(netsurf, INFO,
+         "width %d (rowstride: %d, bpp: %d), height %d, flags %u", w,
+         rowstride, bpp, h, (unsigned)flags);
 
        if( rowstride == 0) {
                rowstride = bpp * w;
        }
 
        assert( rowstride >= (w * bpp) );
-    bitmap = calloc(1 , sizeof(struct bitmap) );
-    if (bitmap) {
+       bitmap = calloc(1 , sizeof(struct bitmap) );
+       if (bitmap) {
                if( pixdata == NULL) {
-               bitmap->pixdata = calloc(1, (rowstride * h)+128);
+                       bitmap->pixdata = calloc(1, (rowstride * h)+128);
                }
                else {
                        bitmap->pixdata = pixdata;
                }
 
-        if (bitmap->pixdata != NULL) {
+       if (bitmap->pixdata != NULL) {
                        bitmap->width = w;
                        bitmap->height = h;
-                       bitmap->opaque = (state & BITMAP_OPAQUE) ? true : false;
+                       bitmap->opaque = (flags & BITMAP_OPAQUE) ? true : false;
                        bitmap->bpp = bpp;
                        bitmap->resized = NULL;
                        bitmap->rowstride = rowstride;
-        } else {
+       } else {
                        free(bitmap);
                        bitmap=NULL;
                        NSLOG(netsurf, INFO, "Out of memory!");
@@ -118,9 +118,9 @@ static void *atari_bitmap_create_ex( int w, int h, short 
bpp, int rowstride, uns
 
 
 /* exported interface documented in atari/bitmap.h */
-void *atari_bitmap_create(int w, int h, unsigned int state)
+void *atari_bitmap_create(int w, int h, enum gui_bitmap_flags flags)
 {
-       return atari_bitmap_create_ex( w, h, NS_BMP_DEFAULT_BPP, w * 
NS_BMP_DEFAULT_BPP, state, NULL );
+       return atari_bitmap_create_ex( w, h, NS_BMP_DEFAULT_BPP, w * 
NS_BMP_DEFAULT_BPP, flags, NULL );
 }
 
 /**
@@ -249,21 +249,6 @@ void atari_bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  bitmap  a bitmap, as returned by bitmap_create()
- * \param  path    pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * Sets whether a bitmap should be plotted opaque
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -362,7 +347,7 @@ int atari_bitmap_get_height(void *bitmap)
 bool atari_bitmap_resize(struct bitmap *img, HermesHandle hermes_h,
                HermesFormat *fmt, int nw, int nh)
 {
-       unsigned int state = 0;
+       enum gui_bitmap_flags flags = 0;
        short bpp = img->bpp;
        int stride = atari_bitmap_get_rowstride( img );
        int err;
@@ -379,9 +364,9 @@ bool atari_bitmap_resize(struct bitmap *img, HermesHandle 
hermes_h,
 
        /* allocate the mem for resized bitmap */
        if (img->opaque == true) {
-               state |= BITMAP_OPAQUE;
+               flags |= BITMAP_OPAQUE;
        }
-       img->resized = atari_bitmap_create_ex( nw, nh, bpp, nw*bpp, state, NULL 
);
+       img->resized = atari_bitmap_create_ex( nw, nh, bpp, nw*bpp, flags, NULL 
);
        if( img->resized == NULL ) {
                        printf("W: %d, H: %d, bpp: %d\n", nw, nh, bpp);
                        assert(img->resized);
@@ -434,7 +419,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = atari_bitmap_get_rowstride,
        .get_width = atari_bitmap_get_width,
        .get_height = atari_bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/atari/bitmap.h b/frontends/atari/bitmap.h
index 72bad55..88985ad 100644
--- a/frontends/atari/bitmap.h
+++ b/frontends/atari/bitmap.h
@@ -90,7 +90,7 @@ int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * 
out );
  * \param  state   a flag word indicating the initial state
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *atari_bitmap_create(int w, int h, unsigned int state);
+void *atari_bitmap_create(int w, int h, enum gui_bitmap_flags flags);
 
 /**
  * Find the width of a pixel row in bytes.
diff --git a/frontends/atari/plot/font_freetype.c 
b/frontends/atari/plot/font_freetype.c
index f8109f6..3ff4ab1 100644
--- a/frontends/atari/plot/font_freetype.c
+++ b/frontends/atari/plot/font_freetype.c
@@ -25,6 +25,7 @@
 #include "utils/log.h"
 #include "utils/nsoption.h"
 #include "netsurf/mouse.h"
+#include "netsurf/bitmap.h"
 #include "netsurf/plot_style.h"
 
 #include "atari/gui.h"
diff --git a/frontends/atari/plot/font_internal.c 
b/frontends/atari/plot/font_internal.c
index 709697f..11732c5 100644
--- a/frontends/atari/plot/font_internal.c
+++ b/frontends/atari/plot/font_internal.c
@@ -25,6 +25,7 @@
 #include "utils/utf8.h"
 #include "utils/log.h"
 #include "netsurf/mouse.h"
+#include "netsurf/bitmap.h"
 #include "netsurf/plot_style.h"
 
 #include "atari/gui.h"
diff --git a/frontends/beos/bitmap.cpp b/frontends/beos/bitmap.cpp
index 6834192..83e69fc 100644
--- a/frontends/beos/bitmap.cpp
+++ b/frontends/beos/bitmap.cpp
@@ -114,28 +114,28 @@ static inline void nsbeos_rgba_to_bgra(void *src,
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  bflags  flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
         struct bitmap *bmp = (struct bitmap *)malloc(sizeof(struct bitmap));
         if (bmp == NULL)
                 return NULL;
 
-        int32 flags = 0;
-        if (state & BITMAP_CLEAR_MEMORY)
-                flags |= B_BITMAP_CLEAR_TO_WHITE;
+        int32 Bflags = 0;
+        if (flags & BITMAP_CLEAR)
+                Bflags |= B_BITMAP_CLEAR_TO_WHITE;
 
         BRect frame(0, 0, width - 1, height - 1);
         //XXX: bytes per row ?
-        bmp->primary = new BBitmap(frame, flags, B_RGBA32);
-        bmp->shadow = new BBitmap(frame, flags, B_RGBA32);
+        bmp->primary = new BBitmap(frame, Bflags, B_RGBA32);
+        bmp->shadow = new BBitmap(frame, Bflags, B_RGBA32);
 
         bmp->pretile_x = bmp->pretile_y = bmp->pretile_xy = NULL;
 
-        bmp->opaque = (state & BITMAP_OPAQUE) != 0;
+        bmp->opaque = (flags & BITMAP_OPAQUE) != 0;
 
         return bmp;
 }
@@ -247,32 +247,6 @@ static void bitmap_destroy(void *vbitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  vbitmap  a bitmap, as returned by bitmap_create()
- * \param  path     pathname for file
- * \param  flags    modify the behaviour of the save
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
-{
-        struct bitmap *bitmap = (struct bitmap *)vbitmap;
-        BTranslatorRoster *roster = BTranslatorRoster::Default();
-        BBitmapStream stream(bitmap->primary);
-        BFile file(path, B_WRITE_ONLY | B_CREATE_FILE);
-        uint32 type = B_PNG_FORMAT;
-
-        if (file.InitCheck() < B_OK)
-                return false;
-
-        if (roster->Translate(&stream, NULL, NULL, &file, type) < B_OK)
-                return false;
-
-        return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  vbitmap  a bitmap, as returned by bitmap_create()
@@ -534,7 +508,6 @@ static struct gui_bitmap_table bitmap_table = {
         /*.get_rowstride =*/ bitmap_get_rowstride,
         /*.get_width =*/ bitmap_get_width,
         /*.get_height =*/ bitmap_get_height,
-        /*.save =*/ bitmap_save,
         /*.modified =*/ bitmap_modified,
         /*.render =*/ bitmap_render,
 };
diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c
index 133ee12..9fb5db1 100644
--- a/frontends/framebuffer/bitmap.c
+++ b/frontends/framebuffer/bitmap.c
@@ -47,19 +47,16 @@
  * \param  state   a flag word indicating the initial state
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
-        nsfb_t *bm;
-
-        NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height,
-              state);
+       nsfb_t *bm;
 
        bm = nsfb_new(NSFB_SURFACE_RAM);
        if (bm == NULL) {
                return NULL;
        }
 
-       if ((state & BITMAP_OPAQUE) == 0) {
+       if ((flags & BITMAP_OPAQUE) == 0) {
                nsfb_set_geometry(bm, width, height, NSFB_FMT_ABGR8888);
        } else {
                nsfb_set_geometry(bm, width, height, NSFB_FMT_XBGR8888);
@@ -70,9 +67,7 @@ static void *bitmap_create(int width, int height, unsigned 
int state)
                return NULL;
        }
 
-        NSLOG(netsurf, INFO, "bitmap %p", bm);
-
-        return bm;
+       return bm;
 }
 
 
@@ -133,20 +128,6 @@ static void bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  bitmap  a bitmap, as returned by bitmap_create()
- * \param  path    pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -331,7 +312,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c
index 5057533..1f1a6dc 100644
--- a/frontends/gtk/bitmap.c
+++ b/frontends/gtk/bitmap.c
@@ -45,17 +45,17 @@
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *gbitmap;
 
        gbitmap = calloc(1, sizeof(struct bitmap));
        if (gbitmap != NULL) {
-               if ((state & BITMAP_OPAQUE) != 0) {
+               if ((flags & BITMAP_OPAQUE) != 0) {
                        gbitmap->surface = 
cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
                } else {
                        gbitmap->surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
@@ -304,23 +304,6 @@ static void bitmap_destroy(void *vbitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param  vbitmap  a bitmap, as returned by bitmap_create()
- * \param  path     pathname for file
- * \param  flags    modify the behaviour of the save
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
-{
-       struct bitmap *gbitmap = (struct bitmap *)vbitmap;
-       assert(gbitmap);
-
-       return false;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  vbitmap  a bitmap, as returned by bitmap_create()
@@ -519,7 +502,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = nsgtk_bitmap_get_width,
        .get_height = nsgtk_bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/monkey/bitmap.c b/frontends/monkey/bitmap.c
index 62b62eb..3601698 100644
--- a/frontends/monkey/bitmap.c
+++ b/frontends/monkey/bitmap.c
@@ -31,26 +31,26 @@ struct bitmap {
        size_t rowstride;
        int width;
        int height;
-       unsigned int state;
+       bool opaque;
 };
 
-static void *bitmap_create(int width, int height, unsigned int state)
+static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *ret = calloc(sizeof(*ret), 1);
        if (ret == NULL)
                return NULL;
-  
+
        ret->width = width;
        ret->height = height;
-       ret->state = state;
-  
+       ret->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+
        ret->ptr = calloc(width, height * 4);
-  
+
        if (ret->ptr == NULL) {
                free(ret);
                return NULL;
        }
-  
+
        return ret;
 }
 
@@ -64,11 +64,8 @@ static void bitmap_destroy(void *bitmap)
 static void bitmap_set_opaque(void *bitmap, bool opaque)
 {
        struct bitmap *bmap = bitmap;
-  
-       if (opaque)
-               bmap->state |= (BITMAP_OPAQUE);
-       else
-               bmap->state &= ~(BITMAP_OPAQUE);
+
+       bmap->opaque = opaque;
 }
 
 static bool bitmap_test_opaque(void *bitmap)
@@ -79,8 +76,8 @@ static bool bitmap_test_opaque(void *bitmap)
 static bool bitmap_get_opaque(void *bitmap)
 {
        struct bitmap *bmap = bitmap;
-  
-       return (bmap->state & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+
+       return bmap->opaque;
 }
 
 static unsigned char *bitmap_get_buffer(void *bitmap)
@@ -96,15 +93,9 @@ static size_t bitmap_get_rowstride(void *bitmap)
        return bmap->width * 4;
 }
 
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
 static void bitmap_modified(void *bitmap)
 {
-       struct bitmap *bmap = bitmap;
-       bmap->state |= BITMAP_MODIFIED;
+       return;
 }
 
 static int bitmap_get_width(void *bitmap)
@@ -136,7 +127,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c
index 9de6c91..3454c66 100644
--- a/frontends/riscos/bitmap.c
+++ b/frontends/riscos/bitmap.c
@@ -91,7 +91,7 @@ static bool bitmap_initialise(struct bitmap *bitmap)
        assert(!bitmap->sprite_area);
 
        area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
-       if (bitmap->state & BITMAP_CLEAR_MEMORY)
+       if (bitmap->clear)
                bitmap->sprite_area = calloc(1, area_size);
        else
                bitmap->sprite_area = malloc(area_size);
@@ -123,7 +123,7 @@ static bool bitmap_initialise(struct bitmap *bitmap)
 
 
 /* exported interface documented in riscos/bitmap.h */
-void *riscos_bitmap_create(int width, int height, unsigned int state)
+void *riscos_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
 {
        struct bitmap *bitmap;
 
@@ -135,7 +135,8 @@ void *riscos_bitmap_create(int width, int height, unsigned 
int state)
                return NULL;
        bitmap->width = width;
        bitmap->height = height;
-       bitmap->state = state;
+       bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
+       bitmap->clear = (flags & BITMAP_CLEAR) == BITMAP_CLEAR;
 
        return bitmap;
 }
@@ -172,10 +173,7 @@ static void bitmap_set_opaque(void *vbitmap, bool opaque)
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
        assert(bitmap);
 
-       if (opaque)
-               bitmap->state |= BITMAP_OPAQUE;
-       else
-               bitmap->state &= ~BITMAP_OPAQUE;
+       bitmap->opaque = opaque;
 }
 
 
@@ -246,7 +244,7 @@ bool riscos_bitmap_get_opaque(void *vbitmap)
 {
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
        assert(bitmap);
-       return (bitmap->state & BITMAP_OPAQUE);
+       return bitmap->opaque;
 }
 
 
@@ -450,7 +448,6 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, 
unsigned flags)
 static void bitmap_modified(void *vbitmap)
 {
        struct bitmap *bitmap = (struct bitmap *) vbitmap;
-       bitmap->state |= BITMAP_MODIFIED;
 }
 
 
@@ -865,7 +862,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = riscos_bitmap_save,
        .modified = bitmap_modified,
        .render = riscos_bitmap_render,
 };
diff --git a/frontends/riscos/bitmap.h b/frontends/riscos/bitmap.h
index f66ebb3..dd3904d 100644
--- a/frontends/riscos/bitmap.h
+++ b/frontends/riscos/bitmap.h
@@ -37,7 +37,8 @@ struct bitmap {
        int width; /**< width of bitmap */
        int height; /**< height of bitmap */
 
-       unsigned int state; /**< The bitmap attributes (opaque/dirty etc.) */
+       bool opaque; /**< Whether the bitmap is opaque. */
+       bool clear;  /**< Whether the bitmap should be initialised to zeros. */
 
        struct osspriteop_area *sprite_area; /**< Uncompressed data, or NULL */
 };
@@ -71,11 +72,11 @@ void riscos_bitmap_overlay_sprite(struct bitmap *bitmap, 
const struct osspriteop
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state the state to create the bitmap in.
+ * \param  height  height of image in pixels
+ * \param  flags   flags for bitmap creation.
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *riscos_bitmap_create(int width, int height, unsigned int state);
+void *riscos_bitmap_create(int width, int height, enum gui_bitmap_flags flags);
 
 /**
  * Free a bitmap.
diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c
index 8679760..85fefea 100644
--- a/frontends/riscos/save.c
+++ b/frontends/riscos/save.c
@@ -243,7 +243,7 @@ ro_gui_save_create_thumbnail(struct hlcache_handle *h, 
const char *name)
        struct bitmap *bitmap;
        osspriteop_area *area;
 
-       bitmap = riscos_bitmap_create(34, 34, BITMAP_NEW | BITMAP_OPAQUE | 
BITMAP_CLEAR_MEMORY);
+       bitmap = riscos_bitmap_create(34, 34, BITMAP_OPAQUE | BITMAP_CLEAR);
        if (!bitmap) {
                NSLOG(netsurf, INFO, "Thumbnail initialisation failed.");
                return false;
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 28ef06f..cb1e548 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -4568,7 +4568,7 @@ ro_gui_window_iconise(struct gui_window *g, 
wimp_full_message_window_info *wi)
 
        /* create the thumbnail sprite */
        bitmap = riscos_bitmap_create(width, height,
-                       BITMAP_NEW | BITMAP_OPAQUE | BITMAP_CLEAR_MEMORY);
+                       BITMAP_OPAQUE | BITMAP_CLEAR);
        if (!bitmap) {
                NSLOG(netsurf, INFO, "Thumbnail initialisation failed.");
                return;
diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c
index ad78a2e..26bc807 100644
--- a/frontends/windows/bitmap.c
+++ b/frontends/windows/bitmap.c
@@ -41,19 +41,19 @@
  * Create a bitmap.
  *
  * \param  width   width of image in pixels
- * \param  height  width of image in pixels
- * \param  state   a flag word indicating the initial state
+ * \param  height  height of image in pixels
+ * \param  state   flags   flags for bitmap creation
  * \return an opaque struct bitmap, or NULL on memory exhaustion
  */
-void *win32_bitmap_create(int width, int height, unsigned int state)
+static void *win32_bitmap_create(int width, int height, enum gui_bitmap_flags 
flags)
 {
        struct bitmap *bitmap;
        BITMAPV5HEADER *pbmi;
        HBITMAP windib;
        uint8_t *pixdata;
 
-       NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height,
-             state);
+       NSLOG(netsurf, INFO, "width %d, height %d, flags %u", width, height,
+             (unsigned)flags);
 
        pbmi = calloc(1, sizeof(BITMAPV5HEADER));
        if (pbmi == NULL) {
@@ -91,7 +91,7 @@ void *win32_bitmap_create(int width, int height, unsigned int 
state)
        bitmap->windib = windib;
        bitmap->pbmi = pbmi;
        bitmap->pixdata = pixdata;
-       if ((state & BITMAP_OPAQUE) != 0) {
+       if ((flags & BITMAP_OPAQUE) != 0) {
                bitmap->opaque = true;
        } else {
                bitmap->opaque = false;
@@ -164,20 +164,6 @@ void win32_bitmap_destroy(void *bitmap)
 
 
 /**
- * Save a bitmap in the platform's native format.
- *
- * \param bitmap a bitmap, as returned by bitmap_create()
- * \param path pathname for file
- * \param flags flags controlling how the bitmap is saved.
- * \return true on success, false on error and error reported
- */
-static bool bitmap_save(void *bitmap, const char *path, unsigned flags)
-{
-       return true;
-}
-
-
-/**
  * The bitmap image has changed, so flush any persistant cache.
  *
  * \param  bitmap  a bitmap, as returned by bitmap_create()
@@ -341,7 +327,7 @@ bitmap_render(struct bitmap *bitmap, struct hlcache_handle 
*content)
        }
 
        /* create a full size bitmap and plot into it */
-       fsbitmap = win32_bitmap_create(width, height, BITMAP_NEW | 
BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
+       fsbitmap = win32_bitmap_create(width, height, BITMAP_CLEAR | 
BITMAP_OPAQUE);
 
        SelectObject(bufferdc, fsbitmap->windib);
 
@@ -375,7 +361,6 @@ static struct gui_bitmap_table bitmap_table = {
        .get_rowstride = bitmap_get_rowstride,
        .get_width = bitmap_get_width,
        .get_height = bitmap_get_height,
-       .save = bitmap_save,
        .modified = bitmap_modified,
        .render = bitmap_render,
 };
diff --git a/frontends/windows/bitmap.h b/frontends/windows/bitmap.h
index c57061d..a370dd6 100644
--- a/frontends/windows/bitmap.h
+++ b/frontends/windows/bitmap.h
@@ -33,8 +33,6 @@ struct bitmap {
 
 struct bitmap *bitmap_scale(struct bitmap *prescale, int width, int height);
 
-void *win32_bitmap_create(int width, int height, unsigned int state);
-
 void win32_bitmap_destroy(void *bitmap);
 
 #endif
diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index d95a172..dfd1188 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -54,10 +54,12 @@
 #ifndef _NETSURF_BITMAP_H_
 #define _NETSURF_BITMAP_H_
 
-#define BITMAP_NEW             0
-#define BITMAP_OPAQUE          (1 << 0) /**< image is opaque */
-#define BITMAP_MODIFIED                (1 << 1) /**< buffer has been modified 
*/
-#define BITMAP_CLEAR_MEMORY    (1 << 2) /**< memory should be wiped */
+/** Bitmap creation flags. */
+enum gui_bitmap_flags {
+       BITMAP_NONE   = 0,
+       BITMAP_OPAQUE = (1 << 0), /**< image is opaque */
+       BITMAP_CLEAR  = (1 << 1), /**< memory should be wiped to 0 */
+};
 
 struct content;
 struct bitmap;
@@ -67,17 +69,17 @@ struct hlcache_handle;
  * Bitmap operations.
  */
 struct gui_bitmap_table {
-       /* Mandantory entries */
+       /* Mandatory entries */
 
        /**
         * Create a new bitmap.
         *
-        * \param width width of image in pixels
-        * \param height width of image in pixels
-        * \param state The state to create the bitmap in.
+        * \param width   width of image in pixels
+        * \param height  height of image in pixels
+        * \param flags   flags for bitmap creation
         * \return A bitmap structure or NULL on error.
         */
-       void *(*create)(int width, int height, unsigned int state);
+       void *(*create)(int width, int height, enum gui_bitmap_flags flags);
 
        /**
         * Destroy a bitmap.
@@ -143,15 +145,6 @@ struct gui_bitmap_table {
        int (*get_height)(void *bitmap);
 
        /**
-        * Save a bitmap to disc.
-        *
-        * \param bitmap The bitmap to save
-        * \param path The path to save the bitmap to.
-        * \param flags Flags affecting the save.
-        */
-       bool (*save)(void *bitmap, const char *path, unsigned flags);
-
-       /**
         * Marks a bitmap as modified.
         *
         * \param bitmap The bitmap set as modified.


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- netsurf-commits@netsurf-browser.org
To unsubscribe send an email to netsurf-commits-le...@netsurf-browser.org

Reply via email to