vcl/skia/gdiimpl.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit ef2c71d3a78904a917b3001f6ec043d00fc3f71f
Author: Patrick Luby <[email protected]>
AuthorDate: Mon Jun 24 15:34:47 2024 -0400
Commit: Patrick Luby <[email protected]>
CommitDate: Tue Jun 25 17:05:16 2024 +0200
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.
Change-Id: I2435434c6f66b84483046ea558bac3d47b8803ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169475
Tested-by: Jenkins
Reviewed-by: Patrick Luby <[email protected]>
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index e6fdff986eae..2fdccc772253 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -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.