[Libreoffice-commits] .: vcl/inc vcl/ios
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 6 06:42:25 PST 2012
vcl/inc/ios/salgdi.h | 8 ++++++--
vcl/ios/source/gdi/salgdicommon.cxx | 26 +++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 3 deletions(-)
New commits:
commit f354ba7a3aba1301f3951fdd9f74a38bd94255af
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Nov 6 16:39:47 2012 +0200
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
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
index 4743c88..9456d71 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 bba5735..8642a35 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 );
More information about the Libreoffice-commits
mailing list