diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-10-05 11:18:27 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-10-05 11:18:27 +0100 |
commit | a06cb9f05cc4f3ad9e92a8f4c1f4dbd3d3d8fd85 (patch) | |
tree | d0b43d3984a17b6bcf4787d41b4d7a5c23286e01 /amiga/bitmap.c | |
parent | f5bdd4b10962659259423e8efa2ddf80b9805053 (diff) | |
download | netsurf-a06cb9f05cc4f3ad9e92a8f4c1f4dbd3d3d8fd85.tar.gz netsurf-a06cb9f05cc4f3ad9e92a8f4c1f4dbd3d3d8fd85.tar.bz2 |
If bitmap is opaque, ensure we override the alpha channel as it may contain nonsense.
Diffstat (limited to 'amiga/bitmap.c')
-rw-r--r-- | amiga/bitmap.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 9a71d1cd4..6d52bdb54 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -288,6 +288,21 @@ void ami_bitmap_argb_to_rgba(struct bitmap *bm) } #endif +void bitmap_dump(struct bitmap *bitmap) +{ + int x,y; + ULONG *bm = (ULONG *)bitmap->pixdata; + + printf("Width=%ld, Height=%ld, Opaque=%s\nnativebm=%lx, width=%ld, height=%ld\n", bitmap->width, bitmap->height, bitmap->opaque ? "true" : "false", bitmap->nativebm, bitmap->nativebmwidth, bitmap->nativebmheight); + + for(y = 0; y < bitmap->height; y++) { + for(x = 0; x < bitmap->width; x++) { + printf("%lx ", bm[(y*bitmap->width) + x]); + } + printf("\n"); + } +} + Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap) { Object *dto; @@ -423,11 +438,9 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width, { #ifdef __amigaos4__ uint32 comptype = COMPOSITE_Src; - uint32 flags = 0; - - if(bitmap->opaque) flags |= COMPFLAG_IgnoreDestAlpha; + uint32 flags = 0; //COMPFLAG_IgnoreDestAlpha; if(nsoption_bool(scale_quality)) flags |= COMPFLAG_SrcFilter; - + CompositeTags(comptype,tbm,scaledbm, COMPTAG_ScaleX,COMP_FLOAT_TO_FIX(width/bitmap->width), COMPTAG_ScaleY,COMP_FLOAT_TO_FIX(height/bitmap->height), |