r=mkaply, a=brendan
Implement DrawTile so background images are displayed
This commit is contained in:
mkaply%us.ibm.com 2000-07-17 19:50:21 +00:00
Родитель 648d67e382
Коммит 45ed74357a
4 изменённых файлов: 40 добавлений и 2 удалений

Просмотреть файл

@ -401,3 +401,19 @@ nsImageOS2::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2 )
return NS_OK;
}
PRBool
nsImageOS2::DrawTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth, nscoord aHeight)
{
PRInt32 x,y;
// OS2TODO - use the old way... slow, but will always work.
for(y=aY0;y<aY1;y+=aHeight){
for(x=aX0;x<aX1;x+=aWidth){
this->Draw(aContext,aSurface,x,y,aWidth,aHeight);
}
}
return(PR_TRUE);
}

Просмотреть файл

@ -80,9 +80,8 @@ public:
* @param aHeight The destination height of the pixelmap
* @return if TRUE, no errors
*/
#if 0 // OS2TODO
// OS2TODO
PRBool DrawTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,nscoord aWidth,nscoord aHeight);
#endif
/**
* Return the header size of the Device Independent Bitmap(DIB).

Просмотреть файл

@ -1379,6 +1379,28 @@ NS_IMETHODIMP
nsRenderingContextOS2::DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight)
{
nscoord orgX,orgY,orgWidth,orgHeight;
PRBool didtile = FALSE;
// convert output platform, but no translation.. just scale
orgX = aX0;
orgY = aY0;
orgWidth = aX1 - aX0;
orgHeight = aY1 - aY0;
mTMatrix.TransformCoord(&aX0,&aY0,&aWidth,&aHeight);
mTMatrix.TransformCoord(&orgX,&orgY,&orgWidth,&orgHeight);
aX1 = aX0 + orgWidth;
aY1 = aY0 + orgHeight;
// if ( PR_TRUE==CanTile(aWidth,aHeight) ) {
// didtile = ((nsImageOS2*)aImage)->PatBltTile(*this,mSurface,aX0,aY0,aX1,aY1,aWidth,aHeight);
// }
// if (PR_FALSE ==didtile){
// rely on the slower tiler supported in nsRenderingContextWin.. don't have
// to use xplatform which is really slow (slowest is the only one that supports transparency
didtile = ((nsImageOS2*)aImage)->DrawTile(*this,mSurface,aX0,aY0,aX1,aY1,aWidth,aHeight);
// }
return NS_OK;
}

Просмотреть файл

@ -33,6 +33,7 @@
#include "nsTransform2D.h"
#include "nscoord.h"
#include "nsDrawingSurfaceOS2.h"
#include "nsImageOS2.h"
#include "nsRenderingContextImpl.h"
class nsIDeviceContext;