vcl/headless/SvpGraphicsBackend.cxx |   21 +++++++++++++++++++--
 vcl/headless/svpgdi.cxx             |   26 --------------------------
 vcl/inc/headless/svpgdi.hxx         |    4 +---
 3 files changed, 20 insertions(+), 31 deletions(-)

New commits:
commit 96107b0196a0b91e8966db1f12052f5c3d32c944
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Sat Nov 27 21:40:41 2021 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Sat Jan 1 03:51:00 2022 +0100

    vcl: move drawPolyPolygon(..., Point**) to SvpGraphicsBackend
    
    This moves the legacy drawPolyPolygon, which takes a 2D array of
    points as the input. The implementation just converts it to a
    B2dPolyPolygon and calls the regular drawPolyPolygon.
    
    Change-Id: I5be8b818bcdf58a15e575b904ed20bb8f97bcffc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127738
    Tested-by: Tomaž Vajngerl <[email protected]>
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index b44ba3dda90f..f19749196cab 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -191,9 +191,26 @@ void SvpGraphicsBackend::drawPolyLine(sal_uInt32 
/*nPoints*/, const Point* /*pPt
 
 void SvpGraphicsBackend::drawPolygon(sal_uInt32 /*nPoints*/, const Point* 
/*pPtAry*/) {}
 
-void SvpGraphicsBackend::drawPolyPolygon(sal_uInt32 /*nPoly*/, const 
sal_uInt32* /*pPointCounts*/,
-                                         const Point** /*pPtAry*/)
+void SvpGraphicsBackend::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* 
pPointCounts,
+                                         const Point** pPtAry)
 {
+    basegfx::B2DPolyPolygon aPolyPoly;
+    for (sal_uInt32 nPolygon = 0; nPolygon < nPoly; ++nPolygon)
+    {
+        sal_uInt32 nPoints = pPointCounts[nPolygon];
+        if (nPoints)
+        {
+            const Point* pPoints = pPtAry[nPolygon];
+            basegfx::B2DPolygon aPoly;
+            aPoly.append(basegfx::B2DPoint(pPoints->getX(), pPoints->getY()), 
nPoints);
+            for (sal_uInt32 i = 1; i < nPoints; ++i)
+                aPoly.setB2DPoint(i, basegfx::B2DPoint(pPoints[i].getX(), 
pPoints[i].getY()));
+
+            aPolyPoly.append(aPoly);
+        }
+    }
+
+    drawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPoly, 0.0);
 }
 
 bool SvpGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& 
rObjectToDevice,
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 65f9e13aafd5..51de3dc1d9b6 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -885,32 +885,6 @@ void SvpSalGraphics::drawPolygon(sal_uInt32 nPoints, const 
Point* pPtAry)
         0.0);
 }
 
-void SvpSalGraphics::drawPolyPolygon(sal_uInt32 nPoly,
-                                     const sal_uInt32* pPointCounts,
-                                     const Point**   pPtAry)
-{
-    basegfx::B2DPolyPolygon aPolyPoly;
-    for(sal_uInt32 nPolygon = 0; nPolygon < nPoly; ++nPolygon)
-    {
-        sal_uInt32 nPoints = pPointCounts[nPolygon];
-        if (nPoints)
-        {
-            const Point* pPoints = pPtAry[nPolygon];
-            basegfx::B2DPolygon aPoly;
-            aPoly.append( basegfx::B2DPoint(pPoints->getX(), pPoints->getY()), 
nPoints);
-            for (sal_uInt32 i = 1; i < nPoints; ++i)
-                aPoly.setB2DPoint(i, basegfx::B2DPoint( pPoints[i].getX(), 
pPoints[i].getY()));
-
-            aPolyPoly.append(aPoly);
-        }
-    }
-
-    GetImpl()->drawPolyPolygon(
-        basegfx::B2DHomMatrix(),
-        aPolyPoly,
-        0.0);
-}
-
 bool SvpSalGraphics::drawPolyLine(
     const basegfx::B2DHomMatrix& rObjectToDevice,
     const basegfx::B2DPolygon& rPolyLine,
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 1196b29ca26e..0db4fb0a73ed 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -149,9 +149,7 @@ public:
                                 bool bPixelSnapHairline) override;
     virtual void            drawPolyLine( sal_uInt32 nPoints, const Point* 
pPtAry ) override;
     virtual void            drawPolygon( sal_uInt32 nPoints, const Point* 
pPtAry ) override;
-    virtual void            drawPolyPolygon( sal_uInt32 nPoly,
-                                             const sal_uInt32* pPoints,
-                                             const Point** pPtAry ) override;
+
     virtual bool        drawPolyLineBezier( sal_uInt32 nPoints,
                                                 const Point* pPtAry,
                                                 const PolyFlags* pFlgAry ) 
override;

Reply via email to