summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-14 19:02:09 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2012-10-14 19:02:09 (GMT)
commitefc26882bde6d757e3111fa4684201ff61b30a4c (patch)
treeabd3db7d11ae2acb61ffbea63093c85671a0b28b
parent1ad808fd9b45fe40b26458989c8abd74122e0675 (diff)
downloadlibnsbmp-efc26882bde6d757e3111fa4684201ff61b30a4c.tar.gz
libnsbmp-efc26882bde6d757e3111fa4684201ff61b30a4c.tar.bz2
Remove suspend/invalidate stuff.
-rw-r--r--examples/decode_bmp.c20
-rw-r--r--examples/decode_ico.c20
-rw-r--r--include/libnsbmp.h3
-rw-r--r--src/libnsbmp.c18
4 files changed, 0 insertions, 61 deletions
diff --git a/examples/decode_bmp.c b/examples/decode_bmp.c
index cdeaaf4..e5dc572 100644
--- a/examples/decode_bmp.c
+++ b/examples/decode_bmp.c
@@ -23,9 +23,6 @@
unsigned char *load_file(const char *path, size_t *data_size);
void warning(const char *context, bmp_result code);
void *bitmap_create(int width, int height, unsigned int state);
-void bitmap_set_suspendable(void *bitmap, void *private_word,
- void (*invalidate)(void *bitmap, void *private_word));
-void invalidate(void *bitmap, void *private_word);
unsigned char *bitmap_get_buffer(void *bitmap);
size_t bitmap_get_bpp(void *bitmap);
void bitmap_destroy(void *bitmap);
@@ -36,7 +33,6 @@ int main(int argc, char *argv[])
bmp_bitmap_callback_vt bitmap_callbacks = {
bitmap_create,
bitmap_destroy,
- bitmap_set_suspendable,
bitmap_get_buffer,
bitmap_get_bpp
};
@@ -174,22 +170,6 @@ void *bitmap_create(int width, int height, unsigned int state)
}
-void bitmap_set_suspendable(void *bitmap, void *private_word,
- void (*invalidate)(void *bitmap, void *private_word))
-{
- (void) bitmap; /* unused */
- (void) private_word; /* unused */
- (void) invalidate; /* unused */
-}
-
-
-void invalidate(void *bitmap, void *private_word)
-{
- (void) bitmap; /* unused */
- (void) private_word; /* unused */
-}
-
-
unsigned char *bitmap_get_buffer(void *bitmap)
{
assert(bitmap);
diff --git a/examples/decode_ico.c b/examples/decode_ico.c
index c62b009..935001c 100644
--- a/examples/decode_ico.c
+++ b/examples/decode_ico.c
@@ -27,9 +27,6 @@
unsigned char *load_file(const char *path, size_t *data_size);
void warning(const char *context, bmp_result code);
void *bitmap_create(int width, int height, unsigned int state);
-void bitmap_set_suspendable(void *bitmap, void *private_word,
- void (*invalidate)(void *bitmap, void *private_word));
-void invalidate(void *bitmap, void *private_word);
unsigned char *bitmap_get_buffer(void *bitmap);
size_t bitmap_get_bpp(void *bitmap);
void bitmap_destroy(void *bitmap);
@@ -40,7 +37,6 @@ int main(int argc, char *argv[])
bmp_bitmap_callback_vt bitmap_callbacks = {
bitmap_create,
bitmap_destroy,
- bitmap_set_suspendable,
bitmap_get_buffer,
bitmap_get_bpp
};
@@ -185,22 +181,6 @@ void *bitmap_create(int width, int height, unsigned int state)
}
-void bitmap_set_suspendable(void *bitmap, void *private_word,
- void (*invalidate)(void *bitmap, void *private_word))
-{
- (void) bitmap; /* unused */
- (void) private_word; /* unused */
- (void) invalidate; /* unused */
-}
-
-
-void invalidate(void *bitmap, void *private_word)
-{
- (void) bitmap; /* unused */
- (void) private_word; /* unused */
-}
-
-
unsigned char *bitmap_get_buffer(void *bitmap)
{
assert(bitmap);
diff --git a/include/libnsbmp.h b/include/libnsbmp.h
index 31af9eb..8545377 100644
--- a/include/libnsbmp.h
+++ b/include/libnsbmp.h
@@ -43,8 +43,6 @@ typedef enum {
*/
typedef void* (*bmp_bitmap_cb_create)(int width, int height, unsigned int state);
typedef void (*bmp_bitmap_cb_destroy)(void *bitmap);
-typedef void (*bmp_bitmap_cb_set_suspendable)(void *bitmap, void *private_word,
- void (*invalidate)(void *bitmap, void *private_word));
typedef unsigned char* (*bmp_bitmap_cb_get_buffer)(void *bitmap);
typedef size_t (*bmp_bitmap_cb_get_bpp)(void *bitmap);
@@ -53,7 +51,6 @@ typedef size_t (*bmp_bitmap_cb_get_bpp)(void *bitmap);
typedef struct bmp_bitmap_callback_vt_s {
bmp_bitmap_cb_create bitmap_create; /**< Create a bitmap. */
bmp_bitmap_cb_destroy bitmap_destroy; /**< Free a bitmap. */
- bmp_bitmap_cb_set_suspendable bitmap_set_suspendable; /**< The bitmap image can be suspended. */
bmp_bitmap_cb_get_buffer bitmap_get_buffer; /**< Return a pointer to the pixel data in a bitmap. */
bmp_bitmap_cb_get_bpp bitmap_get_bpp; /**< Find the width of a pixel row in bytes. */
} bmp_bitmap_callback_vt;
diff --git a/src/libnsbmp.c b/src/libnsbmp.c
index 976b513..bcbf21a 100644
--- a/src/libnsbmp.c
+++ b/src/libnsbmp.c
@@ -115,7 +115,6 @@ static bmp_result bmp_decode_rgb16(bmp_image *bmp, uint8_t **start, int bytes);
static bmp_result bmp_decode_rgb(bmp_image *bmp, uint8_t **start, int bytes);
static bmp_result bmp_decode_mask(bmp_image *bmp, uint8_t *data, int bytes);
static bmp_result bmp_decode_rle(bmp_image *bmp, uint8_t *data, int bytes, int size);
-static void bmp_invalidate(void *bitmap, void *private_word);
@@ -553,7 +552,6 @@ static bmp_result bmp_analyse_header(bmp_image *bmp, uint8_t *data) {
*/
if (bmp->ico)
bmp->bitmap_offset = (intptr_t)data - (intptr_t)bmp->bmp_data;
- bmp->bitmap_callbacks.bitmap_set_suspendable(bmp->bitmap, bmp, bmp_invalidate);
return BMP_OK;
}
@@ -593,22 +591,6 @@ bmp_image *ico_find(ico_collection *ico, uint16_t width, uint16_t height) {
/**
- * Invalidates a BMP
- *
- * This function sets the BMP into a state such that the bitmap image data
- * can be released from memory.
- *
- * \param bmp the BMP image to invalidate
- */
-static void bmp_invalidate(void *bitmap, void *private_word) {
- bmp_image *bmp = (bmp_image *)private_word;
- UNUSED(bitmap);
-
- bmp->decoded = false;
-}
-
-
-/**
* Decode a BMP
*
* This function decodes the BMP data such that bmp->bitmap is a valid