diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-12 11:49:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-12 14:06:28 +0100 |
commit | f510ea2d7962a4325055c6380a0032331b4e87cf (patch) | |
tree | 5e240ebf05b7f7aeb4c2020eb065fbfe8b4bea9d | |
parent | d1bc9d8510299aa9c31589ecb31457b98e644e58 (diff) |
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.grandin@collabora.co.uk>
-rw-r--r-- | vcl/headless/SvpGraphicsBackend.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
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); |