Revert r9108, as component order in libnsgif due to be corrected.
svn path=/trunk/netsurf/; revision=9137
This commit is contained in:
parent
f7bba441db
commit
8e58c63c99
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 */
|
||||
};
|
||||
|
|
|
@ -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) */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue