tdf#100915 draw antialiased line just for polygon outline
To get the anti-aliased polygon we draw a anti-aliased line around every trapezoid. This works fine until we draw a transparent polygon where the lines become visible because of blending. A much better and faster way is to just draw the polygon outline with anti-aliased lines. This is done with this commit. Change-Id: Ice50e5eb3343f2c5d51ade8ad0e170043541f0ff Reviewed-on: https://gerrit.libreoffice.org/27611 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
committed by
Tomaž Vajngerl
parent
7150d4840f
commit
aeb0c407a6
@@ -308,23 +308,16 @@ void RenderList::addDrawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon,
|
||||
topX1, topY, topX2, topY,
|
||||
bottomX1, bottomY, bottomX2, bottomY,
|
||||
nFillColor, fTransparency);
|
||||
if (bUseAA)
|
||||
{
|
||||
vcl::LineBuilder aBuilder(rLineRenderParameter.maVertices, rLineRenderParameter.maIndices,
|
||||
nFillColor, fTransparency, 1.0f, true);
|
||||
aBuilder.appendLine(glm::vec2(topX1, topY), glm::vec2(topX2, topY));
|
||||
aBuilder.appendLine(glm::vec2(topX2, topY), glm::vec2(bottomX2, bottomY));
|
||||
aBuilder.appendLine(glm::vec2(bottomX2, bottomY), glm::vec2(bottomX1, bottomY));
|
||||
aBuilder.appendLine(glm::vec2(bottomX1, bottomY), glm::vec2(topX1, topY));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nLineColor != SALCOLOR_NONE && nLineColor != nFillColor)
|
||||
if (nLineColor != SALCOLOR_NONE || bUseAA)
|
||||
{
|
||||
SalColor nColor = (nLineColor == SALCOLOR_NONE) ? nFillColor : nLineColor;
|
||||
|
||||
vcl::LineBuilder aBuilder(rLineRenderParameter.maVertices, rLineRenderParameter.maIndices,
|
||||
nLineColor, fTransparency, 1.0f, bUseAA);
|
||||
nColor, fTransparency, 1.0f, bUseAA);
|
||||
|
||||
for (const basegfx::B2DPolygon& rPolygon : rPolyPolygon)
|
||||
{
|
||||
|
Reference in New Issue
Block a user