summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToma┼ż Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-09-01 14:54:53 +0900
committerMichael Meeks <michael.meeks@collabora.com>2015-09-01 08:21:50 +0100
commitd12f8f49d02676359aba79e2d629e014d2f50860 (patch)
treee73691e6caabaf811adf2bd6d0efd4b62b2fff51
parentbce18e962dacdf6246123493690aa4b942568d10 (diff)
tdf#93736 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. (cherry picked from commit b3de73f32af6276a60f5678861c461631a75e743) Change-Id: I490fd0f19361b5fc9e1f4e03851c1ae1a1f75f71 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--vcl/opengl/gdiimpl.cxx33
1 files changed, 14 insertions, 19 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 266f61e239bb..7d71d8bb85f2 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1419,30 +1419,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))
+ Polygon aToolsPolygon(aPolygon);
+ sal_uInt32 nPoints = aToolsPolygon.GetSize();
+ if (aToolsPolygon.HasFlags())
+ {
+ aToolsPolygon = 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;
}