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

Luboš Luňák l.lunak at collabora.com
Mon Jan 19 13:48:58 PST 2015


 vcl/opengl/gdiimpl.cxx |   23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

New commits:
commit fb907e83ee2339b71d0358ee9761c4ff4b384be9
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Mon Jan 19 22:47:01 2015 +0100

    draw polypolygon outline properly (if wanted)
    
    Again, polygons can apparently have curved edges.
    
    Change-Id: I6519da7bb7f0dde7f1550fe6b03c09be127f77d6

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 19bd12e..bae5302 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1211,18 +1211,12 @@ bool OpenGLSalGraphicsImpl::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rP
     if( UseSolid( mnFillColor, fTransparency ) )
         DrawPolyPolygon( rPolyPolygon );
 
-    if( mnLineColor != mnFillColor && UseSolidAA( mnLineColor ) )
+    if( mnLineColor != mnFillColor && UseSolid( mnLineColor, fTransparency ))
     {
-        for( sal_uInt32 i = 0; i < rPolyPolygon.count(); i++ )
-        {
-            const basegfx::B2DPolygon& polygon = rPolyPolygon.getB2DPolygon( i );
-            for( sal_uInt32 j = 0; j < polygon.count(); ++j )
-            {
-                const basegfx::B2DPoint& rPt1 = polygon.getB2DPoint( j );
-                const basegfx::B2DPoint& rPt2 = polygon.getB2DPoint(( j + 1 ) % polygon.count());
-                DrawLineAA( rPt1.getX(), rPt1.getY(), rPt2.getX(), rPt2.getY());
-            }
-        }
+        basegfx::B2DTrapezoidVector aB2DTrapVector;
+        basegfx::tools::createLineTrapezoidFromB2DPolyPolygon( aB2DTrapVector, rPolyPolygon );
+        for( size_t i = 0; i < aB2DTrapVector.size(); ++i )
+            DrawTrapezoid( aB2DTrapVector[ i ] );
     }
 
     PostDraw();
commit bd976c2764ba8c33bf6b28b77c57dea25fb77aaf
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Mon Jan 19 22:36:40 2015 +0100

    do not draw with SALCOLOR_NONE
    
    Change-Id: I882a42f58ac298d333985068b2fe6ef9ac198c8b

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 6e9d156..19bd12e 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -406,6 +406,8 @@ bool OpenGLSalGraphicsImpl::UseSolid( SalColor nColor )
 // Like UseSolid(), but sets up for AA drawing, which uses gradients to create the AA.
 bool OpenGLSalGraphicsImpl::UseSolidAA( SalColor nColor, double fTransparency )
 {
+    if( nColor == SALCOLOR_NONE )
+        return false;
     if( !mrParent.getAntiAliasB2DDraw())
         return UseSolid( nColor );
     if( !UseProgram( "textureVertexShader", "linearGradientFragmentShader" ) )
commit 168315e3b79f89f6e373d23419490d41f3bf5cc8
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Mon Jan 19 22:33:29 2015 +0100

    remove needless loop
    
    Change-Id: Iaec5aa5bd353c888a3b35a277a3618c29d9cbd67

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 8a40f1a..6e9d156 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1172,10 +1172,7 @@ void OpenGLSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32*
     if( UseSolid( mnFillColor ) )
     {
         if( nPoly == 1 )
-        {
-            for( sal_uInt32 i = 0; i < nPoly; i++ )
-                DrawPolygon( pPoints[i], pPtAry[i] );
-        }
+            DrawPolygon( pPoints[ 0 ], pPtAry[ 0 ] );
         else
         {
             basegfx::B2DPolyPolygon polyPolygon;


More information about the Libreoffice-commits mailing list