From 8e58c63c9996b81432b440fbc008385347f7dc98 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Aug 2009 21:37:20 +0000 Subject: Revert r9108, as component order in libnsgif due to be corrected. svn path=/trunk/netsurf/; revision=9137 --- amiga/bitmap.c | 48 +++++------------------------------------------- amiga/bitmap.h | 3 ++- image/bitmap.h | 5 ----- image/gif.c | 2 +- 4 files changed, 8 insertions(+), 50 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 #include +#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 */ }; diff --git a/image/bitmap.h b/image/bitmap.h index 61760decf..4a99de17e 100644 --- a/image/bitmap.h +++ b/image/bitmap.h @@ -38,11 +38,6 @@ #define BITMAP_CLEAR_MEMORY (1 << 3) /** memory should be wiped */ #define BITMAP_SUSPENDED (1 << 4) /** currently suspended */ #define BITMAP_READY (1 << 5) /** fully initialised */ -#define BITMAP_ABGR (1 << 6) /** This bitmap is in ABGR format on - big-endian platforms (if not set, - bitmap is RGBA). This flag has - no relevance on LE platforms, - where data is always ABGR */ #define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */ diff --git a/image/gif.c b/image/gif.c index 5f8e6c525..62d73f0b0 100644 --- a/image/gif.c +++ b/image/gif.c @@ -338,7 +338,7 @@ void nsgif_animate(void *p) */ void *nsgif_bitmap_create(int width, int height) { - return bitmap_create(width, height, BITMAP_NEW | BITMAP_ABGR); + return bitmap_create(width, height, BITMAP_NEW); } #endif -- cgit v1.2.3