vcl/opengl/gdiimpl.cxx | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-)
New commits: commit b3de73f32af6276a60f5678861c461631a75e743 Author: Tomaž Vajngerl <[email protected]> Date: Tue Sep 1 14:54:53 2015 +0900 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 diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index df3b797..c16b93b 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; }
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
