vcl/skia/gdiimpl.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit d4c445ff1ab3e89baa59fc5328ef28b686fde459
Author:     Patrick Luby <[email protected]>
AuthorDate: Sat Aug 31 17:27:04 2024 -0400
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Mon Sep 2 05:39:33 2024 +0200

    tdf#162646 don't move orthogonal polypolygons when scaling
    
    Previously, polypolygons would be moved slightly but this causes
    misdrawing of orthogonal polypolygons (i.e. polypolygons with only
    vertical and horizontal lines) when using a Retina display on
    macOS.
    
    Change-Id: I314b22aaa84131e7e987d0ed99cc67a99297daf0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172677
    Reviewed-by: Patrick Luby <[email protected]>
    Tested-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index f9d591dba4df..eaed2d7c99b7 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -927,6 +927,14 @@ void SkiaSalGraphicsImpl::performDrawPolyPolygon(const 
basegfx::B2DPolyPolygon&
     // So if AA is enabled, avoid this fixup for rectangular areas.
     if (!useAA || !hasOnlyOrthogonal)
     {
+#ifdef MACOSX
+        // tdf#162646 don't move orthogonal polypolygons when scaling
+        // Previously, polypolygons would be moved slightly but this causes
+        // misdrawing of orthogonal polypolygons (i.e. polypolygons with only
+        // vertical and horizontal lines) when using a Retina display on
+        // macOS and antialiasing is disabled.
+        if ((!isUnitTestRunning() && (useAA || !hasOnlyOrthogonal)) || 
getWindowScaling() == 1)
+#else
         // We normally use pixel at their center positions, but slightly off 
(see toSkX/Y()).
         // With AA lines that "slightly off" causes tiny changes of color, 
making some tests
         // fail. Since moving AA-ed line slightly to a side doesn't cause any 
real visual
@@ -934,6 +942,7 @@ void SkiaSalGraphicsImpl::performDrawPolyPolygon(const 
basegfx::B2DPolyPolygon&
         // When running on macOS with a Retina display, one BackendTest unit
         // test will fail if the position is adjusted.
         if (!isUnitTestRunning() || getWindowScaling() == 1)
+#endif
         {
             const SkScalar posFix = useAA ? toSkXYFix : 0;
             polygonPath.offset(toSkX(0) + posFix, toSkY(0) + posFix, nullptr);

Reply via email to