Skip to content
Commit ab3365ff authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix delays on the stroke start when the brush is too big

This patch implements two things:

1) Makes sure that KisBrushBasedPaintOpSettings::m_savedBrush is
   actually passed by into the stroke (with cloning of course).
   Cloning of brushes is cheap due to lazy copying mechanism of
   QImage.

2) Implements a special manager class (KisPresetShadowUpdater) that
   regenerates brush'es heavy data structures (such as brush outline
   and image pyramid) in background (with a 1500 ms delay after the
   brush change).

It means that the brush on the server will always store the correct
data cached. When the user starts the stroke, this data is just cloned
and passed to the stroke without extra recalculation (which may take
up to 1000 ms for heavy brush tips).

** POSSIBLE REGRESSIONS **

1) It may happen that the brush outline will be outdated after some of
   the brush settings are changed.

2) It may happen that the changes in the brush settings will not be
   visible in the actual stroke right aftert that.

I haven't seen these regressions in real life, but, theoretically,
they can happen.

BUG:436731
parent 68391657
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment