diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-09-01 14:54:53 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-09-01 15:17:31 +0900 |
commit | b3de73f32af6276a60f5678861c461631a75e743 (patch) | |
tree | 76b4dce674a98772f67cf6387c0a22c321675bfd /vcl/opengl | |
parent | 0c1d3f0c17296c113358228cf36596347fd045e3 (diff) |
opengl: use "old" SubdivideBezier when drawing PolyLines
SubdivideBezier creates polygons which are more exact for drawing
in opengl when drawing hairline PolyLines - so let's use that with
AA line drawing.
Change-Id: I490fd0f19361b5fc9e1f4e03851c1ae1a1f75f71
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index df3b7979fe21..c16b93bfe1a1 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1416,30 +1416,25 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( const double fHalfWidth = 0.5 * rLineWidth.getX(); // shortcut for hairline drawing to improve performance - if( bIsHairline ) + if (bIsHairline) { - basegfx::B2DTrapezoidVector aTrapezVector; - basegfx::tools::createLineTrapezoidFromB2DPolygon(aTrapezVector, aPolygon, rLineWidth.getX()); - if (aTrapezVector.size()) + PreDraw(); + if (UseSolidAA(mnLineColor, fTransparency)) { - PreDraw(); - if (UseSolidAA(mnLineColor, fTransparency)) + tools::Polygon aToolsPolygon(aPolygon); + sal_uInt32 nPoints = aToolsPolygon.GetSize(); + if (aToolsPolygon.HasFlags()) + { + aToolsPolygon = tools::Polygon::SubdivideBezier(aToolsPolygon); + nPoints = aToolsPolygon.GetSize(); + } + for (sal_uInt32 i = 0; i < nPoints - 1; ++i) { - for (size_t i = 0; i < aTrapezVector.size(); ++i) - { - const basegfx::B2DPolygon& rTrapezPolygon = aTrapezVector[i].getB2DPolygon(); - sal_uInt32 nPoints = rTrapezPolygon.count(); - for (sal_uInt32 j = 0; j < nPoints - 1; ++j) - { - const basegfx::B2DPoint& rPoint1 = rTrapezPolygon.getB2DPoint(j); - const basegfx::B2DPoint& rPoint2 = rTrapezPolygon.getB2DPoint(j + 1); - DrawLineAA(rPoint1.getX(), rPoint1.getY(), - rPoint2.getX(), rPoint2.getY()); - } - } + DrawLineAA(aToolsPolygon[i].X(), aToolsPolygon[i].Y(), + aToolsPolygon[i + 1].X(), aToolsPolygon[i + 1].Y()); } - PostDraw(); } + PostDraw(); return true; } |