Related tdf#148569: do not apply macOS fix to non-macOS platforms

Setting the stroke width and cap has a noticeable performance penalty
when running on GTK3. Since tdf#148569 only appears to occur on macOS
Retina displays, revert commit a4488013ee
for non-macOS platforms.

Change-Id: I2435434c6f66b84483046ea558bac3d47b8803ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169475
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
This commit is contained in:
Patrick Luby 2024-06-24 15:34:47 -04:00 committed by Patrick Luby
parent 9f62c7a0f2
commit ef2c71d3a7

View file

@ -730,11 +730,20 @@ void SkiaSalGraphicsImpl::drawPixel(tools::Long nX, tools::Long nY, Color nColor
// Apparently drawPixel() is actually expected to set the pixel and not draw it.
paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
#ifdef MACOSX
// 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 constraints are necessary when running
// with a Retina display on macOS.
if (mScaling != 1)
#else
// Related tdf#148569: do not apply macOS fix to non-macOS platforms
// Setting the stroke width and cap has a noticeable performance penalty
// when running on GTK3. Since tdf#148569 only appears to occur on macOS
// Retina displays, revert commit a4488013ee6c87a97501b620dbbf56622fb70246
// for non-macOS platforms.
if (mScaling != 1 && isUnitTestRunning())
#endif
{
// On HiDPI displays, draw a square on the entire non-hidpi "pixel" when running unittests,
// since tests often require precise pixel drawing.