Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/bc5918ebbc01a4d5022c8b3b308af41318097c84
...commit
http://git.netsurf-browser.org/netsurf.git/commit/bc5918ebbc01a4d5022c8b3b308af41318097c84
...tree
http://git.netsurf-browser.org/netsurf.git/tree/bc5918ebbc01a4d5022c8b3b308af41318097c84
The branch, chris/palette-mapped-plotters has been updated
via bc5918ebbc01a4d5022c8b3b308af41318097c84 (commit)
via e4d2677c80985914b2b37efd5d0a70a1856741b2 (commit)
from 56967bbf0657fb52605f17cb56de595a3e6cf159 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/bc5918ebbc01a4d5022c8b3b308af41318097c84
commit bc5918ebbc01a4d5022c8b3b308af41318097c84
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
allocate our bitmaps as BMF_DISPLAYABLE as this can improve performance
when blitting to the screen
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 53de5cf..4d20fb4 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -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;
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 721596f..941587e 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -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","");
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/e4d2677c80985914b2b37efd5d0a70a1856741b2
commit e4d2677c80985914b2b37efd5d0a70a1856741b2
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
first attempt to create our own mask of only wholly transparent pixels.
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index a80fb0e..53de5cf 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -120,16 +120,20 @@ void bitmap_destroy(void *bitmap)
{
if((bm->nativebm) && (bm->dto == NULL)) {
p96FreeBitMap(bm->nativebm);
- bm->nativebm = NULL;
}
if(bm->dto) {
DisposeDTObject(bm->dto);
- bm->dto = NULL;
}
+ if(bm->native_mask) FreeRaster(bm->native_mask, bm->width,
bm->height);
+
FreeVec(bm->pixdata);
bm->pixdata = NULL;
+ bm->nativebm = NULL;
+ bm->native_mask = NULL;
+ bm->dto = NULL;
+
FreeVec(bm);
bm = NULL;
}
@@ -174,6 +178,8 @@ void bitmap_modified(void *bitmap) {
p96FreeBitMap(bm->nativebm);
if(bm->dto) DisposeDTObject(bm->dto);
+ if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
+
bm->nativebm = NULL;
bm->dto = NULL;
bm->native_mask = NULL;
@@ -468,6 +474,31 @@ static struct BitMap *ami_bitmap_get_truecolour(struct
bitmap *bitmap,int width,
return tbm;
}
+static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int
height)
+{
+ uint32 *bmi = (uint32 *) bitmap->pixdata;
+ UBYTE maskbit = 0;
+ int y, x;
+
+ if((height != bitmap->height) || (width != bitmap->width)) return NULL;
+ if(bitmap_get_opaque(bitmap) == true) return NULL;
+ 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;
+ else maskbit = 0;
+ bmi++;
+ bitmap->native_mask[(y*4) + (x/8)] =
+ (bitmap->native_mask[(y*4) + (x/8)] << 1) |
maskbit;
+ }
+ }
+
+ return bitmap->native_mask;
+}
+
static struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
int width, int height)
{
@@ -504,12 +535,14 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct
bitmap *bitmap,
GetDTAttrs(bitmap->dto,
PDTA_DestBitMap, &dtbm,
- PDTA_MaskPlane, &bitmap->native_mask,
+ //PDTA_MaskPlane, &bitmap->native_mask,
TAG_END);
bitmap->nativebmwidth = width;
bitmap->nativebmheight = height;
+ ami_bitmap_get_mask(bitmap, width, height);
+
return dtbm;
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 66c996e..721596f 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -678,9 +678,10 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
} else {
tag = BLITA_MaskPlane;
tag_data = (ULONG)bitmap->native_mask;
- minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
+ minterm = (ABC|ABNC|ANBC);
}
-
+ //BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width,
height, (ABC|ABNC|ANBC), bitmap->native_mask);
+
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
-----------------------------------------------------------------------
Summary of changes:
amiga/bitmap.c | 45 +++++++++++++++++++++++++++++++++++++++++----
amiga/plotters.c | 10 ++++++----
2 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index a80fb0e..4d20fb4 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -120,16 +120,20 @@ void bitmap_destroy(void *bitmap)
{
if((bm->nativebm) && (bm->dto == NULL)) {
p96FreeBitMap(bm->nativebm);
- bm->nativebm = NULL;
}
if(bm->dto) {
DisposeDTObject(bm->dto);
- bm->dto = NULL;
}
-
+#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;
+ bm->native_mask = NULL;
+ bm->dto = NULL;
+
FreeVec(bm);
bm = NULL;
}
@@ -174,6 +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;
@@ -468,6 +475,31 @@ static struct BitMap *ami_bitmap_get_truecolour(struct
bitmap *bitmap,int width,
return tbm;
}
+static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int
height)
+{
+ uint32 *bmi = (uint32 *) bitmap->pixdata;
+ UBYTE maskbit = 0;
+ int y, x;
+
+ if((height != bitmap->height) || (width != bitmap->width)) return NULL;
+ if(bitmap_get_opaque(bitmap) == true) return NULL;
+ 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;
+ else maskbit = 0;
+ bmi++;
+ bitmap->native_mask[(y*4) + (x/8)] =
+ (bitmap->native_mask[(y*4) + (x/8)] << 1) |
maskbit;
+ }
+ }
+
+ return bitmap->native_mask;
+}
+
static struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
int width, int height)
{
@@ -504,12 +536,17 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct
bitmap *bitmap,
GetDTAttrs(bitmap->dto,
PDTA_DestBitMap, &dtbm,
+#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;
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 66c996e..941587e 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -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","");
@@ -678,9 +679,10 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
} else {
tag = BLITA_MaskPlane;
tag_data = (ULONG)bitmap->native_mask;
- minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
+ minterm = (ABC|ABNC|ANBC);
}
-
+ //BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width,
height, (ABC|ABNC|ANBC), bitmap->native_mask);
+
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org