committed patch [#33972] dilate/erode optimization

this patch optimizes the dilate/erode step method (hopefully without any functional change),
making its speed not depend on the distance anymore.

Couldn't detect funtional changes so committing. Haven't tested for speed gain.

 * credits to erwin94 David M



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54096 954f8c5b-7b00-dc11-b283-0030488c597c