optimize AlphaMaskFilter when used for cache