From 493872389687e16dc4bb4ecf33f4951101d4ca8f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 14 Oct 2012 20:17:17 +0100 Subject: Remove last notion of bitmap suspension. --- image/bitmap.h | 3 +-- riscos/bitmap.c | 35 +---------------------------------- riscos/bitmap.h | 1 - 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/image/bitmap.h b/image/bitmap.h index b85d89c83..3ca5ccdf8 100644 --- a/image/bitmap.h +++ b/image/bitmap.h @@ -61,8 +61,7 @@ #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 */ +#define BITMAP_READY (1 << 4) /** fully initialised */ #define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */ diff --git a/riscos/bitmap.c b/riscos/bitmap.c index 6caaf3e2a..d7836822a 100644 --- a/riscos/bitmap.c +++ b/riscos/bitmap.c @@ -83,14 +83,6 @@ unsigned int bitmap_compressed_size; */ unsigned int bitmap_compressed_used = 0; -/** Total number of suspendable bitmaps -*/ -unsigned int bitmap_suspendable = 0; - -/** Total number of suspended bitmaps -*/ -unsigned int bitmap_suspended = 0; - /** Compressed data header */ struct bitmap_compressed_header { @@ -517,10 +509,6 @@ unsigned char *bitmap_get_buffer(void *vbitmap) return NULL; } - /* reset our suspended flag */ - if (bitmap->state & BITMAP_SUSPENDED) - bitmap->state &= ~BITMAP_SUSPENDED; - /* image is already decompressed, no change to image states */ if (bitmap->sprite_area) return ((unsigned char *) (bitmap->sprite_area)) + 16 + 44; @@ -788,7 +776,6 @@ void bitmap_maintain(void) { unsigned int memory = 0; unsigned int compressed_memory = 0; - unsigned int suspended = 0; struct bitmap *bitmap = bitmap_head; struct bitmap_compressed_header *header; unsigned int maintain_direct_size; @@ -819,8 +806,7 @@ void bitmap_maintain(void) header = (void *) bitmap->compressed; compressed_memory += header->input_size + sizeof(struct bitmap_compressed_header); - } else if (bitmap->state & BITMAP_SUSPENDED) - suspended++; + } } if (!bitmap) { @@ -829,25 +815,6 @@ void bitmap_maintain(void) return; } - /* the fastest and easiest way to release memory is by suspending - * images. as such, we try to do this first for as many images as - * possible, potentially freeing up large amounts of memory */ - if (suspended <= (bitmap_suspendable - bitmap_suspended)) { - for (; bitmap; bitmap = bitmap->next) { - if (bitmap->invalidate) { - bitmap->invalidate(bitmap, bitmap->private_word); - free(bitmap->sprite_area); - bitmap->sprite_area = NULL; - bitmap->state |= BITMAP_SUSPENDED; - bitmap->state &= ~BITMAP_READY; - bitmap_direct_used -= 16 + 44 + - bitmap->width * bitmap->height * 4; - bitmap_suspended++; - } - } - return; - } - /* under heavy loads, we ignore compression */ if (!bitmap_maintenance_priority) { /* for the next section, up until bitmap_COMPRESSED we diff --git a/riscos/bitmap.h b/riscos/bitmap.h index 84c82ced9..b6fd3ae45 100644 --- a/riscos/bitmap.h +++ b/riscos/bitmap.h @@ -32,7 +32,6 @@ struct bitmap { unsigned int state; void *private_word; - void (*invalidate)(void *bitmap, void *private_word); osspriteop_area *sprite_area; /** Uncompressed data, or NULL */ char *compressed; /** Compressed data, or NULL */ -- cgit v1.2.3