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.
{F11796495}
Still WIP as the offsets are currently ignored.