Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/6aaf1065752b13896f71cb489e11388cb9c444d6
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/6aaf1065752b13896f71cb489e11388cb9c444d6
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/6aaf1065752b13896f71cb489e11388cb9c444d6

The branch, chris/palette-mapped-plotters has been updated
       via  6aaf1065752b13896f71cb489e11388cb9c444d6 (commit)
       via  bc4401414b7c964544354a92795cff007b56064d (commit)
       via  ad1336ac45a993ce911036844a95807dbbda61f6 (commit)
       via  3ed1339b3fc0f701417bbf0a618ed3bc6997f9fa (commit)
       via  7c9ac8980f9af36df59654a0843cf8a72f47a2ec (commit)
       via  2364d68367dcd6b901ec8d5e02a240ffc9b3acec (commit)
       via  eaa6183567b1c9b5726a77d30e885c8b299cae6e (commit)
       via  a0b344afe6069e77058d383d092ba773c6ecf32e (commit)
       via  c456153e902177da27d99fc3baca4fcd89f6de6c (commit)
      from  bc5918ebbc01a4d5022c8b3b308af41318097c84 (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/6aaf1065752b13896f71cb489e11388cb9c444d6
commit 6aaf1065752b13896f71cb489e11388cb9c444d6
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    remove AMI_CUSTOM_MASK define

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 7a3e701..381958b 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -16,8 +16,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define AMI_CUSTOM_MASK 1
-
 #include "amiga/os3support.h"
 
 #include "assert.h"
@@ -127,9 +125,8 @@ 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;
@@ -180,9 +177,7 @@ 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;
@@ -552,17 +547,12 @@ 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;
 }
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/bc4401414b7c964544354a92795cff007b56064d
commit bc4401414b7c964544354a92795cff007b56064d
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    remove attempt at mask alignment

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 95d2947..7a3e701 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -490,8 +490,15 @@ PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int 
width, int height)
        bitmap->native_mask = AllocRaster(width, height);
 
        w = width / 8;
-       if((width % 8) != 0) w++;
 
+/*
+       int wu = width;
+       while((wu % 16) != 0) {
+               wu += 8;
+               w++;
+       }
+*/
+       
        for(int i=0; i<(height * (width / 8)); i++) {
                bitmap->native_mask[i] = 0;
        }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/ad1336ac45a993ce911036844a95807dbbda61f6
commit ad1336ac45a993ce911036844a95807dbbda61f6
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    alignment attempt 2. this seems right, but doesn't work even for 
previously-working images

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index b601e48..95d2947 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -481,15 +481,17 @@ PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int 
width, int height)
 {
        uint32 *bmi = (uint32 *) bitmap->pixdata;
        UBYTE maskbit = 0;
-       int y, x;
+       int y, x, w;
 
        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);
-       while((width % 8) != 0) width++; 
-       
+
+       w = width / 8;
+       if((width % 8) != 0) w++;
+
        for(int i=0; i<(height * (width / 8)); i++) {
                bitmap->native_mask[i] = 0;
        }
@@ -499,8 +501,8 @@ PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int 
width, int height)
                        if ((*bmi & 0x000000ffU) <= 
(ULONG)nsoption_int(mask_alpha)) maskbit = 0;
                                else maskbit = 1;
                        bmi++;
-                       bitmap->native_mask[(y*(width/8)) + (x/8)] =
-                               (bitmap->native_mask[(y*(width/8)) + (x/8)] << 
1) | maskbit;
+                       bitmap->native_mask[(y*w) + (x/8)] =
+                               (bitmap->native_mask[(y*w) + (x/8)] << 1) | 
maskbit;
                }
        }
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/3ed1339b3fc0f701417bbf0a618ed3bc6997f9fa
commit 3ed1339b3fc0f701417bbf0a618ed3bc6997f9fa
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    try to align mask correctly

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 27be516..b601e48 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -488,7 +488,8 @@ 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);
-
+       while((width % 8) != 0) width++; 
+       
        for(int i=0; i<(height * (width / 8)); i++) {
                bitmap->native_mask[i] = 0;
        }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/7c9ac8980f9af36df59654a0843cf8a72f47a2ec
commit 7c9ac8980f9af36df59654a0843cf8a72f47a2ec
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    use minterm (ABC|ABNC|ANBC) only when necessary

diff --git a/amiga/plotters.c b/amiga/plotters.c
index 4760dcd..f12ef1a 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -670,7 +670,7 @@ static bool ami_bitmap(int x, int y, int width, int height, 
struct bitmap *bitma
        }
        else
        {
-               ULONG tag, tag_data, minterm;
+               ULONG tag, tag_data, minterm = 0xc0;
                
                if(palette_mapped == false) {
                        tag = BLITA_UseSrcAlpha;
@@ -678,8 +678,8 @@ static bool ami_bitmap(int x, int y, int width, int height, 
struct bitmap *bitma
                        minterm = 0xc0;
                } else {
                        tag = BLITA_MaskPlane;
-                       tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height);
-                       minterm = (ABC|ABNC|ANBC);
+                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height))
+                               minterm = (ABC|ABNC|ANBC);
                }
 
                BltBitMapTags(BLITA_Width,width,
@@ -830,7 +830,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct 
RastPort *rp,struct Ba
                        }
                        else
                        {
-                               ULONG tag, tag_data, minterm;
+                               ULONG tag, tag_data, minterm = 0xc0;
                
                                if(palette_mapped == false) {
                                        tag = BLITA_UseSrcAlpha;
@@ -838,8 +838,8 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct 
RastPort *rp,struct Ba
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = (ULONG)bfbm->mask;
-                                       minterm = (ABC|ABNC|ANBC);
+                                       if(tag_data = (ULONG)bfbm->mask)
+                                               minterm = (ABC|ABNC|ANBC);
                                }
                
                                BltBitMapTags(BLITA_Width, bfbm->width,


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/2364d68367dcd6b901ec8d5e02a240ffc9b3acec
commit 2364d68367dcd6b901ec8d5e02a240ffc9b3acec
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    avoid scaled images getting incorrect mask

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index e28b214..27be516 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -477,7 +477,7 @@ 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)
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
 {
        uint32 *bmi = (uint32 *) bitmap->pixdata;
        UBYTE maskbit = 0;
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index bf25e8e..87c569f 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -44,6 +44,8 @@ struct bitmap {
 
 struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
                                int width, int height, struct BitMap *friendbm);
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height);
+
 Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
 struct bitmap *ami_bitmap_from_datatype(char *filename);
 #endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 5ec3815..d7e08f0 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3845,8 +3845,8 @@ void gui_window_set_icon(struct gui_window *g, 
hlcache_handle *icon)
                                minterm = 0xc0;
                        } else {
                                tag = BLITA_MaskPlane;
-                               tag_data = (ULONG)icon_bitmap->native_mask;
-                               minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
+                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16);
+                               minterm = (ABC|ABNC|ANBC);
                        }
                
                        BltBitMapTags(BLITA_SrcX, 0,
@@ -3928,8 +3928,8 @@ void gui_window_set_search_ico(hlcache_handle *ico)
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = 
(ULONG)ico_bitmap->native_mask;
-                                       minterm = 0xc0; /* should be 
(ABC|ABNC|ANBC); */
+                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16);
+                                       minterm = (ABC|ABNC|ANBC);
                                }
 
                                BltBitMapTags(BLITA_SrcX, 0,
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 941587e..4760dcd 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -678,10 +678,9 @@ static bool ami_bitmap(int x, int y, int width, int 
height, struct bitmap *bitma
                        minterm = 0xc0;
                } else {
                        tag = BLITA_MaskPlane;
-                       tag_data = (ULONG)bitmap->native_mask;
+                       tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height);
                        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,
@@ -783,7 +782,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
                bfbm.height = height;
                bfbm.offsetx = ox;
                bfbm.offsety = oy;
-               bfbm.mask = bitmap->native_mask;
+               bfbm.mask = ami_bitmap_get_mask(bitmap, width, height);;
                bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
                bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
                bfh->h_SubEntry = 0;
@@ -840,7 +839,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct 
RastPort *rp,struct Ba
                                } else {
                                        tag = BLITA_MaskPlane;
                                        tag_data = (ULONG)bfbm->mask;
-                                       minterm = 0xc0; /* Should be 
(ABC|ABNC|ANBC) */
+                                       minterm = (ABC|ABNC|ANBC);
                                }
                
                                BltBitMapTags(BLITA_Width, bfbm->width,


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/eaa6183567b1c9b5726a77d30e885c8b299cae6e
commit eaa6183567b1c9b5726a77d30e885c8b299cae6e
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    allow tweaking threshold where alpha turns to mask

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index a6c24b1..e28b214 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -495,7 +495,7 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, 
int width, int height
 
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
-                       if ((*bmi & 0x000000ffU) == 0x00000000U) maskbit = 0;
+                       if ((*bmi & 0x000000ffU) <= 
(ULONG)nsoption_int(mask_alpha)) maskbit = 0;
                                else maskbit = 1;
                        bmi++;
                        bitmap->native_mask[(y*(width/8)) + (x/8)] =
diff --git a/amiga/options.h b/amiga/options.h
index 41bf104..ed5bc93 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -50,6 +50,7 @@
        bool faster_scroll;                     \
        bool scale_quality;                     \
        int dither_quality;                     \
+       int mask_alpha;                         \
        bool ask_overwrite;                     \
        int printer_unit;                       \
        int print_scale;                        \
@@ -111,6 +112,7 @@
        .faster_scroll = true,                          \
        .scale_quality = false,                         \
        .dither_quality = 1,                            \
+       .mask_alpha = 0,                                        \
        .ask_overwrite = true,                          \
        .printer_unit = 0,                              \
        .print_scale = 100,                             \
@@ -171,6 +173,7 @@
 { "faster_scroll",     OPTION_BOOL,    &nsoptions.faster_scroll}, \
 { "scale_quality",     OPTION_BOOL,    &nsoptions.scale_quality}, \
 { "dither_quality",    OPTION_INTEGER, &nsoptions.dither_quality}, \
+{ "mask_alpha",                OPTION_INTEGER, &nsoptions.mask_alpha}, \
 { "ask_overwrite",     OPTION_BOOL,    &nsoptions.ask_overwrite}, \
 { "printer_unit",      OPTION_INTEGER, &nsoptions.printer_unit}, \
 { "print_scale",       OPTION_INTEGER, &nsoptions.print_scale}, \


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/a0b344afe6069e77058d383d092ba773c6ecf32e
commit a0b344afe6069e77058d383d092ba773c6ecf32e
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Fix mask

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index db54245..a6c24b1 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -495,8 +495,8 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, 
int width, int height
 
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
-                       if ((*bmi & 0x000000ffU) == 0x00000000U) maskbit = 1;
-                               else maskbit = 0;
+                       if ((*bmi & 0x000000ffU) == 0x00000000U) maskbit = 0;
+                               else maskbit = 1;
                        bmi++;
                        bitmap->native_mask[(y*(width/8)) + (x/8)] =
                                (bitmap->native_mask[(y*(width/8)) + (x/8)] << 
1) | maskbit;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/c456153e902177da27d99fc3baca4fcd89f6de6c
commit c456153e902177da27d99fc3baca4fcd89f6de6c
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Correct byte order - is RGBA not ARGB
    Fix mask offset calculation

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 4d20fb4..db54245 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008, 2009 Chris Young <[email protected]>
+ * Copyright 2008, 2009, 2012 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -16,6 +16,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define AMI_CUSTOM_MASK 1
+
 #include "amiga/os3support.h"
 
 #include "assert.h"
@@ -230,7 +232,7 @@ bool bitmap_test_opaque(void *bitmap)
 
        for(a=0;a<p;a+=4)
        {
-               if ((*bmi & 0xff000000U) != 0xff000000U) return false;
+               if ((*bmi & 0x000000ffU) != 0x000000ffU) return false;
                bmi++;
        }
        return true;
@@ -487,13 +489,17 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap 
*bitmap, int width, int height
 
        bitmap->native_mask = AllocRaster(width, height);
 
+       for(int i=0; i<(height * (width / 8)); i++) {
+               bitmap->native_mask[i] = 0;
+       }
+
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
-                       if ((*bmi & 0xff000000U) == 0x00000000U) maskbit = 1;
+                       if ((*bmi & 0x000000ffU) == 0x00000000U) maskbit = 1;
                                else maskbit = 0;
                        bmi++;
-                       bitmap->native_mask[(y*4) + (x/8)] =
-                               (bitmap->native_mask[(y*4) + (x/8)] << 1) | 
maskbit;
+                       bitmap->native_mask[(y*(width/8)) + (x/8)] =
+                               (bitmap->native_mask[(y*(width/8)) + (x/8)] << 
1) | maskbit;
                }
        }
 


-----------------------------------------------------------------------

Summary of changes:
 amiga/bitmap.c   |   40 +++++++++++++++++++++++-----------------
 amiga/bitmap.h   |    2 ++
 amiga/gui.c      |    8 ++++----
 amiga/options.h  |    3 +++
 amiga/plotters.c |   15 +++++++--------
 5 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 4d20fb4..381958b 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008, 2009 Chris Young <[email protected]>
+ * Copyright 2008, 2009, 2012 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -125,9 +125,8 @@ 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,9 +177,7 @@ 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;
@@ -230,7 +227,7 @@ bool bitmap_test_opaque(void *bitmap)
 
        for(a=0;a<p;a+=4)
        {
-               if ((*bmi & 0xff000000U) != 0xff000000U) return false;
+               if ((*bmi & 0x000000ffU) != 0x000000ffU) return false;
                bmi++;
        }
        return true;
@@ -475,11 +472,11 @@ 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)
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
 {
        uint32 *bmi = (uint32 *) bitmap->pixdata;
        UBYTE maskbit = 0;
-       int y, x;
+       int y, x, w;
 
        if((height != bitmap->height) || (width != bitmap->width)) return NULL;
        if(bitmap_get_opaque(bitmap) == true) return NULL;
@@ -487,13 +484,27 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap 
*bitmap, int width, int height
 
        bitmap->native_mask = AllocRaster(width, height);
 
+       w = width / 8;
+
+/*
+       int wu = width;
+       while((wu % 16) != 0) {
+               wu += 8;
+               w++;
+       }
+*/
+       
+       for(int i=0; i<(height * (width / 8)); i++) {
+               bitmap->native_mask[i] = 0;
+       }
+
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
-                       if ((*bmi & 0xff000000U) == 0x00000000U) maskbit = 1;
-                               else maskbit = 0;
+                       if ((*bmi & 0x000000ffU) <= 
(ULONG)nsoption_int(mask_alpha)) maskbit = 0;
+                               else maskbit = 1;
                        bmi++;
-                       bitmap->native_mask[(y*4) + (x/8)] =
-                               (bitmap->native_mask[(y*4) + (x/8)] << 1) | 
maskbit;
+                       bitmap->native_mask[(y*w) + (x/8)] =
+                               (bitmap->native_mask[(y*w) + (x/8)] << 1) | 
maskbit;
                }
        }
 
@@ -536,17 +547,12 @@ 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/bitmap.h b/amiga/bitmap.h
index bf25e8e..87c569f 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -44,6 +44,8 @@ struct bitmap {
 
 struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
                                int width, int height, struct BitMap *friendbm);
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height);
+
 Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
 struct bitmap *ami_bitmap_from_datatype(char *filename);
 #endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 5ec3815..d7e08f0 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3845,8 +3845,8 @@ void gui_window_set_icon(struct gui_window *g, 
hlcache_handle *icon)
                                minterm = 0xc0;
                        } else {
                                tag = BLITA_MaskPlane;
-                               tag_data = (ULONG)icon_bitmap->native_mask;
-                               minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
+                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16);
+                               minterm = (ABC|ABNC|ANBC);
                        }
                
                        BltBitMapTags(BLITA_SrcX, 0,
@@ -3928,8 +3928,8 @@ void gui_window_set_search_ico(hlcache_handle *ico)
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = 
(ULONG)ico_bitmap->native_mask;
-                                       minterm = 0xc0; /* should be 
(ABC|ABNC|ANBC); */
+                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16);
+                                       minterm = (ABC|ABNC|ANBC);
                                }
 
                                BltBitMapTags(BLITA_SrcX, 0,
diff --git a/amiga/options.h b/amiga/options.h
index 41bf104..ed5bc93 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -50,6 +50,7 @@
        bool faster_scroll;                     \
        bool scale_quality;                     \
        int dither_quality;                     \
+       int mask_alpha;                         \
        bool ask_overwrite;                     \
        int printer_unit;                       \
        int print_scale;                        \
@@ -111,6 +112,7 @@
        .faster_scroll = true,                          \
        .scale_quality = false,                         \
        .dither_quality = 1,                            \
+       .mask_alpha = 0,                                        \
        .ask_overwrite = true,                          \
        .printer_unit = 0,                              \
        .print_scale = 100,                             \
@@ -171,6 +173,7 @@
 { "faster_scroll",     OPTION_BOOL,    &nsoptions.faster_scroll}, \
 { "scale_quality",     OPTION_BOOL,    &nsoptions.scale_quality}, \
 { "dither_quality",    OPTION_INTEGER, &nsoptions.dither_quality}, \
+{ "mask_alpha",                OPTION_INTEGER, &nsoptions.mask_alpha}, \
 { "ask_overwrite",     OPTION_BOOL,    &nsoptions.ask_overwrite}, \
 { "printer_unit",      OPTION_INTEGER, &nsoptions.printer_unit}, \
 { "print_scale",       OPTION_INTEGER, &nsoptions.print_scale}, \
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 941587e..f12ef1a 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -670,7 +670,7 @@ static bool ami_bitmap(int x, int y, int width, int height, 
struct bitmap *bitma
        }
        else
        {
-               ULONG tag, tag_data, minterm;
+               ULONG tag, tag_data, minterm = 0xc0;
                
                if(palette_mapped == false) {
                        tag = BLITA_UseSrcAlpha;
@@ -678,10 +678,9 @@ static bool ami_bitmap(int x, int y, int width, int 
height, struct bitmap *bitma
                        minterm = 0xc0;
                } else {
                        tag = BLITA_MaskPlane;
-                       tag_data = (ULONG)bitmap->native_mask;
-                       minterm = (ABC|ABNC|ANBC);
+                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height))
+                               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,
@@ -783,7 +782,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
                bfbm.height = height;
                bfbm.offsetx = ox;
                bfbm.offsety = oy;
-               bfbm.mask = bitmap->native_mask;
+               bfbm.mask = ami_bitmap_get_mask(bitmap, width, height);;
                bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
                bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
                bfh->h_SubEntry = 0;
@@ -831,7 +830,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct 
RastPort *rp,struct Ba
                        }
                        else
                        {
-                               ULONG tag, tag_data, minterm;
+                               ULONG tag, tag_data, minterm = 0xc0;
                
                                if(palette_mapped == false) {
                                        tag = BLITA_UseSrcAlpha;
@@ -839,8 +838,8 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct 
RastPort *rp,struct Ba
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = (ULONG)bfbm->mask;
-                                       minterm = 0xc0; /* Should be 
(ABC|ABNC|ANBC) */
+                                       if(tag_data = (ULONG)bfbm->mask)
+                                               minterm = (ABC|ABNC|ANBC);
                                }
                
                                BltBitMapTags(BLITA_Width, bfbm->width,


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to