summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-07-28 04:06:04 +0900
committerTomaž Vajngerl <quikee@gmail.com>2016-07-28 13:05:06 +0000
commitaeb0c407a620ea8c28903f61d9d53e6d9ae7c53a (patch)
treefcc0dd25450a4f6a22a406813fff7228bfd6e962
parent7150d4840f090a38ac4390ac503ac10552ed1ae4 (diff)
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>
-rw-r--r--vcl/opengl/RenderList.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/vcl/opengl/RenderList.cxx b/vcl/opengl/RenderList.cxx
index 5c59002f95ff..5f99513bba17 100644
--- a/vcl/opengl/RenderList.cxx
+++ b/vcl/opengl/RenderList.cxx
@@ -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)
{