Don't use the offscreen pixmap if it is null (low memory situations)

This commit is contained in:
pinkerton%netscape.com 1998-10-29 20:03:57 +00:00
Родитель ce0bf2910d
Коммит 1e0c02b534
1 изменённых файлов: 11 добавлений и 10 удалений

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

@ -1116,7 +1116,6 @@ NS_IMETHODIMP nsRenderingContextMac :: CopyOffScreenBits(nsDrawingSurface aSrcSu
const nsRect &aDestBounds,
PRUint32 aCopyFlags)
{
PixMapHandle offscreenPM;
PixMapPtr srcpix;
PixMapPtr destpix;
RGBColor rgbblack = {0x0000,0x0000,0x0000};
@ -1154,15 +1153,17 @@ NS_IMETHODIMP nsRenderingContextMac :: CopyOffScreenBits(nsDrawingSurface aSrcSu
destpix = *((CGrafPtr)destport)->portPixMap;
offscreenPM = ::GetGWorldPixMap((GWorldPtr)aSrcSurf);
LockPixels(offscreenPM);
srcpix = (PixMapPtr)*offscreenPM;
::RGBForeColor(&rgbblack);
::RGBBackColor(&rgbwhite);
::CopyBits((BitMap*)srcpix,(BitMap*)destpix,&srcrect,&dstrect,ditherCopy,0L);
UnlockPixels(offscreenPM);
PixMapHandle offscreenPM = ::GetGWorldPixMap((GWorldPtr)aSrcSurf);
if ( offscreenPM ) {
LockPixels(offscreenPM);
srcpix = (PixMapPtr)*offscreenPM;
::RGBForeColor(&rgbblack);
::RGBBackColor(&rgbwhite);
::CopyBits((BitMap*)srcpix,(BitMap*)destpix,&srcrect,&dstrect,ditherCopy,0L);
UnlockPixels(offscreenPM);
}
return NS_OK;
}