Kaydet (Commit) b3de73f3 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

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
üst 0c1d3f0c
...@@ -1416,30 +1416,25 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( ...@@ -1416,30 +1416,25 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
const double fHalfWidth = 0.5 * rLineWidth.getX(); const double fHalfWidth = 0.5 * rLineWidth.getX();
// shortcut for hairline drawing to improve performance // shortcut for hairline drawing to improve performance
if( bIsHairline ) if (bIsHairline)
{ {
basegfx::B2DTrapezoidVector aTrapezVector; PreDraw();
basegfx::tools::createLineTrapezoidFromB2DPolygon(aTrapezVector, aPolygon, rLineWidth.getX()); if (UseSolidAA(mnLineColor, fTransparency))
if (aTrapezVector.size())
{ {
PreDraw(); tools::Polygon aToolsPolygon(aPolygon);
if (UseSolidAA(mnLineColor, fTransparency)) 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) DrawLineAA(aToolsPolygon[i].X(), aToolsPolygon[i].Y(),
{ aToolsPolygon[i + 1].X(), aToolsPolygon[i + 1].Y());
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());
}
}
} }
PostDraw();
} }
PostDraw();
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment