When painting a mask is generated that only changes when some parameters
changes. Currently this mask was recreated every time the cache was
updated. This patch checks if the mask should be regenerated based on selected settings:
- Radius
- Number of used aa samples
- Brush curve and preset.
Found when doing some performance analysis.
Still WIP as the offsets are currently ignored. But the patch shows that there is potential to improve the performance.
To reduce memory needs we could store the offset differences as deltas and limit the number of offsets with a bit mask (5x5).