Skip to content
  • Dmitry Kazakov's avatar
    Fix random slowdowns on when painting with LoD and Animation · ffed3379
    Dmitry Kazakov authored
    This patch fixes multiple slowdowns caused my our background
    working threads:
    
    1) KisRegenerateFrameStrokeStrategy should *not* invalidate LOD planes
       (actually it doesn't write anything). So it should become a Lod0 stroke
       instead of a legacy one. Now it has a fake LodN buddy and suspend/resume
       strategies to mimic to Lod0 stroke.
    
    2) KisAnimationCachePopulator should do the colorspace conversion in a
       background thread not related to the strokes. For bigger images (8k) or
       weird color spaces (Float32) the conversion might take up to 2-3 seconds
       and running the conversion in a context of a stroke will block the user
       from doing useful things all this time.
    
    3) LodN planes should be synced from time to tine even when there are no
       Legacy strokes are present. The point is some brushes generate not
       identical results on different levels, so the two histories diverge
       with time. Now there is a special KisIdleWatcher class that runs a job
       when the image is idle (no strokes are running).
    
    4) KisAnimationCachePopulator is also connected to its own populator
       stored in KisPart that helps it not to call barrierLock() every half
       a second.
    ffed3379