Kaydet (Commit) aeb0c407 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

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/27611Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 7150d484
...@@ -308,23 +308,16 @@ void RenderList::addDrawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon, ...@@ -308,23 +308,16 @@ void RenderList::addDrawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon,
topX1, topY, topX2, topY, topX1, topY, topX2, topY,
bottomX1, bottomY, bottomX2, bottomY, bottomX1, bottomY, bottomX2, bottomY,
nFillColor, fTransparency); 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, vcl::LineBuilder aBuilder(rLineRenderParameter.maVertices, rLineRenderParameter.maIndices,
nLineColor, fTransparency, 1.0f, bUseAA); nColor, fTransparency, 1.0f, bUseAA);
for (const basegfx::B2DPolygon& rPolygon : rPolyPolygon) for (const basegfx::B2DPolygon& rPolygon : rPolyPolygon)
{ {
......
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