Skip to content

Optimization of recolor mode

Matthias Möller requested to merge mmoeller/okular:opt-recolor-mode into master

Scrolling in re-color mode [1] is a bit sluggish on my PC. A benchmark test [2] showed, that just the PagePainter::recolor method takes already around 30ms on my PC.

This MR optimizes the PagePainter::recolor method.

The improvements bring the runtime from ~30ms down to ~3ms on my PC [2].

The changes for the improvement are not that wild. The recolor method is, with this MR, in similar structure as the other coloring changes methods i.e. PagePainter::invertLightness.


[1] "Configure" -> "Accessibility" -> check "Change Colors" -> select "Change Dark & Light Colors" in combobox

[2]: "Benchmark Code & Results" https://invent.kde.org/-/snippets/1368

Edited by Matthias Möller

Merge request reports