[Libreoffice-commits] core.git: vcl/opengl

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Thu Jul 28 13:05:35 UTC 2016


 vcl/opengl/RenderList.cxx |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit aeb0c407a620ea8c28903f61d9d53e6d9ae7c53a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Jul 28 04:06:04 2016 +0900

    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 at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/opengl/RenderList.cxx b/vcl/opengl/RenderList.cxx
index 5c59002..5f99513 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)
         {


More information about the Libreoffice-commits mailing list