Bug 164428 - No progress bar saving to PDF with Skia Metal; fine with Skia/Raster
Summary: No progress bar saving to PDF with Skia Metal; fine with Skia/Raster
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All macOS (All)
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Skia
  Show dependency treegraph
 
Reported: 2024-12-22 15:17 UTC by Telesto
Modified: 2024-12-25 16:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2024-12-22 15:17:43 UTC
Description:
No progress bar saving to PDF with Skia Metal; fine with Skia/Raster

Steps to Reproduce:
1. Open https://drive.usercontent.google.com/download?id=1UacZYIhlo505D3S3nGeWA6gY2uHndP1P&export=download or some other large document
2. Click Export PDF and export. No progress bar

Actual Results:
No progress bar for pdf export

Expected Results:
Progress bar while saving pdf


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 141f3fd15633803afa720837405a0bacbc2726cb
CPU threads: 8; OS: macOS 14.7.1; UI render: Skia/Metal; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded

fine with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5682e1d4145c26fc8021879df0543d5aeacf9c83
CPU threads: 8; OS: macOS 14.7.1; UI render: Skia/Metal; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 1 Patrick (volunteer) 2024-12-25 00:18:54 UTC
I can reproduce this bug in the 2024-12-24 master nightly build:

Version: 25.8.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 2305fe302e12c4256e452589e2533772d4213e59
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded


The progress bar works fine in LibreOffice 24.8.4 release so I will test if my commit 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc is the cause of this bug. Unfortunately, I have to do a full clean build. If I run my local debug build, exporting PDF does show the progressbar when using Skia/Metal. But, the export takes at least 20 or more seconds compared to no more than 5 seconds in today's master nightly build.
Comment 2 Telesto 2024-12-25 02:59:10 UTC
(In reply to Patrick (volunteer) from comment #1)
> I can reproduce this bug in the 2024-12-24 master nightly build:
> 
> Version: 25.8.0.0.alpha0+ (AARCH64) / LibreOffice Community
> Build ID: 2305fe302e12c4256e452589e2533772d4213e59
> CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
> Locale: en-CA (en_CA.UTF-8); UI: en-US
> Calc: threaded

A)  So on Intel Skia/Raster is working fine, but not for AARCH64 builds?

B) The Progress bar is indeed lacking in more cases. It's not specific for PDF export. Opening a large PDF in Draw. Saving big document Writer document and so on

FWIW: Opening a file from Start Center does show the progress bar itself. It doesn't give much feedback; it's not really progressing, though
Comment 3 Patrick (volunteer) 2024-12-25 03:07:57 UTC
(In reply to Telesto from comment #2)
> A)  So on Intel Skia/Raster is working fine, but not for AARCH64 builds?
> 

Not exactly. On AARCH64 Skia/Metal: shows no progress bar. Skia/Raster show progress bar fine. I copied the LibreOffice > About data after I tested Skia/Raster even though the problem is only with Skia/Metal.

> B) The Progress bar is indeed lacking in more cases. It's not specific for
> PDF export. Opening a large PDF in Draw. Saving big document Writer document
> and so on

It is something I can add to the "magic flush algorithm for Skia/Metal" code for macOS. Skia/Metal is very finicky as to the flush rate (not too many and not too few times per second).

I already have a "mbForceFlush" flag. I think I'll need to add a "mbScrollbarForceFlush" flag and just plow through all of the "don't flush now" conditions.
Comment 4 Patrick (volunteer) 2024-12-25 13:05:59 UTC
(In reply to Patrick (volunteer) from comment #3)
> I already have a "mbForceFlush" flag. I think I'll need to add a
> "mbScrollbarForceFlush" flag and just plow through all of the "don't flush
> now" conditions.

Correction: I meant "mbProgressbarForceFlush".
Comment 5 Commit Notification 2024-12-25 15:30:03 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1846448d81aab9812410a30303c0c36a41a825b6

tdf#164428 Skia/Metal needs flush after drawing progress bar

It will be available in 25.8.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 6 Patrick (volunteer) 2024-12-25 15:35:25 UTC
I have committed a fix for this bug. The fix will be in tomorrow's (26 December 2024) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Note for macOS testers: the nightly master build installer does not overwrite any LibreOffice official versions. Instead, it will be installed as a separate application called "LibreOfficeDev" in the /Applications folder.

Because this is a "test" build, you will need to do the following steps before you launch the LibreOfficeDev application:

1. Go to the Finder and navigate to the /Applications/Utilities folder
2. Launch the "Terminal" application
3. Paste the following command in the Terminal application window and press the Return key to execute the command:

   xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app