зеркало из https://github.com/mozilla/pjs.git
Bug 205893 - use DIBSection instead of DIBitmap. Patch by sring@gmx.net,
r=ere, sr=tor, a=chofmann
This commit is contained in:
Родитель
9083c871de
Коммит
f9383ccb8e
|
@ -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();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче