[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - canvas/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 15 13:27:43 UTC 2020


 canvas/source/vcl/canvashelper.cxx |   29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

New commits:
commit 7f314586cdaea97636699b05f94fbefcc05cc71f
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Jun 12 17:56:22 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Jun 15 15:27:13 2020 +0200

    vcl canvas, don't draw bezier curves as straight lines (tdf#133905)
    
    Change-Id: I8a5029ef7aa6e8f46b13f0713445da435b47dbed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96209
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
    (cherry picked from commit 2b01f76d59ff83ba544d48d14c9f68e81ea6d3fd)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96332

diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 07dc45574e64..0b3f49d38d9b 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -394,8 +394,6 @@ namespace vclcanvas
             // user coordinates.
             aStrokedPolyPoly.transform( aMatrix );
 
-            const ::tools::PolyPolygon aVCLPolyPoly( aStrokedPolyPoly );
-
             // TODO(F2): When using alpha here, must handle that via
             // temporary surface or somesuch.
 
@@ -403,28 +401,17 @@ namespace vclcanvas
             // self-intersections. Therefore, if we would render it
             // via OutDev::DrawPolyPolygon(), on/off fill would
             // generate off areas on those self-intersections.
-            sal_uInt16 nSize( aVCLPolyPoly.Count() );
-
-            for( sal_uInt16 i=0; i<nSize; ++i )
+            for( sal_uInt32 i=0; i<aStrokedPolyPoly.count(); ++i )
             {
-                if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) {
-                    mpOutDevProvider->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
+                const basegfx::B2DPolygon& polygon = aStrokedPolyPoly.getB2DPolygon( i );
+                if( polygon.isClosed()) {
+                    mpOutDevProvider->getOutDev().DrawPolygon( polygon );
                     if( mp2ndOutDevProvider )
-                        mp2ndOutDevProvider->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
+                        mp2ndOutDevProvider->getOutDev().DrawPolygon( polygon );
                 } else {
-                    const sal_uInt16 nPolySize = aVCLPolyPoly[i].GetSize();
-                    if( nPolySize ) {
-                        Point rPrevPoint = aVCLPolyPoly[i].GetPoint( 0 );
-                        Point rPoint;
-
-                        for( sal_uInt16 j=1; j<nPolySize; j++ ) {
-                            rPoint = aVCLPolyPoly[i].GetPoint( j );
-                            mpOutDevProvider->getOutDev().DrawLine( rPrevPoint, rPoint );
-                            if( mp2ndOutDevProvider )
-                                mp2ndOutDevProvider->getOutDev().DrawLine( rPrevPoint, rPoint );
-                            rPrevPoint = rPoint;
-                        }
-                    }
+                    mpOutDevProvider->getOutDev().DrawPolyLine( polygon );
+                    if( mp2ndOutDevProvider )
+                        mp2ndOutDevProvider->getOutDev().DrawPolyLine( polygon );
                 }
             }
         }


More information about the Libreoffice-commits mailing list