Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/59784ba8528182089c77e710f5ff31b3c78d6dc1
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/59784ba8528182089c77e710f5ff31b3c78d6dc1
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/59784ba8528182089c77e710f5ff31b3c78d6dc1

The branch, chris/palette-mapped-plotters has been updated
       via  59784ba8528182089c77e710f5ff31b3c78d6dc1 (commit)
      from  0210ef066b75da6ff2a91b5de9ad6d3f583548f2 (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/59784ba8528182089c77e710f5ff31b3c78d6dc1
commit 59784ba8528182089c77e710f5ff31b3c78d6dc1
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    fix mask

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 381958b..97e00f3 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -472,39 +472,30 @@ static struct BitMap *ami_bitmap_get_truecolour(struct 
bitmap *bitmap,int width,
        return tbm;
 }
 
-PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
+                       int height, struct BitMap *n_bm)
 {
        uint32 *bmi = (uint32 *) bitmap->pixdata;
        UBYTE maskbit = 0;
+       ULONG bm_width;
        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);
+       bm_width = GetBitMapAttr(n_bm, BMA_WIDTH);
+       bitmap->native_mask = AllocRaster(bm_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;
-       }
+       int bpr = RASSIZE(bm_width, 1);
 
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
                        if ((*bmi & 0x000000ffU) <= 
(ULONG)nsoption_int(mask_alpha)) maskbit = 0;
                                else maskbit = 1;
                        bmi++;
-                       bitmap->native_mask[(y*w) + (x/8)] =
-                               (bitmap->native_mask[(y*w) + (x/8)] << 1) | 
maskbit;
+                       bitmap->native_mask[(y*bpr) + (x/8)] =
+                               (bitmap->native_mask[(y*bpr) + (x/8)] << 1) | 
maskbit;
                }
        }
 
@@ -552,7 +543,7 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct 
bitmap *bitmap,
        bitmap->nativebmwidth = width;
        bitmap->nativebmheight = height;
 
-       ami_bitmap_get_mask(bitmap, width, height);
+       ami_bitmap_get_mask(bitmap, width, height, dtbm);
        return dtbm;
 }
 
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 87c569f..0fbfc52 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -44,7 +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);
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
+                               int height, struct BitMap *n_bm);
 
 Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
 struct bitmap *ami_bitmap_from_datatype(char *filename);
diff --git a/amiga/gui.c b/amiga/gui.c
index 2c9eeb5..8aef21a 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3845,7 +3845,7 @@ void gui_window_set_icon(struct gui_window *g, 
hlcache_handle *icon)
                                minterm = 0xc0;
                        } else {
                                tag = BLITA_MaskPlane;
-                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16);
+                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16, bm);
                                minterm = (ABC|ABNC|ANBC);
                        }
                
@@ -3928,7 +3928,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16);
+                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16, bm);
                                        minterm = (ABC|ABNC|ANBC);
                                }
 
diff --git a/amiga/plotters.c b/amiga/plotters.c
index f12ef1a..9d86fde 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -678,7 +678,7 @@ static bool ami_bitmap(int x, int y, int width, int height, 
struct bitmap *bitma
                        minterm = 0xc0;
                } else {
                        tag = BLITA_MaskPlane;
-                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height))
+                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height, tbm))
                                minterm = (ABC|ABNC|ANBC);
                }
 
@@ -782,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 = ami_bitmap_get_mask(bitmap, width, height);;
+               bfbm.mask = ami_bitmap_get_mask(bitmap, width, height, tbm);
                bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
                bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
                bfh->h_SubEntry = 0;


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

Summary of changes:
 amiga/bitmap.c   |   27 +++++++++------------------
 amiga/bitmap.h   |    3 ++-
 amiga/gui.c      |    4 ++--
 amiga/plotters.c |    4 ++--
 4 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 381958b..97e00f3 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -472,39 +472,30 @@ static struct BitMap *ami_bitmap_get_truecolour(struct 
bitmap *bitmap,int width,
        return tbm;
 }
 
-PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
+                       int height, struct BitMap *n_bm)
 {
        uint32 *bmi = (uint32 *) bitmap->pixdata;
        UBYTE maskbit = 0;
+       ULONG bm_width;
        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);
+       bm_width = GetBitMapAttr(n_bm, BMA_WIDTH);
+       bitmap->native_mask = AllocRaster(bm_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;
-       }
+       int bpr = RASSIZE(bm_width, 1);
 
        for(y=0; y<height; y++) {
                for(x=0; x<width; x++) {
                        if ((*bmi & 0x000000ffU) <= 
(ULONG)nsoption_int(mask_alpha)) maskbit = 0;
                                else maskbit = 1;
                        bmi++;
-                       bitmap->native_mask[(y*w) + (x/8)] =
-                               (bitmap->native_mask[(y*w) + (x/8)] << 1) | 
maskbit;
+                       bitmap->native_mask[(y*bpr) + (x/8)] =
+                               (bitmap->native_mask[(y*bpr) + (x/8)] << 1) | 
maskbit;
                }
        }
 
@@ -552,7 +543,7 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct 
bitmap *bitmap,
        bitmap->nativebmwidth = width;
        bitmap->nativebmheight = height;
 
-       ami_bitmap_get_mask(bitmap, width, height);
+       ami_bitmap_get_mask(bitmap, width, height, dtbm);
        return dtbm;
 }
 
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 87c569f..0fbfc52 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -44,7 +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);
+PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
+                               int height, struct BitMap *n_bm);
 
 Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
 struct bitmap *ami_bitmap_from_datatype(char *filename);
diff --git a/amiga/gui.c b/amiga/gui.c
index 2c9eeb5..8aef21a 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3845,7 +3845,7 @@ void gui_window_set_icon(struct gui_window *g, 
hlcache_handle *icon)
                                minterm = 0xc0;
                        } else {
                                tag = BLITA_MaskPlane;
-                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16);
+                               tag_data = 
(ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16, bm);
                                minterm = (ABC|ABNC|ANBC);
                        }
                
@@ -3928,7 +3928,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
                                        minterm = 0xc0;
                                } else {
                                        tag = BLITA_MaskPlane;
-                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16);
+                                       tag_data = 
(ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16, bm);
                                        minterm = (ABC|ABNC|ANBC);
                                }
 
diff --git a/amiga/plotters.c b/amiga/plotters.c
index f12ef1a..9d86fde 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -678,7 +678,7 @@ static bool ami_bitmap(int x, int y, int width, int height, 
struct bitmap *bitma
                        minterm = 0xc0;
                } else {
                        tag = BLITA_MaskPlane;
-                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height))
+                       if(tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, 
height, tbm))
                                minterm = (ABC|ABNC|ANBC);
                }
 
@@ -782,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 = ami_bitmap_get_mask(bitmap, width, height);;
+               bfbm.mask = ami_bitmap_get_mask(bitmap, width, height, tbm);
                bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
                bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
                bfh->h_SubEntry = 0;


-- 
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