[Libreoffice-commits] core.git: vcl/headless
Armin Le Grand (via logerrit)
logerrit at kemper.freedesktop.org
Sat Feb 8 15:24:59 UTC 2020
vcl/headless/svpgdi.cxx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 9c9f76dd5b6fb115e521ac6568673c7a10879192
Author: Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Sat Feb 8 12:14:09 2020 +0100
Commit: Armin Le Grand <Armin.Le.Grand at me.com>
CommitDate: Sat Feb 8 16:24:27 2020 +0100
tdf#130478 add direct dash paint in cairo
Make use of mentioned task's 1st commit now
and implement direct dashing for cairo. All
the data is now available (that was the work),
make use of it.
Keeping a local static bool to control it, so
later if needed can be switched on/off e.g
using some global var/setting.
Cairo will now do buffering of complex polygon
data in cairo path data (from some compexity
on and timer/mem-controlled), but not dismantle
to own, stroked data.
With bDoDirectCairoStroke disabled, the dis-
mantled data will be buffered - more mem, but
should also help - at least it gets reused
now that it is possible to keep it at the
original geometry (incoming polygon) at all
Change-Id: Ic08f659d7ccbedc910ec678b1509ee1a7f3f2112
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88262
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand at me.com>
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index b3bb3f780a5a..b015006e646e 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1322,7 +1322,16 @@ bool SvpSalGraphics::drawPolyLine(
const double fDotDashLength(nullptr != pStroke ? std::accumulate(pStroke->begin(), pStroke->end(), 0.0) : 0.0);
const bool bStrokeUsed(0.0 != fDotDashLength);
- if(pSystemDependentData_CairoPath)
+ // MM01 decide if to stroke direcly
+ static bool bDoDirectCairoStroke(true);
+
+ // MM01 activate to stroke direcly
+ if(bDoDirectCairoStroke && bStrokeUsed)
+ {
+ cairo_set_dash(cr, pStroke->data(), pStroke->size(), 0.0);
+ }
+
+ if(!bDoDirectCairoStroke && pSystemDependentData_CairoPath)
{
// MM01 - check on stroke change. Used against not used, or if both used,
// equal or different?
@@ -1366,7 +1375,7 @@ bool SvpSalGraphics::drawPolyLine(
// MM01 need to do line dashing as fallback stuff here now
basegfx::B2DPolyPolygon aPolyPolygonLine;
- if(bStrokeUsed)
+ if(!bDoDirectCairoStroke && bStrokeUsed)
{
// apply LineStyle
basegfx::utils::applyLineDashing(
@@ -1378,7 +1387,7 @@ bool SvpSalGraphics::drawPolyLine(
}
else
{
- // no line dashing, just copy
+ // no line dashing or direct stroke, just copy
aPolyPolygonLine.append(rPolyLine);
}
More information about the Libreoffice-commits
mailing list