From f510ea2d7962a4325055c6380a0032331b4e87cf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Jan 2022 11:49:35 +0200 Subject: 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 --- vcl/headless/SvpGraphicsBackend.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl/headless') 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); -- cgit