shadow: add shadow caching for paint
shadow: add shadow aching for mask
shadow: do not use translation when generate pattern hash