зеркало из https://github.com/mozilla/gecko-dev.git
bug = 58127 r = kmcclusk sr = buster. fixed 8 bit GDI calls for printing.
This commit is contained in:
Родитель
f023ee939d
Коммит
f3ab6d31ca
|
@ -1059,13 +1059,21 @@ nsresult
|
|||
nsImageWin::PrintDDB(nsDrawingSurface aSurface,PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,PRUint32 aROP)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче