Diffusion Krita dbb062fb089f

Refactor KisDabRenderingQueue to use shared pointers for jobs instead of copying

Authored by dkazakov on Oct 20 2017, 11:33 AM.

Description

Refactor KisDabRenderingQueue to use shared pointers for jobs instead of copying

This patch solves the following issues:

  1. The original design of the queue expected the list to store *all* the dabs (copies and postprocessing ones) that were requested after the latest real, non-copied dab. That caused severe problems on very trivial brushes (with precision <= 3), which had only 1(!) dab for the stroke (all the other dabs were just clones). These brushes asked the queue to store *all* the dabs of the stroke, which ate and fragmented memory.

    Such requirement was ruled by the addressing trick: we could get the index of the job by its seqNo in contant time. Now we broke this requirement and started to locate the needed job with binary search in O(log(N)). In our case N will seldom be higher than 1000.
  1. Shared pointers also solve the problem of copying the data between original and running job. No no copying happens.
  1. KisDabRenderingJob is now split into two classes with different responsibilities. KisDabRenderingJob stored the data for the rendering, and KisDabRenderingJobRunner (derived from QRunnable) executes it.

Ref T7052

Details

Committed
dkazakovOct 20 2017, 11:33 AM
Parents
R37:02461e0852a1: Cache 'lastDabJob' value
Branches
Unknown
Tags
Unknown
Tasks
T7052: problematic brush with multithreading build