diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-11-06 16:39:47 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-11-06 16:41:44 +0200 |
commit | f354ba7a3aba1301f3951fdd9f74a38bd94255af (patch) | |
tree | 1ea81a550bd6ae4a2847b52fe064089fdead51af /vcl | |
parent | b9c98414ec9084cf97b5dcc911fb9941b5e57ebb (diff) |
Unbreak compilation of the iOS vcl code
Note that this is code basically copy-pasted from the MacOSX ("aqua")
back-end with some small edits, and it is not clear at all that it
will eventually be used in this form at all. But until then, let's
keep it compiling.
Change-Id: Ia1bd63f2ecc621cd4ce699ffc754cab423321d42
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/ios/salgdi.h | 8 | ||||
-rw-r--r-- | vcl/ios/source/gdi/salgdicommon.cxx | 26 |
2 files changed, 31 insertions, 3 deletions
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h index 4743c88fa9d9..9456d71fa047 100644 --- a/vcl/inc/ios/salgdi.h +++ b/vcl/inc/ios/salgdi.h @@ -123,8 +123,12 @@ public: virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, - const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( + const ::basegfx::B2DPolygon&, + double fTransparency, + const ::basegfx::B2DVector& rLineWidths, + basegfx::B2DLineJoin, + com::sun::star::drawing::LineCap eLineCap); // CopyArea --> No RasterOp, but ClipRegion virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, diff --git a/vcl/ios/source/gdi/salgdicommon.cxx b/vcl/ios/source/gdi/salgdicommon.cxx index bba57352f799..8642a3504a64 100644 --- a/vcl/ios/source/gdi/salgdicommon.cxx +++ b/vcl/ios/source/gdi/salgdicommon.cxx @@ -662,7 +662,8 @@ void IosSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor ) bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, double fTransparency, const ::basegfx::B2DVector& rLineWidths, - basegfx::B2DLineJoin eLineJoin ) + basegfx::B2DLineJoin eLineJoin, + com::sun::star::drawing::LineCap eLineCap ) { // short circuit if there is nothing to do const int nPointCount = rPolyLine.count(); @@ -694,6 +695,28 @@ bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break; } + // setup cap attribute + CGLineCap aCGLineCap(kCGLineCapButt); + + switch(eLineCap) + { + default: // com::sun::star::drawing::LineCap_BUTT: + { + aCGLineCap = kCGLineCapButt; + break; + } + case com::sun::star::drawing::LineCap_ROUND: + { + aCGLineCap = kCGLineCapRound; + break; + } + case com::sun::star::drawing::LineCap_SQUARE: + { + aCGLineCap = kCGLineCapSquare; + break; + } + } + // setup poly-polygon path CGMutablePathRef xPath = CGPathCreateMutable(); AddPolygonToPath( xPath, rPolyLine, rPolyLine.isClosed(), !getAntiAliasB2DDraw(), true ); @@ -711,6 +734,7 @@ bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, CGContextSetShouldAntialias( mrContext, true ); CGContextSetAlpha( mrContext, 1.0 - fTransparency ); CGContextSetLineJoin( mrContext, aCGLineJoin ); + CGContextSetLineCap( mrContext, aCGLineCap ); CGContextSetLineWidth( mrContext, rLineWidths.getX() ); CGContextDrawPath( mrContext, kCGPathStroke ); CGContextRestoreGState( mrContext ); |