Kaydet (Commit) 240e5daa authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

opengl: fix fat hairlines - draw hairlines using DrawLineAA

Change-Id: I935bef48fd057e6223dcfc437cbaf2888842fd61
üst 9583020a
...@@ -1348,20 +1348,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( ...@@ -1348,20 +1348,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
//bool bDrawnOk = true; //bool bDrawnOk = true;
if( bIsHairline ) if( bIsHairline )
{ {
// hairlines can be drawn in a simpler way (the linejoin and linecap styles can be ignored) PreDraw();
basegfx::B2DTrapezoidVector aB2DTrapVector; if( UseSolidAA( mnLineColor ) )
basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
// draw tesselation result
if( aB2DTrapVector.size())
{ {
PreDraw(); sal_uInt32 nPoints = rPolygon.count();
if( UseSolid( mnLineColor, fTransparency )) for (sal_uInt32 i = 0; i < nPoints - 1; ++i)
{ {
for( size_t i = 0; i < aB2DTrapVector.size(); ++i ) const basegfx::B2DPoint& rPt1 = rPolygon.getB2DPoint(i);
DrawTrapezoid( aB2DTrapVector[ i ] ); const basegfx::B2DPoint& rPt2 = rPolygon.getB2DPoint(i+1);
DrawLineAA(rPt1.getX(), rPt1.getY(),
rPt2.getX(), rPt2.getY());
} }
PostDraw();
} }
PostDraw();
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment