summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2015-01-08 18:09:49 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-01-13 16:03:28 +0000
commitc54196932b744c0b7d2cb236724582c93eff4c77 (patch)
treeae46332a95a63ede2b0ee26664dd2d21e42d1822
parentdo not set Y line width to 0 (diff)
downloadcore-private/mmeeks/aafixes44.tar.gz
core-private/mmeeks/aafixes44.zip
implement optimized hairline drawing for opengl private/mmeeks/aafixes44
As a side effect, this prevents the lines from looking too wide, because of generic polygon drawing being a bit too generous with AA. Change-Id: I17314c39fd57e33ecbd10b8a8785c600bdc5b212 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--vcl/opengl/gdiimpl.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 07a7cd7cff2b..6c565faf58f4 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1219,17 +1219,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
//bool bDrawnOk = true;
if( bIsHairline )
{
- // hairlines can benefit from a simplified tesselation
- // e.g. for hairlines the linejoin style can be ignored
- /*basegfx::B2DTrapezoidVector aB2DTrapVector;
- basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
-
- // draw tesselation result
- const int nTrapCount = aB2DTrapVector.size();
- if( nTrapCount > 0 )
- bDrawnOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
-
- return bDrawnOk;*/
+ // hairlines can be drawn in a simpler way (the linejoin and linecap styles can be ignored)
+ PreDraw();
+ if( UseSolidAA( mnLineColor, fTransparency ))
+ {
+ for( sal_uInt32 j = 0; j < rPolygon.count() - 1; j++ )
+ {
+ const ::basegfx::B2DPoint& rPt1( rPolygon.getB2DPoint( j ) );
+ const ::basegfx::B2DPoint& rPt2( rPolygon.getB2DPoint(( j + 1 )) );
+ DrawLineAA( rPt1.getX(), rPt1.getY(), rPt2.getX(), rPt2.getY());
+ }
+ }
+ PostDraw();
+ return true;
}
// get the area polygon for the line polygon