vcl/skia/gdiimpl.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit e091cd0104cf982b500d57202cf7e1fa8d5815ca Author: Patrick Luby <plub...@libreoffice.org> AuthorDate: Sat Dec 16 19:31:16 2023 -0500 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Dec 17 07:54:31 2023 +0100 Fix Skia unit test failure when using a HiDPI display When running on macOS with a Retina display, one BackendTest unit test will fail if the position is adjusted. Change-Id: Iaf8678dd6bcb842bae7a9f45ae632114795e7a1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160878 Reviewed-by: Patrick Luby <plub...@libreoffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index ffdeb81b2ad2..e8ec52725392 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -897,8 +897,13 @@ void SkiaSalGraphicsImpl::performDrawPolyPolygon(const basegfx::B2DPolyPolygon& // 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 // difference, just place exactly at the center. tdf#134346 - const SkScalar posFix = useAA ? toSkXYFix : 0; - polygonPath.offset(toSkX(0) + posFix, toSkY(0) + posFix, nullptr); + // When running on macOS with a Retina display, one BackendTest unit + // test will fail if the position is adjusted. + if (!isUnitTestRunning() || getWindowScaling() == 1) + { + const SkScalar posFix = useAA ? toSkXYFix : 0; + polygonPath.offset(toSkX(0) + posFix, toSkY(0) + posFix, nullptr); + } } if (moFillColor) {