b=122996 r=kmclusky sr=attinasi. Use patblt for windows background tiling

This commit is contained in:
dcone%netscape.com 2002-02-19 03:10:42 +00:00
Родитель 041e0b7b9a
Коммит e38dc858f5
2 изменённых файлов: 19 добавлений и 7 удалений

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

@ -45,6 +45,8 @@
static nsresult BuildDIB(LPBITMAPINFOHEADER *aBHead,PRInt32 aWidth,PRInt32 aHeight,PRInt32 aDepth,PRInt8 *aNumBitPix);
static PRBool
IsWindowsNT()
{
@ -823,9 +825,15 @@ NS_IMETHODIMP nsImageWin::DrawTile(nsIRenderingContext &aContext,
}
}
return(PR_TRUE);
} else if(mAlphaDepth == 8 ){
}
// now try to pattern blit.. if that fails.. we use our own algorithm to get
// things fast
if ( PR_TRUE == PatBltTile(aContext,aSurface,aX0,aY0,aX1,aY1) ){
return(PR_TRUE);
}
// create a larger tile from the smaller one
((nsDrawingSurfaceWin *)aSurface)->GetDC(&TheHDC);
if (NULL == TheHDC){
@ -948,8 +956,7 @@ NS_IMETHODIMP nsImageWin::DrawTile(nsIRenderingContext &aContext,
*/
PRBool
nsImageWin :: PatBltTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth, nscoord aHeight)
nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1)
{
HDC TheHDC;
HBRUSH hBrush,oldBrush;
@ -958,6 +965,13 @@ nsImageWin :: PatBltTile(nsIRenderingContext &aContext, nsDrawingSurface aSurfac
HBITMAP theBits;
POINT originalPoint;
if (PR_TRUE != gIsWinNT) {
if((mBHead->biWidth<8)&&(mBHead->biHeight<8)){
return PR_FALSE; // this does not seem to work on win 98
}
}
if (PR_FALSE==mCanOptimize) {
return (PR_FALSE);
}

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

@ -131,11 +131,9 @@ public:
* @param aSurface the surface to blit to
* @param aX The destination horizontal location
* @param aY The destination vertical location
* @param aWidth The destination width of the pixelmap
* @param aHeight The destination height of the pixelmap
* @return if TRUE, no errors
*/
PRBool PatBltTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,nscoord aWidth,nscoord aHeight);
PRBool PatBltTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1);
/**