Skip to content

Reduce idle cpu usage when a selection is active

Bip Boop requested to merge bipboop/krita:reduce_idle_cpu_with_selection into master

I made it so that when a canvas widget receives a show/hide event it sets the visibility of its decorations accordingly. This reduces idle cpu usage when the application is minimized and a selection is active because it prevents the ant animation from updating.

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

Test Plan

  1. Create a new image
  2. Hit ctrl+a to select all
  3. Minimize Krita
  4. Check a system monitor of some sort for CPU/GPU usage.

It should idle at 0.0% with this patch and some small but non zero without.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports

Loading