summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Wagner <thorsten.wagner.4@gmail.com>2021-03-20 21:20:53 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-03-24 14:46:30 +0100
commit852f8888844366f7efa6a7f1fa2a0500fc0a89c1 (patch)
tree67609b8f8b033e75b67cbe7d7f26ed1bdb6c08bc
parenttdf#140136 sc: fix tree list expansion in AutoFilter (diff)
downloadcore-852f8888844366f7efa6a7f1fa2a0500fc0a89c1.tar.gz
core-852f8888844366f7efa6a7f1fa2a0500fc0a89c1.zip
tdf#141063 Always use region rectangles for clipping on macOS
The use of polygons currently causes misalignment by one pixel. Use of polygons is dropped on macOS by this change similar it has been done for SKIA to fix tdf#133208. Change-Id: I31faf7cf9b33908a52cb60d1b631308b4fe45e56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112823 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 00d12793f5d9a73f784e23aff61e2618f0fc01c0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112952 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 5a90e1bd01044843ee78b3e43ae79b4c4fb6c07e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112954 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--vcl/quartz/salgdicommon.cxx42
1 files changed, 9 insertions, 33 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 33ffc43741a1..bbfe185b73d2 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -127,21 +127,6 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
}
}
-static void AddPolyPolygonToPath( CGMutablePathRef xPath,
- const basegfx::B2DPolyPolygon& rPolyPoly,
- bool bPixelSnap, bool bLineDraw )
-{
- // short circuit if there is nothing to do
- if( rPolyPoly.count() == 0 )
- {
- return;
- }
- for(auto const& rPolygon : rPolyPoly)
- {
- AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw );
- }
-}
-
bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
const PhysicalFontFace* pFontData,
const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding,
@@ -1431,30 +1416,21 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip )
mxClipPath = CGPathCreateMutable();
// set current path, either as polypolgon or sequence of rectangles
- if(i_rClip.HasPolyPolygonOrB2DPolyPolygon())
- {
- const basegfx::B2DPolyPolygon aClip(i_rClip.GetAsB2DPolyPolygon());
+ RectangleVector aRectangles;
+ i_rClip.GetRegionRectangles(aRectangles);
- AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAlias(), false );
- }
- else
+ for(const auto& rRect : aRectangles)
{
- RectangleVector aRectangles;
- i_rClip.GetRegionRectangles(aRectangles);
+ const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 logic in original
- for(const auto& rRect : aRectangles)
+ if(nW)
{
- const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 logic in original
+ const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 logic in original
- if(nW)
+ if(nH)
{
- const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 logic in original
-
- if(nH)
- {
- const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), nW, nH);
- CGPathAddRect( mxClipPath, nullptr, aRect );
- }
+ const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), nW, nH);
+ CGPathAddRect( mxClipPath, nullptr, aRect );
}
}
}