Skip to content

452831 452155 Fix G'MIC layer application

This MR fixes layer metadata application (Krita -> G'MIC wholesale, G'MIC -> Krita for the positioning and bounding).

Additionally, it refactors the complete G'MIC image import process, making all steps into Krita commands. This allows undoing and redoing G'MIC filters, which was previously not possible for two reasons:

  • layer properties application was done in-situ (thus the undo system was not aware of them, so undo was incomplete for reused layers)
  • layer insertion was not only done in-situ, but it also altered the internal state of the command (thus making redoing impossible)

This commit performs the following:

  • Removal of all unused (pre Krita 5) code.
  • Reimplementation of the layer synchronization command into a composite command.
  • Reimplementation of the layer metadata processing and image composite functions from the applicator into separate, fully undoable commands.
  • Switch of the processing visitor's layer metadata processing to a separate, undoable command (see above).
  • Fix leaking the G'MIC image data on KisQMicImage destruction.
  • Simplification of the KisImageInterface application step by de-signal-slotting it.

This requires an update to the G'MIC plugin, which is attached.

BUG: 452831

BUG: 452155

Test Plan

Build Krita and test that small layers can be applied correctly, undone and redone in their corresponding positions.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Amy spark

Merge request reports