[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Wed Jul 8 07:36:30 PDT 2015


 vcl/opengl/gdiimpl.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit d9b7c779a0aed3bacccf5700a0179947db13afa8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jun 30 17:57:14 2015 +0900

    opengl: fix fat hairlines - draw hairlines using DrawLineAA
    
    Change-Id: I935bef48fd057e6223dcfc437cbaf2888842fd61
    Reviewed-on: https://gerrit.libreoffice.org/16857
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 351fc1d..e2512b6 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1348,20 +1348,19 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
     //bool bDrawnOk = true;
     if( bIsHairline )
     {
-        // hairlines can be drawn in a simpler way (the linejoin and linecap styles can be ignored)
-        basegfx::B2DTrapezoidVector aB2DTrapVector;
-        basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
-        // draw tesselation result
-        if( aB2DTrapVector.size())
+        PreDraw();
+        if( UseSolidAA( mnLineColor ) )
         {
-            PreDraw();
-            if( UseSolid( mnLineColor, fTransparency ))
+            sal_uInt32 nPoints = rPolygon.count();
+            for (sal_uInt32 i = 0; i < nPoints - 1; ++i)
             {
-                for( size_t i = 0; i < aB2DTrapVector.size(); ++i )
-                    DrawTrapezoid( aB2DTrapVector[ i ] );
+                const basegfx::B2DPoint& rPt1 = rPolygon.getB2DPoint(i);
+                const basegfx::B2DPoint& rPt2 = rPolygon.getB2DPoint(i+1);
+                DrawLineAA(rPt1.getX(), rPt1.getY(),
+                           rPt2.getX(), rPt2.getY());
             }
-            PostDraw();
         }
+        PostDraw();
         return true;
     }
 


More information about the Libreoffice-commits mailing list