diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-02-22 01:58:19 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-02-22 01:58:19 +0000 |
commit | 3d9a1198db571973e2760d6f27c771cbe31c844b (patch) | |
tree | 5a306a7fdf135f63fa1bd031924fb18edc5ecc2b /image/bitmap.h | |
parent | 01cc7987c7af26c70269c81e9d344fd2e91a8793 (diff) | |
download | netsurf-3d9a1198db571973e2760d6f27c771cbe31c844b.tar.gz netsurf-3d9a1198db571973e2760d6f27c771cbe31c844b.tar.bz2 |
[project @ 2006-02-22 01:58:19 by rjw]
Reduce constant bitmap overhead per reference by moving to a flag word. Allow bitmaps to be reduced back to their raw data to free extra memory in a highly efficient manner.
svn path=/import/netsurf/; revision=2089
Diffstat (limited to 'image/bitmap.h')
-rw-r--r-- | image/bitmap.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/image/bitmap.h b/image/bitmap.h index c187b3ecb..bae1e1a15 100644 --- a/image/bitmap.h +++ b/image/bitmap.h @@ -20,18 +20,20 @@ #include <stdbool.h> #include <stdlib.h> -typedef enum { - BITMAP_READY, /** Bitmap buffer is ready */ - BITMAP_ALLOCATE_MEMORY, /** Allocate memory */ - BITMAP_CLEAR_MEMORY, /** Clear the memory */ -} bitmap_state; +#define BITMAP_NEW 0 +#define BITMAP_OPAQUE (1 << 0) /** image is opaque */ +#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */ +#define BITMAP_PERSISTENT (1 << 2) /** retain between sessions */ +#define BITMAP_CLEAR_MEMORY (1 << 3) /** memory should be wiped */ +#define BITMAP_SUSPENDED (1 << 4) /** currently suspended */ +#define BITMAP_READY (1 << 5) /** fully initialised */ struct content; /** An opaque image. */ struct bitmap; -struct bitmap *bitmap_create(int width, int height, bitmap_state state); +struct bitmap *bitmap_create(int width, int height, unsigned int state); void bitmap_set_opaque(struct bitmap *bitmap, bool opaque); bool bitmap_test_opaque(struct bitmap *bitmap); bool bitmap_get_opaque(struct bitmap *bitmap); @@ -40,5 +42,7 @@ size_t bitmap_get_rowstride(struct bitmap *bitmap); void bitmap_destroy(struct bitmap *bitmap); bool bitmap_save(struct bitmap *bitmap, const char *path); void bitmap_modified(struct bitmap *bitmap); +void bitmap_set_suspendable(struct bitmap *bitmap, void *private_word, + void (*invalidate)(struct bitmap *bitmap, void *private_word)); #endif |