• Dmitry Kazakov's avatar
    Implement the first version of the multithreaded Pixel Brush · e03e9533
    Dmitry Kazakov authored
    All the presets that use Pixel Brush (KisBrushOp) are now
    multithreaded and rendered asynchronously. Basically, it means
    that if the brush is too slow, Krita will lower down FPS rate
    for the sake of faster rendering of the stroke.
    Short summary:
    1) It doesn't use strokes system's threading, just QtConcurrent. It
       is not good, but works for now. I hope it is only a temporary
    2) Updates are coming asynchronously with the period of 20...80ms,
       which is 50...12fps. I didn't manage to implement a correct control
       loop for auto-adjusting the FPS value, because it needs porting the
       threading part into strokes system and a bit of refactoring of
       the strokes system itself. Therefore, the FPS adjustment is controlled
       by an open-loop system, based on one-dab-rendering-time. Basically,
       FPS is proportional to the time spent on rendering a single tile.
    3) The patch adds two new API functions: KisPaintOpSettings::
       needsAsynchronousUpdates() tells if the paintop uses threading and
       needs asynchronous updates. When this function returns true, the
       freehand stroke does additional calls to
       KisPaintOp::doAsyncronousUpdate(), which does the rendering itself.
    4) Still to be implemented:
         * color source options
         * postprocessing: sharpness and texturing
         * selection handling (works only in Wash mode)
         * mirroring mode
         * pipe brushes
KoCompositeOp.cpp 5.52 KB