diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-06-30 17:57:14 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-07-03 14:52:27 +0900 |
commit | 240e5daab408c4189a2687ab44cffd73572ee8a8 (patch) | |
tree | 89acd55fb7b9772eed1c08b35c5394b07bce958a /vcl | |
parent | 9583020ae4d20c1cccbe5157f51512cbb5c5d494 (diff) |
opengl: fix fat hairlines - draw hairlines using DrawLineAA
Change-Id: I935bef48fd057e6223dcfc437cbaf2888842fd61
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 351fc1de9a0d..e2512b64e595 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1348,20 +1348,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( //bool bDrawnOk = true; if( bIsHairline ) { - // hairlines can be drawn in a simpler way (the linejoin and linecap styles can be ignored) - basegfx::B2DTrapezoidVector aB2DTrapVector; - basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); - // draw tesselation result - if( aB2DTrapVector.size()) + PreDraw(); + if( UseSolidAA( mnLineColor ) ) { - PreDraw(); - if( UseSolid( mnLineColor, fTransparency )) + sal_uInt32 nPoints = rPolygon.count(); + for (sal_uInt32 i = 0; i < nPoints - 1; ++i) { - for( size_t i = 0; i < aB2DTrapVector.size(); ++i ) - DrawTrapezoid( aB2DTrapVector[ i ] ); + const basegfx::B2DPoint& rPt1 = rPolygon.getB2DPoint(i); + const basegfx::B2DPoint& rPt2 = rPolygon.getB2DPoint(i+1); + DrawLineAA(rPt1.getX(), rPt1.getY(), + rPt2.getX(), rPt2.getY()); } - PostDraw(); } + PostDraw(); return true; } |