mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
bug = 58127 r = kmcclusk sr = buster. fixed 8 bit GDI calls for printing.
This commit is contained in:
parent
f023ee939d
commit
f3ab6d31ca
@ -1058,14 +1058,22 @@ nsImageWin :: CleanUpDDB()
|
||||
nsresult
|
||||
nsImageWin::PrintDDB(nsDrawingSurface aSurface,PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,PRUint32 aROP)
|
||||
{
|
||||
HDC theHDC;
|
||||
HDC theHDC;
|
||||
UINT palType;
|
||||
|
||||
if (mIsOptimized == PR_TRUE){
|
||||
if (mHBitmap != nsnull){
|
||||
ConvertDDBtoDIB(aWidth,aHeight);
|
||||
((nsDrawingSurfaceWin *)aSurface)->GetDC(&theHDC);
|
||||
|
||||
if (mBHead->biBitCount == 8) {
|
||||
palType = DIB_PAL_COLORS;
|
||||
} else {
|
||||
palType = DIB_RGB_COLORS;
|
||||
}
|
||||
|
||||
::StretchDIBits(theHDC, aX, aY, aWidth, aHeight,
|
||||
0, 0, mBHead->biWidth, mBHead->biHeight, mImageBits,(LPBITMAPINFO)mBHead,DIB_RGB_COLORS, aROP);
|
||||
0, 0, mBHead->biWidth, mBHead->biHeight, mImageBits,(LPBITMAPINFO)mBHead,palType, aROP);
|
||||
|
||||
// we are finished with this, so delete it
|
||||
if (mImageBits != nsnull) {
|
||||
@ -1090,6 +1098,7 @@ PRInt32 numbytes;
|
||||
BITMAP srcinfo;
|
||||
HBITMAP oldbits;
|
||||
HDC memPrDC;
|
||||
UINT palType;
|
||||
|
||||
if (mIsOptimized == PR_TRUE){
|
||||
|
||||
@ -1106,7 +1115,14 @@ HDC memPrDC;
|
||||
|
||||
// Allocate the image bits
|
||||
mImageBits = new unsigned char[mSizeImage];
|
||||
numbytes = ::GetDIBits(memPrDC,mHBitmap,0,srcinfo.bmHeight,mImageBits,(LPBITMAPINFO)mBHead,DIB_RGB_COLORS);
|
||||
|
||||
if (mBHead->biBitCount == 8) {
|
||||
palType = DIB_PAL_COLORS;
|
||||
} else {
|
||||
palType = DIB_RGB_COLORS;
|
||||
}
|
||||
|
||||
numbytes = ::GetDIBits(memPrDC,mHBitmap,0,srcinfo.bmHeight,mImageBits,(LPBITMAPINFO)mBHead,palType);
|
||||
::SelectObject(memPrDC,oldbits);
|
||||
DeleteDC(memPrDC);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user