vcl/headless/svpgdi.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
New commits: commit 548a28b213e680a6ffd4c3822e97131a64311956 Author: Armin Le Grand <armin.le.gr...@me.com> AuthorDate: Sat Feb 8 12:14:09 2020 +0100 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Wed Feb 12 21:38:28 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.gr...@me.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88557 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> 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); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits