Kaydet (Commit) 426ec2de authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Michael Meeks

opengl: let OutputDevice do the bezier subdivision

(cherry picked from commit 796b2d6b)

Conflicts:
	vcl/opengl/gdiimpl.cxx

Change-Id: I0620cd29695d792320c6e3209dff84822485d883
Reviewed-on: https://gerrit.libreoffice.org/18287Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 498dae65
...@@ -1427,33 +1427,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( ...@@ -1427,33 +1427,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
return false; return false;
} }
// #i11575#desc5#b adjust B2D tesselation result to raster positions
basegfx::B2DPolygon aPolygon = rPolygon;
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)
{ {
PreDraw(); // Let's just leave it to OutputDevice to do the bezier subdivision,
if (UseSolidAA(mnLineColor, fTransparency)) // drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAry) will be
{ // called with the result.
Polygon aToolsPolygon(aPolygon); return false;
sal_uInt32 nPoints = aToolsPolygon.GetSize();
if (aToolsPolygon.HasFlags())
{
aToolsPolygon = Polygon::SubdivideBezier(aToolsPolygon);
nPoints = aToolsPolygon.GetSize();
}
for (sal_uInt32 i = 0; i < nPoints - 1; ++i)
{
DrawLineAA(aToolsPolygon[i].X(), aToolsPolygon[i].Y(),
aToolsPolygon[i + 1].X(), aToolsPolygon[i + 1].Y());
}
}
PostDraw();
return true;
} }
// #i11575#desc5#b adjust B2D tesselation result to raster positions
basegfx::B2DPolygon aPolygon = rPolygon;
const double fHalfWidth = 0.5 * rLineWidth.getX();
// get the area polygon for the line polygon // get the area polygon for the line polygon
if( (rLineWidth.getX() != rLineWidth.getY()) if( (rLineWidth.getX() != rLineWidth.getY())
&& !basegfx::fTools::equalZero( rLineWidth.getY() ) ) && !basegfx::fTools::equalZero( rLineWidth.getY() ) )
......
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