Refactored premultiplyAlpha/unpremultiplyAlpha