diff options
author | Ole Loots <ole@monochrom.net> | 2012-01-06 21:57:42 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-01-06 21:57:42 +0000 |
commit | d5d02890104ce40ccdf2fca4cfde92dda30e7053 (patch) | |
tree | 38d653eb105f235f92647c0688469f3c2dc7c22b /atari | |
parent | 7314d12cbab5f4efdf3fe9d0fbe389e2b965bde6 (diff) | |
download | netsurf-d5d02890104ce40ccdf2fca4cfde92dda30e7053.tar.gz netsurf-d5d02890104ce40ccdf2fca4cfde92dda30e7053.tar.bz2 |
Only set opaque on initial alloc, add flag for clearing buffer on realloc.
svn path=/trunk/netsurf/; revision=13378
Diffstat (limited to 'atari')
-rwxr-xr-x | atari/bitmap.c | 5 | ||||
-rwxr-xr-x | atari/bitmap.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/atari/bitmap.c b/atari/bitmap.c index 9a0bd96ac..f991d9fc7 100755 --- a/atari/bitmap.c +++ b/atari/bitmap.c @@ -105,6 +105,7 @@ void * bitmap_realloc( int w, int h, short bpp, int rowstride, unsigned int stat assert( 1 == 0 ); /* add some buffer for bad code */ bitmap->pixdata = malloc( newsize + 128 ); + bitmap->opaque = false; } else { int oldsize = bitmap->rowstride * bitmap->height; bool doalloc = ( state == BITMAP_GROW) ? (newsize > oldsize) : (newsize != oldsize); @@ -116,10 +117,12 @@ void * bitmap_realloc( int w, int h, short bpp, int rowstride, unsigned int stat return( NULL ); } } + if( state & BITMAP_CLEAR ){ + memset( bitmap->pixdata, 0x00, newsize + 128 ); + } bitmap->width = w; bitmap->height = h; - bitmap->opaque = false; bitmap->bpp = bpp; bitmap->resized = NULL; bitmap->rowstride = rowstride; diff --git a/atari/bitmap.h b/atari/bitmap.h index 783176053..d1756185d 100755 --- a/atari/bitmap.h +++ b/atari/bitmap.h @@ -22,6 +22,7 @@ #define BITMAP_SHRINK 0 #define BITMAP_GROW 0x1024 #define BITMAP_MONOGLYPH 0x2048 +#define BITMAP_CLEAR 0x4096 struct bitmap { int width; |