Improved constant runtime of mask initialization

When a fully transparent pixel only has fully transparent pixels around it, then this information is saved into a boolean and reused for the following pixel. This allows to reduce the number of lookups of bordering pixels to 3 (the 3 right ones) instead of all 8.

On my machine around 100ms got saved with this method for a texture that had a lot of fully transparent pixels.