pict generation code takes into account mask, getting rid of a memory leak

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-10-17 20:32:29 +00:00
parent 728d6d7d3a
commit c033876ec0
2 changed files with 20 additions and 6 deletions

View File

@@ -272,14 +272,19 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
SetGWorld( wp , NULL ) ;
Rect portRect ;
GetPortBounds( wp , &portRect ) ;
if ( clipRgn )
portRect = (**clipRgn).rgnBBox ;
else
GetPortBounds( wp , &portRect ) ;
pict = OpenPicture(&portRect);
if(pict)
{
RGBForeColor( &black ) ;
RGBBackColor( &white ) ;
if ( clipRgn )
SetClip( clipRgn ) ;
LockPixels( GetGWorldPixMap( wp ) ) ;
CopyBits(GetPortBitMapForCopyBits(wp),
GetPortBitMapForCopyBits(wp),
@@ -290,6 +295,8 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
ClosePicture();
}
SetGWorld( origPort , origDev ) ;
if ( clipRgn )
DisposeRgn( clipRgn ) ;
return pict;
}

View File

@@ -272,14 +272,19 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
SetGWorld( wp , NULL ) ;
Rect portRect ;
GetPortBounds( wp , &portRect ) ;
if ( clipRgn )
portRect = (**clipRgn).rgnBBox ;
else
GetPortBounds( wp , &portRect ) ;
pict = OpenPicture(&portRect);
if(pict)
{
RGBForeColor( &black ) ;
RGBBackColor( &white ) ;
if ( clipRgn )
SetClip( clipRgn ) ;
LockPixels( GetGWorldPixMap( wp ) ) ;
CopyBits(GetPortBitMapForCopyBits(wp),
GetPortBitMapForCopyBits(wp),
@@ -290,6 +295,8 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
ClosePicture();
}
SetGWorld( origPort , origDev ) ;
if ( clipRgn )
DisposeRgn( clipRgn ) ;
return pict;
}