summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-01-14 15:17:58 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-01-14 15:17:58 +0000
commita0be22bcc949cc2c57dfc1ba9804d8e68ae550a3 (patch)
treeb502a6498d2a0d7a735cfc59afe17d00523dda09 /vcl/aqua
parent5091be93d98986ce23025c8d2f226661c17d770c (diff)
INTEGRATION: CWS aquavcl04 (1.12.2); FILE MERGED
2007/10/31 14:03:53 pl 1.12.2.2: #i77489# implement shaping 2007/10/18 15:35:17 ericb 1.12.2.1: removing PowerPC warnings
Diffstat (limited to 'vcl/aqua')
-rwxr-xr-xvcl/aqua/source/gdi/salgdiutils.cxx27
1 files changed, 21 insertions, 6 deletions
diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx
index e03026a8dc0e..5f7c82c4f6a9 100755
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: salgdiutils.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: kz $ $Date: 2007-10-09 15:15:12 $
+ * last change: $Author: ihi $ $Date: 2008-01-14 16:17:58 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -143,9 +143,10 @@ void AquaSalGraphics::SetState()
*/
maXORClipMask.reset();
CGRect aBounds( maClippingRects.front() );
- basegfx::B2IRange aRect( aBounds.origin.x, aBounds.origin.y,
- aBounds.origin.x+aBounds.size.width,
- aBounds.origin.y+aBounds.size.height );
+ basegfx::B2IRange aRect( static_cast<sal_Int32>(aBounds.origin.x),
+ static_cast<sal_Int32>(aBounds.origin.y),
+ static_cast<sal_Int32>(aBounds.origin.x+aBounds.size.width),
+ static_cast<sal_Int32>(aBounds.origin.y+aBounds.size.height) );
maXORDevice = basebmp::subsetBitmapDevice( maXORDevice, aRect );
}
}
@@ -294,11 +295,23 @@ CGPoint* AquaSalGraphics::makeCGptArray(ULONG nPoints, const SalPoint* pPtAry)
// -----------------------------------------------------------------------
-void AquaSalGraphics::UpdateWindow( NSGraphicsContext* pContext )
+void AquaSalGraphics::UpdateWindow( NSRect& rRect )
{
+ // FIXME: optimize UpdateWindow wrt to aRect
+ NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
if( mrContext != NULL && mpFrame != NULL && pContext != nil )
{
CGContextRef rCGContext = reinterpret_cast<CGContextRef>([pContext graphicsPort]);
+
+ CGMutablePathRef rClip = mpFrame->getClipPath();
+ if( rClip )
+ {
+ CGContextSaveGState( rCGContext );
+ CGContextBeginPath( rCGContext );
+ CGContextAddPath( rCGContext, rClip );
+ CGContextClip( rCGContext );
+ }
+
CGRect aBitmapRect = {
{ 0, 0 },
{ CGBitmapContextGetWidth(mrContext), CGBitmapContextGetHeight(mrContext) }
@@ -308,6 +321,8 @@ void AquaSalGraphics::UpdateWindow( NSGraphicsContext* pContext )
CGContextDrawImage( rCGContext, aBitmapRect, xImage );
CGImageRelease( xImage );
CGContextFlush( rCGContext );
+ if( rClip ) // cleanup clipping
+ CGContextRestoreGState( rCGContext );
}
}