Bug 205893 - use DIBSection instead of DIBitmap. Patch by sring@gmx.net,

r=ere, sr=tor, a=chofmann
This commit is contained in:
tor%cs.brown.edu 2004-03-12 17:11:54 +00:00
Родитель 9083c871de
Коммит f9383ccb8e
1 изменённых файлов: 11 добавлений и 5 удалений

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

@ -1465,11 +1465,17 @@ nsImageWin :: Optimize(nsIDeviceContext* aContext)
if (mAlphaDepth == 8) { if (mAlphaDepth == 8) {
CreateImageWithAlphaBits(TheHDC); CreateImageWithAlphaBits(TheHDC);
} else { } else {
mHBitmap = ::CreateDIBitmap(TheHDC, mBHead, CBM_INIT, mImageBits, LPVOID bits;
(LPBITMAPINFO)mBHead, mHBitmap = ::CreateDIBSection(TheHDC, (LPBITMAPINFO)mBHead,
256 == mNumPaletteColors ? DIB_PAL_COLORS 256 == mNumPaletteColors ? DIB_PAL_COLORS : DIB_RGB_COLORS,
: DIB_RGB_COLORS); &bits, NULL, 0);
mIsOptimized = (mHBitmap != 0);
if (mHBitmap) {
memcpy(bits, mImageBits, mSizeImage);
mIsOptimized = PR_TRUE;
} else {
mIsOptimized = PR_FALSE;
}
} }
if (mIsOptimized) if (mIsOptimized)
CleanUpDIB(); CleanUpDIB();