Right now the mask for each subclass that uses MaskingModification (i.e. everything in the FilterPattern tool) is updated recursively each time the masked image is re-rendered (or whenever MaskingModification.mask() is called). When there are a bunch of layers, this can slow it down as it has to make boolean comparisons between all preceding arrays.
Solution:
To speed it up, the masks from the preceding layers in the linked list can be cached for each individual layer so that each layer only recursively updates once. All other updates would simply used the cached version. The cache would need to know when a preceding layer's mask was changed so that it knows to re-cache.
Caching implemented. Images also only update after brush strokes finish, which greatly improves performance (albeit at the cost of the image not updating live).
Problem:
Right now the mask for each subclass that uses MaskingModification (i.e. everything in the FilterPattern tool) is updated recursively each time the masked image is re-rendered (or whenever MaskingModification.mask() is called). When there are a bunch of layers, this can slow it down as it has to make boolean comparisons between all preceding arrays.
Solution: To speed it up, the masks from the preceding layers in the linked list can be cached for each individual layer so that each layer only recursively updates once. All other updates would simply used the cached version. The cache would need to know when a preceding layer's mask was changed so that it knows to re-cache.