summaryrefslogtreecommitdiff
path: root/frontends/amiga/bitmap.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-07-08 19:57:42 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-07-08 19:57:42 +0100
commitddcc914a3ffe02edaeafa93eecf54a77daf8a4cd (patch)
treef9d964588324651e62aae9dd2407ba9c3bcb8584 /frontends/amiga/bitmap.c
parentdc633bc154b913f8f5b6ce33ee34eb1dcfee75d4 (diff)
downloadnetsurf-ddcc914a3ffe02edaeafa93eecf54a77daf8a4cd.tar.gz
netsurf-ddcc914a3ffe02edaeafa93eecf54a77daf8a4cd.tar.bz2
Use GuiGFX to scale 8-bit images rather than doing two separate operations
Diffstat (limited to 'frontends/amiga/bitmap.c')
-rw-r--r--frontends/amiga/bitmap.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 5b8117a63..53e33d631 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -309,7 +309,7 @@ static void ami_bitmap_rgba_to_argb(struct bitmap *bm)
ULONG *data = (ULONG *)amiga_bitmap_get_buffer(bm);
for(int i = 0; i < (bm->width * bm->height); i++) {
- data[i] = (data[i] >> 8) | (data[i] << 24);
+ data[i] = (data[ i] >> 8) | (data[i] << 24);
}
}
@@ -426,7 +426,7 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
tbm, bitmap->width, bitmap->height,
bitmap->width * 4, AMI_BITMAP_FORMAT);
} else {
- tbm = ami_rtg_allocbitmap(bitmap->width, bitmap->height,
+ tbm = ami_rtg_allocbitmap(width, height,
8, 0, friendbm, AMI_BITMAP_FORMAT);
if(tbm == NULL) return NULL;
@@ -450,7 +450,7 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
APTR ddh = CreateDirectDrawHandle(bitmap->drawhandle,
bitmap->width, bitmap->height,
- bitmap->width, bitmap->height, NULL);
+ width, height, NULL);
DirectDrawTrueColor(ddh, (ULONG *)amiga_bitmap_get_buffer(bitmap), 0, 0, TAG_DONE);
DeleteDirectDrawHandle(ddh);
@@ -466,14 +466,19 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
if(nsoption_int(cache_bitmaps) == 2)
{
bitmap->nativebm = tbm;
- bitmap->nativebmwidth = bitmap->width;
- bitmap->nativebmheight = bitmap->height;
+ if(type == AMI_NSBM_TRUECOLOUR) {
+ bitmap->nativebmwidth = bitmap->width;
+ bitmap->nativebmheight = bitmap->height;
+ } else {
+ bitmap->nativebmwidth = width;
+ bitmap->nativebmheight = height;
+ }
bitmap->native = type;
}
}
- if((bitmap->width != width) || (bitmap->height != height))
- {
+ if(((bitmap->width != width) || (bitmap->height != height)) &&
+ (type == AMI_NSBM_TRUECOLOUR)) {
struct BitMap *restrict scaledbm;
struct BitScaleArgs bsa;
int depth = 32;