Bug 141063 - White lines during scrolling across bitmap images on macOS
Summary: White lines during scrolling across bitmap images on macOS
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All macOS (All)
: medium normal
Assignee: Thorsten Wagner
URL:
Whiteboard: target:7.2.0 target:7.1.2
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-16 11:52 UTC by Thorsten Wagner
Modified: 2021-03-25 23:43 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Screenshot 1 (904.25 KB, image/png)
2021-03-16 11:52 UTC, Thorsten Wagner
Details
Screenshot 2 (815.17 KB, image/png)
2021-03-16 11:53 UTC, Thorsten Wagner
Details
Screenshot 3 (1.61 MB, image/png)
2021-03-16 11:53 UTC, Thorsten Wagner
Details
Screenshot 4 (1.43 MB, image/png)
2021-03-16 11:54 UTC, Thorsten Wagner
Details
Screenshot 5 (1.63 MB, image/png)
2021-03-16 11:54 UTC, Thorsten Wagner
Details
Example document (248.98 KB, application/vnd.oasis.opendocument.text)
2021-03-16 11:54 UTC, Thorsten Wagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Wagner 2021-03-16 11:52:21 UTC
Description:
Using LO 7.1.1 there were issues with alpha blending (see screenshot 1). Something has changed and this issue disappeared with LO 7.1.2 (see screenshot 2). Furthermode bitmap images were rendered blurry with LO 7.1.1 (see screenshot 3). With LO 7.1.2 these images are sharp again (see screenshot 4), but there is a new issue: When scrolling over window borders white lines remain within the images (see screenshot 5).

Steps to Reproduce:
1. Open attached file "Example.odt" with Writer
2. Scroll up and down in a way that the images crosses the upper or lower window border

Actual Results:
White lines remain after scrolling (see screenshot 5)

Expected Results:
Image is displayed without white lines (as in screenshot 4 prior to scrolling)


Reproducible: Always


User Profile Reset: No



Additional Info:
Issue existis with all LO applications (tested with Writer and Impress). Changes between LO 7.1.1 and LO 7.1.2 concern not only macOS (which has been used for the screenshots). Change between LO 7.1.1 and 7.1.2 is visible e.g. using GTK too.

Issue existis on master as well as on LO 7.1.2 branch.
Comment 1 Thorsten Wagner 2021-03-16 11:52:52 UTC
Created attachment 170509 [details]
Screenshot 1
Comment 2 Thorsten Wagner 2021-03-16 11:53:12 UTC
Created attachment 170510 [details]
Screenshot 2
Comment 3 Thorsten Wagner 2021-03-16 11:53:36 UTC
Created attachment 170511 [details]
Screenshot 3
Comment 4 Thorsten Wagner 2021-03-16 11:54:07 UTC
Created attachment 170512 [details]
Screenshot 4
Comment 5 Thorsten Wagner 2021-03-16 11:54:25 UTC
Created attachment 170513 [details]
Screenshot 5
Comment 6 Thorsten Wagner 2021-03-16 11:54:51 UTC
Created attachment 170514 [details]
Example document
Comment 7 Noel Grandin 2021-03-16 12:02:39 UTC
I cannot repro this with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9b9d4da7c688b884c428cda6900415fe891f88c2
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-ZA (en_ZA); UI: en-US
Calc: CL

Might well be a backend or a graphics card issue, that looks suspiciously like faulty rescaling.
Comment 8 Thorsten Wagner 2021-03-16 12:10:55 UTC
(In reply to Noel Grandin from comment #7)
> I cannot repro this with
> 
> Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: 9b9d4da7c688b884c428cda6900415fe891f88c2
> CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL:
> win
> Locale: en-ZA (en_ZA); UI: en-US
> Calc: CL
> 
> Might well be a backend or a graphics card issue, that looks suspiciously
> like faulty rescaling.

Thanks for testing. Are you able to test on macOS or Linux/UNIX?
Comment 9 Thorsten Wagner 2021-03-16 12:16:45 UTC
... and without SKIA. It does not seem to be a graphics card issue because I tested on four different Macs with and without retina graphics. Issue is always present there.
Comment 10 Timur 2021-03-16 12:46:58 UTC
No repro 7.2+ Win Skia/Gdi, also no Lin GTK3.
Comment 11 Telesto 2021-03-16 13:32:12 UTC
Looks a lot like bug 133208 (got fixed for Skia)
Comment 12 Noel Grandin 2021-03-16 16:20:41 UTC
I can reproduce this on

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 2e5055ed463ef987105b32eda5e0454b0a9dc7f3
CPU threads: 4; OS: Mac OS X 11.2.3; UI render: default; VCL: osx
Locale: en-ZA (en_ZA.UTF-8); UI: en-US
Calc: threaded

So it is something to do with the rendering on macOS.
Comment 13 Noel Grandin 2021-03-16 17:53:05 UTC
Also noting that if I tab away and then back, the image displays properly, making me think that this is some kind of invalidation/refresh/redraw issue.
Comment 14 Xisco Faulí 2021-03-17 17:08:15 UTC
I can't reproduce it in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: d7ed130f537a81b900c55d222004cc9e88c0b355
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 15 steve 2021-03-18 08:36:16 UTC
Confirming with
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 005adbefc746f9024adcf572c287dc061acbcf00
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
2021-03-18
Comment 16 Thorsten Wagner 2021-03-20 01:10:16 UTC
(In reply to Telesto from comment #11)
> Looks a lot like bug 133208 (got fixed for Skia)

Very good hint, it seems to be the same issue - will prepare a patch
Comment 17 Thorsten Wagner 2021-03-20 23:14:41 UTC
Submitted patch to Gerrit:

https://gerrit.libreoffice.org/c/core/+/112823
Comment 18 Telesto 2021-03-21 13:03:58 UTC
(In reply to Thorsten Wagner from comment #16)
> (In reply to Telesto from comment #11)
> > Looks a lot like bug 133208 (got fixed for Skia)
> 
> Very good hint, it seems to be the same issue - will prepare a patch

Thanks for the quick fix. 

Some off topic/on topic remark
This I kind reason I have tendency to prefer harmonize backends in long term (so Skia also on MacOS). It's lacking GPU rendering too; at least I would think so.. 

Disclaimer: still trying to find developers who might want to work on this :P. In the assumption I vision is shared (not everybody is that convinced this being worthwhile) And well MacOS developers are scarce commodity .. so me kind of hoping you might pick it up (if you agree) don't care if takes 2 years. But the idea someone (maybe) working on it would be delightful already.

--
More specific for this case. Luboš Luňák extended the testing framework to test for this issue (if I read the commit properly). Any change to apply this test also for MacOS (it doesn't seem to be included in the gerrit patch).
Comment 19 Thorsten Wagner 2021-03-21 14:16:51 UTC
(In reply to Telesto from comment #18)
> This I kind reason I have tendency to prefer harmonize backends in long term
> (so Skia also on MacOS). It's lacking GPU rendering too; at least I would
> think so.. 

Harmonizing backends requires more discussion I think. Skia is not the way Apple goes. Within current implementation CoreGraphics (and CGLayers) is used. This is not GPU accelerated. The Apple way of GPU acceleration are CALayers.

As VCL is a framework which allows platform specific implementation by design. CALayers are possible to implement using the current code structure too (and probably with less effort than switching to Skia on macOS).

Implementations like Chrome or Firefox chose another way: They use a unified backend (like Skia). This causes the same look on all platforms at the end. Advantage is a smaller (and probably better to maintain) code base. On the other hand native look and feel (which is the strength of VCL) will go away. UI controls of Chrome, Firefox, and Thunderbird are good examples.

There are several ways between, but this are general design decisions dropping the way VCL is going for the time beeing (and probably dropping some strengths of VCL). Such a way between could be harmonizing the Graphics backend only while keeping UI controls native (like Microsoft Office goes). On macOS this does not solve the currently implemented old Carbon controls (HITheme). To replace them while keeping a native look a switch to Cocoa controls has to be done (and Cocoa uses CALayers as well). Not so easy as it looks like at first sight...
Comment 20 Timur 2021-03-22 09:14:45 UTC
Hi Lubos. Please see Comment 19,and make some comment.
Comment 21 Luboš Luňák 2021-03-22 17:31:31 UTC
Yes, this looks like the macosx variant of bug #133208.

As for the Skia discussion, I'm not aware of any plan to make LO use Skia on macosx, and without that any discussion about the details is moot.
Comment 22 Commit Notification 2021-03-23 09:07:24 UTC
Thorsten Wagner committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/00d12793f5d9a73f784e23aff61e2618f0fc01c0

tdf#141063 Always use region rectangles for clipping on macOS

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2021-03-23 12:30:45 UTC
Thorsten Wagner committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/5a90e1bd01044843ee78b3e43ae79b4c4fb6c07e

tdf#141063 Always use region rectangles for clipping on macOS

It will be available in 7.1.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2021-03-24 13:46:55 UTC
Thorsten Wagner committed a patch related to this issue.
It has been pushed to "libreoffice-7-1-2":

https://git.libreoffice.org/core/commit/852f8888844366f7efa6a7f1fa2a0500fc0a89c1

tdf#141063 Always use region rectangles for clipping on macOS

It will be available in 7.1.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 Telesto 2021-03-24 20:56:58 UTC
(In reply to Thorsten Wagner from comment #19)
Thanks for the reply; and sorry for the delay.  You convinced me already. Native look and feel is pretty important :D
Comment 26 steve 2021-03-25 23:43:14 UTC
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 8940975262a98dc1087712e366f595289ac650b3
CPU threads: 8; OS: Mac OS X 10.16 aka 11.2.3; UI render: default; VCL: osx
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Verified, thanks Thorsten!