summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2009-10-27 17:08:07 +0000
committerPhilipp Lohmann <pl@openoffice.org>2009-10-27 17:08:07 +0000
commit51977c2b62de1b3d227cce0a1f7f9648f4e98063 (patch)
tree98754e756935d20128e687c7a708a61a9b7e7767 /vcl/aqua
parentb31166829b6c56b963e6ca58cd1af8c746e8ab6a (diff)
#i106351# avoid early exits when changing state
Diffstat (limited to 'vcl/aqua')
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx63
1 files changed, 33 insertions, 30 deletions
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index f389abd19a82..eb6434100208 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -931,27 +931,29 @@ bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPol
AddPolygonToPath( xPath, rPolygon, true, !getAntiAliasB2DDraw(), IsPenVisible() );
}
- // use the path to prepare the graphics context
- CGContextSaveGState( mrContext );
- CGContextBeginPath( mrContext );
- CGContextAddPath( mrContext, xPath );
const CGRect aRefreshRect = CGPathGetBoundingBox( xPath );
- CGPathRelease( xPath );
-
#ifndef NO_I97317_WORKAROUND
// #i97317# workaround for Quartz having problems with drawing small polygons
- if( (aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125) )
- return true;
+ if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125)) )
#endif
+ {
+ // use the path to prepare the graphics context
+ CGContextSaveGState( mrContext );
+ CGContextBeginPath( mrContext );
+ CGContextAddPath( mrContext, xPath );
+
+ // draw path with antialiased polygon
+ CGContextSetShouldAntialias( mrContext, true );
+ CGContextSetAlpha( mrContext, 1.0 - fTransparency );
+ CGContextDrawPath( mrContext, kCGPathEOFillStroke );
+ CGContextRestoreGState( mrContext );
+
+ // mark modified rectangle as updated
+ RefreshRect( aRefreshRect );
+ }
- // draw path with antialiased polygon
- CGContextSetShouldAntialias( mrContext, true );
- CGContextSetAlpha( mrContext, 1.0 - fTransparency );
- CGContextDrawPath( mrContext, kCGPathEOFillStroke );
- CGContextRestoreGState( mrContext );
+ CGPathRelease( xPath );
- // mark modified rectangle as updated
- RefreshRect( aRefreshRect );
return true;
}
@@ -991,27 +993,28 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
CGMutablePathRef xPath = CGPathCreateMutable();
AddPolygonToPath( xPath, rPolyLine, rPolyLine.isClosed(), !getAntiAliasB2DDraw(), true );
- // use the path to prepare the graphics context
- CGContextSaveGState( mrContext );
- CGContextAddPath( mrContext, xPath );
const CGRect aRefreshRect = CGPathGetBoundingBox( xPath );
- CGPathRelease( xPath );
-
#ifndef NO_I97317_WORKAROUND
// #i97317# workaround for Quartz having problems with drawing small polygons
- if( (aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125) )
- return true;
+ if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125)) )
#endif
+ {
+ // use the path to prepare the graphics context
+ CGContextSaveGState( mrContext );
+ CGContextAddPath( mrContext, xPath );
+ // draw path with antialiased line
+ CGContextSetShouldAntialias( mrContext, true );
+ CGContextSetLineJoin( mrContext, aCGLineJoin );
+ CGContextSetLineWidth( mrContext, rLineWidths.getX() );
+ CGContextDrawPath( mrContext, kCGPathStroke );
+ CGContextRestoreGState( mrContext );
+
+ // mark modified rectangle as updated
+ RefreshRect( aRefreshRect );
+ }
- // draw path with antialiased line
- CGContextSetShouldAntialias( mrContext, true );
- CGContextSetLineJoin( mrContext, aCGLineJoin );
- CGContextSetLineWidth( mrContext, rLineWidths.getX() );
- CGContextDrawPath( mrContext, kCGPathStroke );
- CGContextRestoreGState( mrContext );
+ CGPathRelease( xPath );
- // mark modified rectangle as updated
- RefreshRect( aRefreshRect );
return true;
}