summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2020-02-08 12:14:09 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2020-02-12 21:38:28 +0100
commit548a28b213e680a6ffd4c3822e97131a64311956 (patch)
tree322e446f3adeddc95bef10adb3959d4dd6fa135e /vcl
parentc72da1dca660f2bd8b15f1d97f44302de3a5f03b (diff)
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@me.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88557 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/svpgdi.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 8dcdcc5df44c..bcfde817b604 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1305,7 +1305,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?
@@ -1347,7 +1356,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(
@@ -1359,7 +1368,7 @@ bool SvpSalGraphics::drawPolyLine(
}
else
{
- // no line dashing, just copy
+ // no line dashing or direct stroke, just copy
aPolyPolygonLine.append(rPolyLine);
}