Changed brush to use cached gradient. Now complex gradients don't slow down the brush.
Also fixed a bug in cached gradients, that made them not correctly set a new gradient.