[Libreoffice-commits] core.git: vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed May 6 10:17:28 UTC 2020


 vcl/skia/gdiimpl.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 19796c46d55676aea3b171e4f45cf9b6b7b6484c
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon May 4 18:08:03 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed May 6 12:16:55 2020 +0200

    batch polyline drawing for basegfx::B2DLineJoin::NONE if small width
    
    For pixel-wide lines it should not make a difference.
    
    Change-Id: I28a9034eef9a81c6899c5fae679af5e413ee981c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93435
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 00cf34d0eda6..94de0134b4ad 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -837,7 +837,9 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev
     aPaint.setStrokeWidth(fLineWidth);
     aPaint.setAntiAlias(mParent.getAntiAliasB2DDraw());
 
-    if (eLineJoin != basegfx::B2DLineJoin::NONE)
+    // Skia does not support basegfx::B2DLineJoin::NONE, so in that case batch only if lines
+    // are not wider than a pixel.
+    if (eLineJoin != basegfx::B2DLineJoin::NONE || fLineWidth <= 1.0)
     {
         SkPath aPath;
         aPath.setFillType(SkPathFillType::kEvenOdd);
@@ -849,7 +851,7 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev
         getDrawCanvas()->drawPath(aPath, aPaint);
         addXorRegion(aPath.getBounds());
     }
-    else // Skia does not support basegfx::B2DLineJoin::NONE, draw each line separately
+    else
     {
         for (sal_uInt32 i = 0; i < aPolyPolygonLine.count(); ++i)
         {


More information about the Libreoffice-commits mailing list