Skip to content

MyPaint selector improve performance

Instead of setPixel(), MyPaint shade selector now uses sequential iterator to write data to the KisPaintDeviceSP. It makes it faster.

There was a performance issue caused by my changes to MyPaint shade selector on high dpi displays, not it has 4x more pixels to write to, so it appeared much slower.

Before the MR, with a standard size ACS with MyPaint shade selector, it would take 180 ms to be painted (while triangle selector just needed ~20ms). This MR lowers it down to 40ms and now it feels smooth. (It still lags if the user makes the docker very large, of course).

This MR should improve the performance on the low res displays too, of course.

Test Plan

If you cannot see the performance issues on MyPaint selector (I tested it with the triangle HSV selector), you can just make it very big. No matter what is the resolution of your display and how big is the selector, my changes should make it faster, but you it's better if you see the problem to begin with :)

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