diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-02-08 12:14:09 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-02-08 16:24:27 +0100 |
commit | 9c9f76dd5b6fb115e521ac6568673c7a10879192 (patch) | |
tree | 6c3b949ee5616ce65452e7311cc8fc47622d2cff /vcl/headless | |
parent | ef877db09c11f7e201a4bc941e05085bd0eef956 (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>
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
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); } |