mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
Only set opaque on initial alloc, add flag for clearing buffer on realloc.
svn path=/trunk/netsurf/; revision=13378
This commit is contained in:
parent
7314d12cba
commit
d5d0289010
@ -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;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#define BITMAP_SHRINK 0
|
||||
#define BITMAP_GROW 0x1024
|
||||
#define BITMAP_MONOGLYPH 0x2048
|
||||
#define BITMAP_CLEAR 0x4096
|
||||
|
||||
struct bitmap {
|
||||
int width;
|
||||
|
Loading…
Reference in New Issue
Block a user