tdf#148569 set extra drawing constraints when scaling
Previously, setting stroke width and cap was only done when running
unit tests. But the same drawing contraints are necessary when running
with a Retina display on macOS.
Change-Id: I74f7347d30a410f7d3485388ffec61b32730b948
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168973
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
(cherry picked from commit a4488013ee6c87a97501b620dbbf56622fb70246)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168947
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 4c34d9a..b572002 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -729,7 +729,12 @@ void SkiaSalGraphicsImpl::drawPixel(tools::Long nX, tools::Long nY, Color nColor
SkPaint paint = makePixelPaint(nColor);
// Apparently drawPixel() is actually expected to set the pixel and not draw it.
paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
if (mScaling != 1 && isUnitTestRunning())
// tdf#148569 set extra drawing constraints when scaling
// Previously, setting stroke width and cap was only done when running
// unit tests. But the same drawing contraints are necessary when running
// with a Retina display on macOS.
if (mScaling != 1)
{
// On HiDPI displays, draw a square on the entire non-hidpi "pixel" when running unittests,
// since tests often require precise pixel drawing.