[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - basegfx/source drawinglayer/source include/basegfx

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed May 15 08:31:17 UTC 2019


 basegfx/source/polygon/b2dpolypolygontools.cxx          |   18 ----------------
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   10 --------
 drawinglayer/source/processor2d/vclprocessor2d.cxx      |   10 --------
 include/basegfx/polygon/b2dpolygontools.hxx             |    3 --
 4 files changed, 41 deletions(-)

New commits:
commit d82a1d32df7e90c940c81351b1a0eedf166611bc
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue May 14 16:44:17 2019 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed May 15 10:30:20 2019 +0200

    Revert "drawinglayer: avoid AA for hairline polygons built from ...
    
    .. hori/vert lines only"
    
    This reverts commit f8b4d371eddd27594d549fb00294c01229a9bd24. Tomaz
    considers this ugly and it's no longer needed since commit
    93abdf39b01bb7b404dc09ef37369a4350fb0d10 (sw lok: assume no windows in
    SwLayoutFrame::PaintSwFrame(), 2019-05-14).
    
    (cherry picked from commit 35ab83872f184c22c5f52f43ee38d3669340b192)
    
    Conflicts:
            basegfx/test/B2DPolygonTest.cxx
            drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
    
    Change-Id: Ia9b29921ff3e5d82085e1abf9f39c172357a5e13
    Reviewed-on: https://gerrit.libreoffice.org/72343
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index 046463e8f141..644e08bb6358 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -456,24 +456,6 @@ namespace basegfx
             return aRetval;
         }
 
-        bool containsOnlyHorizontalOrVerticalLines(const basegfx::B2DPolygon& rPolygon)
-        {
-            if (rPolygon.count() <= 1)
-                return false;
-
-            for (size_t i = 1; i < rPolygon.count(); ++i)
-            {
-                const basegfx::B2DPoint& rPrevPoint = rPolygon.getB2DPoint(i - 1);
-                const basegfx::B2DPoint& rPoint = rPolygon.getB2DPoint(i);
-                if (rPrevPoint.getX() == rPoint.getX() || rPrevPoint.getY() == rPoint.getY())
-                    continue;
-
-                return false;
-            }
-
-            return true;
-        }
-
         B2DPolyPolygon createSevenSegmentPolyPolygon(sal_Char nNumber, bool bLitSegments)
         {
             // config here
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 162f0e27e00f..9c21c83ee8f8 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -165,16 +165,6 @@ namespace drawinglayer
             mpOutputDevice->SetLineColor(Color(aLineColor));
             aLocalPolygon.transform(maCurrentTransformation);
 
-            if (getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
-            {
-                if (basegfx::utils::containsOnlyHorizontalOrVerticalLines(aLocalPolygon))
-                {
-                    // DrawPolyLineDirect() only works in AA mode, but pure horizontal or vertical
-                    // lines are better with AA off.
-                    return false;
-                }
-            }
-
             // try drawing; if it did not work, use standard fallback
             return mpOutputDevice->DrawPolyLineDirect( aLocalPolygon, 0.0, fTransparency);
         }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 74c662f82a12..e1cf42b0f42c 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -328,7 +328,6 @@ namespace drawinglayer
             basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
             aLocalPolygon.transform(maCurrentTransformation);
 
-            bool bDisableAA = false;
             if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
             {
                 // #i98289#
@@ -337,18 +336,9 @@ namespace drawinglayer
                 // not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This
                 // NEEDS to be done in discrete coordinates, so only useful for pixel based rendering.
                 aLocalPolygon = basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon);
-
-                // Also disable AA, snap would leave the start/end of lines still anti-aliased when
-                // their coordinates are provided in logic units.
-                bDisableAA = basegfx::utils::containsOnlyHorizontalOrVerticalLines(aLocalPolygon);
             }
 
-            const AntialiasingFlags nOriginalAA(mpOutputDevice->GetAntialiasing());
-            if (bDisableAA && (nOriginalAA & AntialiasingFlags::EnableB2dDraw))
-                mpOutputDevice->SetAntialiasing(nOriginalAA & ~AntialiasingFlags::EnableB2dDraw);
             mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0);
-            if (bDisableAA && (nOriginalAA & AntialiasingFlags::EnableB2dDraw))
-                mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() | AntialiasingFlags::EnableB2dDraw);
         }
 
         // direct draw of transformed BitmapEx primitive
diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx
index cac3dccfe5a6..c20668995d56 100644
--- a/include/basegfx/polygon/b2dpolygontools.hxx
+++ b/include/basegfx/polygon/b2dpolygontools.hxx
@@ -438,9 +438,6 @@ namespace basegfx
         */
         BASEGFX_DLLPUBLIC B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate);
 
-        /// Determines if rPolygon lacks diagonal lines or not.
-        BASEGFX_DLLPUBLIC bool containsOnlyHorizontalOrVerticalLines(const basegfx::B2DPolygon& rPolygon);
-
         /// get the tangent with which the given point is entered seen from the previous
         /// polygon path data. Take into account all stuff like closed state, zero-length edges and others.
         BASEGFX_DLLPUBLIC B2DVector getTangentEnteringPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex);


More information about the Libreoffice-commits mailing list