brush masks: speed up rendering

this gives a factor of 2-3; finally rendering speed is still not too
impressive...