cherry-pick canvas fixes from 9eaa024
cherry-pick sprite fixes from d533d89