Krita Saving Requirements
- Normal saving can happen only when all the actions (strokes) running over the image are finished.
- If something is still running, the user sees a progress dialog that asks him to wait
- The user has options:
- Cancel current stroke (a request for stroke cancellation is dispatched and the waiting continues until the action is canceled)
- Cancel saving (the waiting dialog closes and no saving happens)
- Save without waiting (dangerous)
- If the user selects Save without waiting:
- the user sees a warning that the saved image may be incomplete(!)
- Krita suggests him to select a different location for saving
- Krita locks() the image without waiting for completion of the current stroke
- If current LoD is not 0, Krita does recovery procedures, that forcefully switch the LoD, save the document and close Krita.
- While user-requested saving is in progress the user sees a progress dialog, showing that Krita is busy.
- Autosave should not distract the user from his normal work.
- The saving happens in background
- The autosaver should first wait when all the strokes are finished (or try to insert itself in between running strokes)
- Quickly copy the image
- Save that copied image in the background
- Generation of the mergedimage.png and thumbnail.png for autosaved documents can be disabled. It makes saving faster and doesn't demand regeneration the image
- The saving happens in background
- Current problems with cloning of the image
- Layer styles are not copied correctly
- Layer projections are not copied, therefore we need initialRefreshGraph to generate mergedimage.png and thumbnail.png.
- initialRefreshGraph() is slow and allocates a lot of duplicated memory for projections, therefore not using lazy copying.