summaryrefslogtreecommitdiff
path: root/amiga/bitmap.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-12-28 15:55:52 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-12-28 15:55:52 +0000
commit605cf900b483dc3baebc21e394e64d905a31bd60 (patch)
tree9a3a66236c9c8f4024fa53d6fc789d56f1d34cfb /amiga/bitmap.c
parentc059f24cfa7ee7d86c9b7121b6406eca468e35a7 (diff)
downloadnetsurf-605cf900b483dc3baebc21e394e64d905a31bd60.tar.gz
netsurf-605cf900b483dc3baebc21e394e64d905a31bd60.tar.bz2
Some bitmap caching - not making much difference and using up a lot of gfx mem, may
need to make this a configurable option. svn path=/trunk/netsurf/; revision=5943
Diffstat (limited to 'amiga/bitmap.c')
-rw-r--r--amiga/bitmap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 77f85d1df..271f4af1b 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -20,6 +20,7 @@
#include "image/bitmap.h"
#include "amiga/bitmap.h"
#include <proto/exec.h>
+#include <proto/picasso96api.h>
/**
* Create a bitmap.
@@ -34,7 +35,7 @@ void *bitmap_create(int width, int height, unsigned int state)
{
struct bitmap *bitmap;
- bitmap = AllocVec(sizeof(struct bitmap),MEMF_PRIVATE);
+ bitmap = AllocVec(sizeof(struct bitmap),MEMF_PRIVATE | MEMF_CLEAR);
if(bitmap)
{
bitmap->pixdata = AllocVecTags(width*height*4,
@@ -101,6 +102,7 @@ void bitmap_destroy(void *bitmap)
if(bm)
{
+ if(bm->nativebm) p96FreeBitMap(bm->nativebm);
FreeVec(bm->pixdata);
bm->pixdata = NULL;
FreeVec(bm);
@@ -129,6 +131,10 @@ bool bitmap_save(void *bitmap, const char *path, unsigned flags)
* \param bitmap a bitmap, as returned by bitmap_create()
*/
void bitmap_modified(void *bitmap) {
+ struct bitmap *bm = bitmap;
+
+ p96FreeBitMap(bm->nativebm);
+ bm->nativebm = NULL;
}