summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-21 15:48:10 +0200
committerobo <obo@openoffice.org>2010-06-21 15:48:10 +0200
commit1480902589982d0e3ae20b1beb19e31cb1ad3d2f (patch)
tree8c7ee86c5a43874ed6b005226e00ff85e9ceca44 /vcl/source/gdi
parent91da6e6458e2ba410ac9dd4fe606205dbb4e60f8 (diff)
parent5d119d28d30185fc23d99534308ec8633d3ba63b (diff)
CWS-TOOLING: integrate CWS vcl112
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/outdev.cxx16
-rw-r--r--vcl/source/gdi/outdev6.cxx38
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx14
-rw-r--r--vcl/source/gdi/salgdilayout.cxx7
4 files changed, 45 insertions, 30 deletions
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index bb5e4e3ba36d..a011e4ee4a92 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -2311,7 +2311,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
}
- if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this))
+ if( mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this))
{
return;
}
@@ -2416,7 +2416,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
if(bTryAA)
{
- bDone = mpGraphics->DrawPolyLine(aCandidate, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLINEJOIN_NONE, this);
+ bDone = mpGraphics->DrawPolyLine( aCandidate, 0.0, basegfx::B2DVector(1.0,1.0), basegfx::B2DLINEJOIN_NONE, this);
}
if(!bDone)
@@ -2605,7 +2605,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
}
- if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this))
+ if(mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this))
{
return;
}
@@ -2653,7 +2653,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& LINE_SOLID == rLineInfo.GetStyle())
{
- DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin());
+ DrawPolyLine( rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin());
return;
}
@@ -2785,7 +2785,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
aB2DPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolygon);
}
- bSuccess = mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
+ bSuccess = mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
}
if(bSuccess)
@@ -2877,7 +2877,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
for(sal_uInt32 a(0); bSuccess && a < aB2DPolyPolygon.count(); a++)
{
- bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
+ bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
}
}
@@ -3000,7 +3000,7 @@ void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPo
for(sal_uInt32 a(0);bSuccess && a < aB2DPolyPolygon.count(); a++)
{
- bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
+ bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
}
}
@@ -3047,7 +3047,7 @@ bool OutputDevice::ImpTryDrawPolyLineDirect(
}
// draw the polyline
- return mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, eLineJoin, this);
+ return mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, eLineJoin, this);
}
void OutputDevice::DrawPolyLine(
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index bef37284adbd..47b150ddc4c5 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -184,18 +184,31 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
- && ROP_OVERPAINT == GetRasterOp()
- && IsFillColor())
+ && ROP_OVERPAINT == GetRasterOp() )
{
// b2dpolygon support not implemented yet on non-UNX platforms
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly);
- // transform the polygon and ensure closed
- aB2DPolyPolygon.transform(aTransform);
- aB2DPolyPolygon.setClosed(true);
+ // transform the polygon into device space and ensure it is closed
+ aB2DPolyPolygon.transform( aTransform );
+ aB2DPolyPolygon.setClosed( true );
- if(mpGraphics->DrawPolyPolygon(aB2DPolyPolygon, fTransparency, this))
+ bool bDrawnOk = true;
+ if( IsFillColor() )
+ bDrawnOk = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this );
+ if( bDrawnOk && IsLineColor() )
+ {
+ const basegfx::B2DVector aHairlineWidth(1,1);
+ const int nPolyCount = aB2DPolyPolygon.count();
+ for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
+ {
+ const ::basegfx::B2DPolygon aOnePoly = aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
+ mpGraphics->DrawPolyLine( aOnePoly, fTransparency, aHairlineWidth, ::basegfx::B2DLINEJOIN_NONE, this );
+ }
+ }
+
+ if( bDrawnOk )
{
#if 0
// MetaB2DPolyPolygonAction is not implemented yet:
@@ -287,14 +300,17 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
// get the polygon in device coordinates
basegfx::B2DPolyPolygon aB2DPolyPolygon( rPolyPoly.getB2DPolyPolygon() );
- aB2DPolyPolygon.setClosed( true );
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyPolygon.transform( aTransform );
- // draw the transparent polygon
- bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, nTransparencePercent*0.01, this );
+ const double fTransparency = 0.01 * nTransparencePercent;
+ if( mbFillColor )
+ {
+ // draw the transparent polygon
+ // NOTE: filled polygons are assumed to be drawn as if they were always closed
+ bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this );
+ }
- // DrawTransparent() assumes that the border is NOT to be drawn transparently???
if( mbLineColor )
{
// disable the fill color for now
@@ -305,7 +321,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
{
const ::basegfx::B2DPolygon& rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
- mpGraphics->DrawPolyLine( rPolygon, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this );
+ bDrawn = mpGraphics->DrawPolyLine( rPolygon, fTransparency, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this );
}
// prepare to restore the fill color
mbInitFillColor = mbFillColor;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 77f7f74fc10e..6cb0a7d07697 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -4081,15 +4081,15 @@ bool PDFWriterImpl::emitFonts()
}
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA?
{
- unsigned char* pBuffer = new unsigned char[ (int)nLength1 ];
+ boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] );
sal_uInt64 nBytesRead = 0;
- CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer, nLength1, &nBytesRead ) ) );
+ CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) );
DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" );
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
// get the PFB-segment lengths
ThreeInts aSegmentLengths = {0,0,0};
- getPfbSegmentLengths( pBuffer, (int)nBytesRead, aSegmentLengths );
+ getPfbSegmentLengths( pBuffer.get(), (int)nBytesRead, aSegmentLengths );
// the lengths below are mandatory for PDF-exported Type1 fonts
// because the PFB segment headers get stripped! WhyOhWhy.
aLine.append( (sal_Int32)aSegmentLengths[0] );
@@ -4106,11 +4106,9 @@ bool PDFWriterImpl::emitFonts()
// emit PFB-sections without section headers
beginCompression();
checkAndEnableStreamEncryption( nFontStream );
- CHECK_RETURN( writeBuffer( pBuffer+ 6, aSegmentLengths[0] ) );
- CHECK_RETURN( writeBuffer( pBuffer+12 + aSegmentLengths[0], aSegmentLengths[1] ) );
- CHECK_RETURN( writeBuffer( pBuffer+18 + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) );
-
- delete[] pBuffer;
+ CHECK_RETURN( writeBuffer( &pBuffer[6], aSegmentLengths[0] ) );
+ CHECK_RETURN( writeBuffer( &pBuffer[12] + aSegmentLengths[0], aSegmentLengths[1] ) );
+ CHECK_RETURN( writeBuffer( &pBuffer[18] + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) );
}
else
{
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 84e45979d679..7a6808a0e392 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -405,6 +405,7 @@ void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, cons
}
bool SalGraphics::drawPolyLine(
const basegfx::B2DPolygon& /*rPolyPolygon*/,
+ double /*fTransparency*/,
const basegfx::B2DVector& /*rLineWidths*/,
basegfx::B2DLineJoin /*eLineJoin*/)
{
@@ -536,7 +537,7 @@ sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt3
return bRet;
}
-bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon,
+bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double fTransparency,
const ::basegfx::B2DVector& i_rLineWidth, basegfx::B2DLineJoin i_eLineJoin,
const OutputDevice* i_pOutDev )
{
@@ -544,10 +545,10 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon,
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
- bRet = drawPolyLine( aMirror, i_rLineWidth, i_eLineJoin );
+ bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin );
}
else
- bRet = drawPolyLine( i_rPolygon, i_rLineWidth, i_eLineJoin );
+ bRet = drawPolyLine( i_rPolygon, fTransparency, i_rLineWidth, i_eLineJoin );
return bRet;
}