Bitmasking instead of casting
Refactoring AlphaBlend to its own function