vcl/headless/SvpGraphicsBackend.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit f510ea2d7962a4325055c6380a0032331b4e87cf
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 12 11:49:35 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jan 12 14:06:28 2022 +0100

    don't bother trying to draw stuff which is effectively invisible
    
    speeds up rendering of complex drawings with fine lines
    
    Change-Id: I62924c5ddb6293f993eef9ca200a43cba753d53e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128312
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index f564b7e78958..86b804c47146 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -247,6 +247,12 @@ bool SvpGraphicsBackend::drawPolyPolygon(const 
basegfx::B2DHomMatrix& rObjectToD
         return true;
     }
 
+    // don't bother trying to draw stuff which is effectively invisible
+    basegfx::B2DRange aPolygonRange = rPolyPolygon.getB2DRange();
+    aPolygonRange.transform(rObjectToDevice);
+    if (aPolygonRange.getWidth() < 0.1 || aPolygonRange.getHeight() < 0.1)
+        return true;
+
     cairo_t* cr = m_rCairoCommon.getCairoContext(true, getAntiAlias());
     m_rCairoCommon.clipRegion(cr);
 

Reply via email to