vcl/opengl/gdiimpl.cxx | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-)
New commits: commit d12f8f49d02676359aba79e2d629e014d2f50860 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> Date: Tue Sep 1 14:54:53 2015 +0900 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.me...@collabora.com> diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 266f61e..7d71d8b 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; }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits