diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-08-09 21:37:20 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-08-09 21:37:20 +0000 |
commit | 8e58c63c9996b81432b440fbc008385347f7dc98 (patch) | |
tree | f8825a1cc69f5c8de8dc65fb321496c3d7e3601c /amiga | |
parent | f7bba441db95a86012fd90b7a4e0312a092ecb3d (diff) | |
download | netsurf-8e58c63c9996b81432b440fbc008385347f7dc98.tar.gz netsurf-8e58c63c9996b81432b440fbc008385347f7dc98.tar.bz2 |
Revert r9108, as component order in libnsgif due to be corrected.
svn path=/trunk/netsurf/; revision=9137
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/bitmap.c | 48 | ||||
-rwxr-xr-x | amiga/bitmap.h | 3 |
2 files changed, 7 insertions, 44 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c index c1eab445e..425f8473d 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -52,11 +52,9 @@ void *bitmap_create(int width, int height, unsigned int state) TAG_DONE); bitmap->width = width; bitmap->height = height; + if(state & BITMAP_OPAQUE) bitmap->opaque = true; else bitmap->opaque = false; - - if(state & BITMAP_ABGR) bitmap->format = RGBFB_A8B8G8R8; - else bitmap->format = RGBFB_R8G8B8A8; } return bitmap; } @@ -298,45 +296,9 @@ Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap) PDTA_SourceMode,PMODE_V43, TAG_DONE); - if(bitmap->format == RGBFB_A8B8G8R8) - { - struct RenderInfo ri; - struct RastPort trp; - UBYTE *argb_pixarray = AllocVec(bmhd->bmh_Width * bmhd->bmh_Height * - bitmap_get_bpp(bitmap), MEMF_CLEAR); - struct BitMap *tbm = ami_getcachenativebm(bitmap, bmhd->bmh_Width, - bmhd->bmh_Height, NULL); - - if(argb_pixarray) - { - ri.Memory = argb_pixarray; - ri.BytesPerRow = bitmap_get_rowstride(bitmap); - ri.RGBFormat = RGBFB_A8R8G8B8; - - InitRastPort(&trp); - trp.BitMap = tbm; - - p96ReadPixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0, - bmhd->bmh_Width, bmhd->bmh_Height); - - if(tbm != bitmap->nativebm) - { - p96FreeBitMap(tbm); - } - - IDoMethod(dto,PDTM_WRITEPIXELARRAY,argb_pixarray, - PBPAFMT_ARGB,bitmap_get_rowstride(bitmap),0,0, - bitmap_get_width(bitmap),bitmap_get_height(bitmap)); - - FreeVec(argb_pixarray); - } - } - else - { - IDoMethod(dto,PDTM_WRITEPIXELARRAY,bitmap_get_buffer(bitmap), + IDoMethod(dto,PDTM_WRITEPIXELARRAY,bitmap_get_buffer(bitmap), PBPAFMT_RGBA,bitmap_get_rowstride(bitmap),0,0, bitmap_get_width(bitmap),bitmap_get_height(bitmap)); - } } return dto; @@ -372,10 +334,10 @@ struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,s { ri.Memory = bitmap->pixdata; ri.BytesPerRow = bitmap->width * 4; - ri.RGBFormat = bitmap->format; + ri.RGBFormat = AMI_BITMAP_FORMAT; if(tbm = p96AllocBitMap(bitmap->width, bitmap->height, 32, 0, - friendbm, bitmap->format)) + friendbm, AMI_BITMAP_FORMAT)) { InitRastPort(&trp); trp.BitMap = tbm; @@ -397,7 +359,7 @@ struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,s struct BitScaleArgs bsa; scaledbm = p96AllocBitMap(width, height, 32, BMF_DISPLAYABLE, - friendbm, bitmap->format); + friendbm, AMI_BITMAP_FORMAT); if(GfxBase->lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) { diff --git a/amiga/bitmap.h b/amiga/bitmap.h index aa8d02460..1af3d87b5 100755 --- a/amiga/bitmap.h +++ b/amiga/bitmap.h @@ -23,6 +23,8 @@ #include <intuition/classusr.h> #include <libraries/Picasso96.h> +#define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8 + struct bitmap { int width; int height; @@ -31,7 +33,6 @@ struct bitmap { struct BitMap *nativebm; int nativebmwidth; int nativebmheight; - RGBFTYPE format; char *url; /* temporary storage space */ char *title; /* temporary storage space */ }; |