r5455 chris_y - /trunk/netsurf/amiga/plotters.c

netsurf at semichrome.net netsurf at semichrome.net
Sun Sep 28 15:39:02 BST 2008


Author: chris_y
Date: Sun Sep 28 09:39:02 2008
New Revision: 5455

URL: http://source.netsurf-browser.org?rev=5455&view=rev
Log:
Stop scaled bitmaps from disappearing completely when the top of the image is
partially off-screen.  Hopefully this also fixes some system freezes caused by this
code when run under OS4.1 on the SAM440.

Modified:
    trunk/netsurf/amiga/plotters.c

Modified: trunk/netsurf/amiga/plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/plotters.c?rev=5455&r1=5454&r2=5455&view=diff
==============================================================================
--- trunk/netsurf/amiga/plotters.c (original)
+++ trunk/netsurf/amiga/plotters.c Sun Sep 28 09:39:02 2008
@@ -239,6 +239,8 @@
 {
 	struct RenderInfo ri;
 
+	if(!width || !height) return true;
+
 //	ami_fill(x,y,x+width,y+height,bg);
 
 	SetRPAttrs(currp,RPTAG_BPenColor,p96EncodeColor(RGBFB_A8B8G8R8,bg),
@@ -248,14 +250,13 @@
 	ri.BytesPerRow = bitmap->width * 4;
 	ri.RGBFormat = RGBFB_R8G8B8A8;
 
-/* check for black boxes under images! */
-/* disabled temporarily for SAM OS4.1
 	if((bitmap->width != width) || (bitmap->height != height))
 	{
-		struct BitMap *tbm;
+		struct BitMap *tbm,*scaledbm;
 		struct RastPort trp;
 		struct BitScaleArgs bsa;
 
+		scaledbm = p96AllocBitMap(width,height,32,0,currp->BitMap,RGBFB_R8G8B8A8);
 		tbm = p96AllocBitMap(bitmap->width,bitmap->height,32,0,currp->BitMap,RGBFB_R8G8B8A8);
 		InitRastPort(&trp);
 		trp.BitMap = tbm;
@@ -264,26 +265,28 @@
 		bsa.bsa_SrcY = 0;
 		bsa.bsa_SrcWidth = bitmap->width;
 		bsa.bsa_SrcHeight = bitmap->height;
-		bsa.bsa_DestX = x;
-		bsa.bsa_DestY = y;
-		bsa.bsa_DestWidth = width;
-		bsa.bsa_DestHeight = height;
+		bsa.bsa_DestX = 0;
+		bsa.bsa_DestY = 0;
+//		bsa.bsa_DestWidth = width;
+//		bsa.bsa_DestHeight = height;
 		bsa.bsa_XSrcFactor = bitmap->width;
 		bsa.bsa_XDestFactor = width;
 		bsa.bsa_YSrcFactor = bitmap->height;
 		bsa.bsa_YDestFactor = height;
 		bsa.bsa_SrcBitMap = tbm;
-		bsa.bsa_DestBitMap = currp->BitMap;
+		bsa.bsa_DestBitMap = scaledbm;
 		bsa.bsa_Flags = 0;
 
 		BitMapScale(&bsa);
+		BltBitMapRastPort(scaledbm,0,0,currp,x,y,width,height,0x0C0);
+
 		p96FreeBitMap(tbm);
+		p96FreeBitMap(scaledbm);
 	}
 	else
 	{
-*/
 		p96WritePixelArray((struct RenderInfo *)&ri,0,0,currp,x,y,width,height);
-//	}
+	}
 
 	return true;
 }




More information about the netsurf-commits mailing list