mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
allocate our bitmaps as BMF_DISPLAYABLE as this can improve performance when blitting to the screen
This commit is contained in:
parent
e4d2677c80
commit
bc5918ebbc
@ -125,9 +125,9 @@ void bitmap_destroy(void *bitmap)
|
||||
if(bm->dto) {
|
||||
DisposeDTObject(bm->dto);
|
||||
}
|
||||
|
||||
#ifdef AMI_CUSTOM_MASK
|
||||
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
||||
|
||||
#endif
|
||||
FreeVec(bm->pixdata);
|
||||
bm->pixdata = NULL;
|
||||
bm->nativebm = NULL;
|
||||
@ -178,8 +178,9 @@ void bitmap_modified(void *bitmap) {
|
||||
p96FreeBitMap(bm->nativebm);
|
||||
|
||||
if(bm->dto) DisposeDTObject(bm->dto);
|
||||
#ifdef AMI_CUSTOM_MASK
|
||||
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
||||
|
||||
#endif
|
||||
bm->nativebm = NULL;
|
||||
bm->dto = NULL;
|
||||
bm->native_mask = NULL;
|
||||
@ -485,7 +486,7 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height
|
||||
if(bitmap->native_mask) return bitmap->native_mask;
|
||||
|
||||
bitmap->native_mask = AllocRaster(width, height);
|
||||
|
||||
|
||||
for(y=0; y<height; y++) {
|
||||
for(x=0; x<width; x++) {
|
||||
if ((*bmi & 0xff000000U) == 0x00000000U) maskbit = 1;
|
||||
@ -535,14 +536,17 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
|
||||
|
||||
GetDTAttrs(bitmap->dto,
|
||||
PDTA_DestBitMap, &dtbm,
|
||||
//PDTA_MaskPlane, &bitmap->native_mask,
|
||||
#ifndef AMI_CUSTOM_MASK
|
||||
PDTA_MaskPlane, &bitmap->native_mask,
|
||||
#endif
|
||||
TAG_END);
|
||||
|
||||
bitmap->nativebmwidth = width;
|
||||
bitmap->nativebmheight = height;
|
||||
|
||||
|
||||
#ifdef AMI_CUSTOM_MASK
|
||||
ami_bitmap_get_mask(bitmap, width, height);
|
||||
|
||||
#endif
|
||||
return dtbm;
|
||||
}
|
||||
|
||||
|
@ -154,10 +154,11 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
|
||||
gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
|
||||
|
||||
if(palette_mapped == true) {
|
||||
gg->bm = AllocBitMap(width, height, depth, BMF_INTERLEAVED, friend);
|
||||
gg->bm = AllocBitMap(width, height, depth,
|
||||
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend);
|
||||
} else {
|
||||
gg->bm = p96AllocBitMap(width, height, 32,
|
||||
BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8);
|
||||
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend, RGBFB_A8R8G8B8);
|
||||
}
|
||||
|
||||
if(!gg->bm) warn_user("NoMemory","");
|
||||
|
Loading…
Reference in New Issue
Block a user