From 86757143dfb0748e351976620a8b1176f0063a8c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 2 Feb 2015 18:54:08 +0000 Subject: [PATCH] Remove some unneeded ARGB<=>RGBA conversion --- amiga/bitmap.c | 22 ---------------------- amiga/dt_picture.c | 11 ++--------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 6da0fc26f..809bce8b2 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -282,28 +282,6 @@ size_t bitmap_get_bpp(void *vbitmap) 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 void bitmap_dump(struct bitmap *bitmap) { diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index f72d3bd4b..15fc30e6a 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -175,11 +175,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) UBYTE *bm_buffer; Object *dto; 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; 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); 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); -#ifndef __amigaos4__ - ami_bitmap_argb_to_rgba(bitmap); -#endif + bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap)); DisposeDTObject(dto);