Skip to content

Some fixes having to do with partial renderings (fix bug 423360)

Max Mueggler requested to merge stapledbattery/okular:partial-render-opts into master

These two commits fix issues that were causing unnecessary re-renderings and blank flashes.

  1. Page::hasPixmap was setting the size of the TilesManager, causing it to be marked dirty and everything to be re-rendered. It is a const function and shouldn't have been doing this. This was especially problematic on hi-dpi displays where sometimes hasPixmap was being called with the scaled size and sometimes with the unscaled size, causing the TilesManager to be dirtied every time the page was scrolled. I removed this and added a separate Page::setSize function.
  2. Partial renderings (which are often mostly blank) were being drawn over dirty tiles. This means that whenever the zoom level changes, which dirties all tiles, the user would have to wait for the entire screen to be re-rendered. With my change, fully-rendered tiles will take preference over partial updates, even if they are dirty, with the assumption that usually a pixelated image is preferred over an incomplete one.

For simple PDFs, such as a book, this fixes https://bugs.kde.org/show_bug.cgi?id=423360. For complex PDFs, such as maps, this makes Okular no longer unusable on hi-dpi displays.

This merge request is based on my branch for !665 (merged), but I can remove the commits for that if the merge requests need to be resolved separately.

BUG: https://bugs.kde.org/show_bug.cgi?id=423360

Edited by Oliver Sander

Merge request reports