mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
Remove some unneeded ARGB<=>RGBA conversion
This commit is contained in:
parent
25a4cce542
commit
86757143df
@ -282,28 +282,6 @@ size_t bitmap_get_bpp(void *vbitmap)
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __amigaos4__
|
|
||||||
void ami_bitmap_argb_to_rgba(struct bitmap *bm)
|
|
||||||
{
|
|
||||||
if(bm == NULL) return;
|
|
||||||
|
|
||||||
ULONG *data = (ULONG *)bitmap_get_buffer(bm);
|
|
||||||
for(int i = 0; i < ((bitmap_get_rowstride(bm) / sizeof(ULONG)) * bitmap_get_height(bm)); i++) {
|
|
||||||
data[i] = (data[i] << 8) | (data[i] >> 24);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ami_bitmap_rgba_to_argb(struct bitmap *bm)
|
|
||||||
{
|
|
||||||
if(bm == NULL) return;
|
|
||||||
|
|
||||||
ULONG *data = (ULONG *)bitmap_get_buffer(bm);
|
|
||||||
for(int i = 0; i < ((bitmap_get_rowstride(bm) / sizeof(ULONG)) * bitmap_get_height(bm)); i++) {
|
|
||||||
data[i] = (data[i] >> 8) | (data[i] << 24);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BITMAP_DUMP
|
#ifdef BITMAP_DUMP
|
||||||
void bitmap_dump(struct bitmap *bitmap)
|
void bitmap_dump(struct bitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
@ -175,11 +175,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
|
|||||||
UBYTE *bm_buffer;
|
UBYTE *bm_buffer;
|
||||||
Object *dto;
|
Object *dto;
|
||||||
struct bitmap *bitmap;
|
struct bitmap *bitmap;
|
||||||
#ifdef __amigaos4__
|
|
||||||
int bm_format = PBPAFMT_RGBA;
|
|
||||||
#else
|
|
||||||
int bm_format = PBPAFMT_ARGB;
|
|
||||||
#endif
|
|
||||||
struct amiga_dt_picture_content *adt = (struct amiga_dt_picture_content *)c;
|
struct amiga_dt_picture_content *adt = (struct amiga_dt_picture_content *)c;
|
||||||
|
|
||||||
if((dto = amiga_dt_picture_newdtobject(adt)))
|
if((dto = amiga_dt_picture_newdtobject(adt)))
|
||||||
@ -194,11 +189,9 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
|
|||||||
bm_buffer = bitmap_get_buffer(bitmap);
|
bm_buffer = bitmap_get_buffer(bitmap);
|
||||||
|
|
||||||
IDoMethod(dto, PDTM_READPIXELARRAY,
|
IDoMethod(dto, PDTM_READPIXELARRAY,
|
||||||
bm_buffer, bm_format, bitmap_get_rowstride(bitmap),
|
bm_buffer, PBPAFMT_RGBA, bitmap_get_rowstride(bitmap),
|
||||||
0, 0, c->width, c->height);
|
0, 0, c->width, c->height);
|
||||||
#ifndef __amigaos4__
|
|
||||||
ami_bitmap_argb_to_rgba(bitmap);
|
|
||||||
#endif
|
|
||||||
bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap));
|
bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap));
|
||||||
|
|
||||||
DisposeDTObject(dto);
|
DisposeDTObject(dto);
|
||||||
|
Loading…
Reference in New Issue
Block a user